eeg_portal/eeg_frontend/openapi.yaml

566 lines
14 KiB
YAML

openapi: 3.1.0
info:
title: OpenAPI definition
version: v0
servers:
- url: http://localhost
description: Generated server url
tags:
- name: Authentication
description: Public Endpoints für Login und Registrierung
- name: Admin IAM
description: User-Verwaltung und Freigabe-Workflow
paths:
/api/community/admin/memberships/{id}/reject:
put:
tags:
- membership-controller
operationId: rejectMembership
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
/api/community/admin/memberships/{id}/approve:
put:
tags:
- membership-controller
operationId: approveMembership
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
/api/admin/energy-communities/{id}:
get:
tags:
- energy-community-admin-controller
operationId: getEnergyCommunityById
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/EnergyCommunityDto"
put:
tags:
- energy-community-admin-controller
operationId: updateEnergyCommunity
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EnergyCommunityDto"
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/EnergyCommunityDto"
delete:
tags:
- energy-community-admin-controller
operationId: deleteEnergyCommunity
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
/api/community/metering-points:
get:
tags:
- metering-point-controller
operationId: getAllMeteringPoints
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MeteringPointResponse"
post:
tags:
- metering-point-controller
operationId: addOwnMeteringPoint
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateMeteringPointRequest"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/MeteringPointResponse"
/api/community/memberships/request:
post:
tags:
- membership-controller
operationId: requestMembership
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/MembershipRequest"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
format: uuid
/api/auth/register:
post:
tags:
- Authentication
summary: Registriert einen neuen User inkl. Zählpunkt
description: Setzt den User auf Status PENDING und versendet eine Verifizierungs-E-Mail.
operationId: register
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RegistrationRequest"
required: true
responses:
"200":
description: OK
/api/auth/login:
post:
tags:
- Authentication
summary: User Login
description: "Gibt einen JWT zurück. Schlägt fehl, wenn Status noch PENDING\
\ ist."
operationId: login
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/LoginRequest"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/AuthResponse"
/api/admin/users/{userId}/reject:
post:
tags:
- Admin IAM
summary: User ablehnen
description: Lehnt den Antrag ab (z.B. weil Zählpunkt nicht ins Netz passt).
operationId: rejectUser
parameters:
- name: userId
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
/api/admin/users/{userId}/approve:
post:
tags:
- Admin IAM
summary: User freigeben
description: "Setzt enabled=true, status=APPROVED und triggert die finale EDA-Anmeldung."
operationId: approveUser
parameters:
- name: userId
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
/api/admin/energy-communities:
get:
tags:
- energy-community-admin-controller
operationId: getAllEnergyCommunities
responses:
"200":
description: Liste der wartenden Benutzer erfolgreich geladen
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/EnergyCommunityDto"
post:
tags:
- energy-community-admin-controller
operationId: createEnergyCommunity
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EnergyCommunityDto"
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/EnergyCommunityDto"
/api/dashboard/user:
get:
tags:
- dashboard-controller
operationId: getUserDashboard
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/UserStats"
/api/dashboard/admin:
get:
tags:
- dashboard-controller
operationId: getAdminDashboard
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/AdminStats"
/api/community/metering-points/{id}/eligible-communities:
get:
tags:
- membership-controller
operationId: getEligibleCommunities
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/EligibleCommunityResponse"
/api/community/metering-points/me:
get:
tags:
- metering-point-controller
operationId: getOwnMeteringPoints
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MeteringPointResponse"
/api/auth/verify-email:
get:
tags:
- Authentication
operationId: verifyEmail
parameters:
- name: token
in: query
required: true
schema:
type: string
responses:
"200":
description: OK
/api/admin/users/pending:
get:
tags:
- Admin IAM
summary: Lädt alle wartenden User
description: Zeigt User im Status PENDING inkl. der Ergebnisse des EDA-Netz-Checks.
operationId: getPendingUsers
responses:
"200":
description: Liste der wartenden Benutzer erfolgreich geladen
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/UserProfileResponse"
components:
schemas:
EnergyCommunityDto:
type: object
properties:
id:
type: string
format: uuid
edaEcId:
type: string
type:
type: string
enum:
- EEG_LOKAL
- EEG_REGIONAL
- BEG
name:
type: string
gridOperatorId:
type: string
substationId:
type: string
transformerId:
type: string
memberCount:
type: integer
format: int32
CreateMeteringPointRequest:
type: object
properties:
atNumber:
type: string
pattern: "^AT[0-9]{31}$"
type:
type: string
enum:
- CONSUMER
- PRODUCER
- PROSUME
required:
- atNumber
- type
MeteringPointResponse:
type: object
properties:
id:
type: string
format: uuid
userId:
type: string
format: uuid
atNumber:
type: string
type:
type: string
enum:
- CONSUMER
- PRODUCER
- PROSUME
makoState:
type: string
enum:
- NEW
- WAITING_FOR_CONSENT
- CONSENT_GRANTED
- ACTIVE
- REJECTED
- ERROR
gridOperatorId:
type: string
ownerEmail:
type: string
MembershipRequest:
type: object
properties:
meteringPointId:
type: string
format: uuid
energyCommunityId:
type: string
format: uuid
priorityLevel:
type: integer
format: int32
maximum: 5
minimum: 1
required:
- energyCommunityId
- meteringPointId
- priorityLevel
RegistrationRequest:
type: object
description: Payload für die Registrierung eines neuen Users
properties:
participantType:
type: string
description: Privatperson oder juristische Person (Firma/Verein/Gemeinde)
enum:
- PRIVATE
- COMPANY
example: PRIVATE
firstName:
type: string
description: "Vorname (bei juristischer Person: Vorname der Ansprechperson)"
example: Max
minLength: 1
lastName:
type: string
description: "Nachname (bei juristischer Person: Nachname der Ansprechperson)"
example: Mustermann
minLength: 1
organizationName:
type: string
description: "Nur bei juristischer Person: Firmen-, Vereins- oder Gemeindename"
example: Musterverein
email:
type: string
format: email
example: max@example.com
minLength: 1
password:
type: string
example: SecurePass123!
maxLength: 2147483647
minLength: 8
required:
- email
- firstName
- lastName
- participantType
- password
LoginRequest:
type: object
description: Payload für den Login
properties:
email:
type: string
format: email
example: max@example.com
minLength: 1
password:
type: string
example: SecurePass123!
minLength: 1
required:
- email
- password
AuthResponse:
type: object
description: Antwort nach erfolgreichem Login
properties:
token:
type: string
description: JWT Bearer Token
status:
type: string
description: Status des Users
example: PENDING
role:
type: string
description: Rolle des Users
example: USER
UserStats:
type: object
properties:
totalMeteringPoints:
type: integer
format: int64
activeMemberships:
type: integer
format: int64
pendingMemberships:
type: integer
format: int64
AdminStats:
type: object
properties:
totalCommunities:
type: integer
format: int64
pendingUsers:
type: integer
format: int64
totalActiveMemberships:
type: integer
format: int64
EligibleCommunityResponse:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
type:
type: string
enum:
- EEG_LOKAL
- EEG_REGIONAL
- BEG
edaEcId:
type: string
UserProfileResponse:
type: object
description: Repräsentation eines Users für das Admin-Dashboard
properties:
id:
type: string
format: uuid
participantType:
type: string
enum:
- PRIVATE
- COMPANY
firstName:
type: string
lastName:
type: string
organizationName:
type: string
email:
type: string
status:
type: string