eeg_portal/eeg_frontend/openapi.yaml

402 lines
9.7 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/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 triggert den asynchronen
EDA-Check.
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/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/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
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:
firstName:
type: string
example: Max
minLength: 1
lastName:
type: string
example: Mustermann
minLength: 1
email:
type: string
format: email
example: max@example.com
minLength: 1
password:
type: string
example: SecurePass123!
maxLength: 2147483647
minLength: 8
atNumber:
type: string
example: AT0010000000000000000000001234567
minLength: 1
pattern: "^AT[0-9]{31}$"
required:
- atNumber
- email
- firstName
- lastName
- 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
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
firstName:
type: string
lastName:
type: string
email:
type: string
status:
type: string
primaryAtNumber:
type: string