add endpoint /api/hs/office/memberships/M-{membershipNumber} - WIP

This commit is contained in:
Michael Hoennig 2024-12-07 12:31:43 +01:00
parent ab2c5245e9
commit 352446f1c7
2 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,85 @@
get:
tags:
- hs-office-memberships
description: 'Fetch a single membership by its membershipNumber, if visible for the current subject.'
operationId: getSingleMembershipByUuid
parameters:
- $ref: 'auth.yaml#/components/parameters/currentSubject'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: membershipNumber
in: path
required: true
schema:
type: number
format: integer
minimum: 1000000
maximum: 9999999
description: membershipNumber of the membership to fetch.
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: 'hs-office-membership-schemas.yaml#/components/schemas/HsOfficeMembership'
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'
patch:
tags:
- hs-office-memberships
description: 'Updates a single membership by its uuid, if permitted for the current subject.'
operationId: patchMembership
parameters:
- $ref: 'auth.yaml#/components/parameters/currentSubject'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: membershipUUID
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
'application/json':
schema:
$ref: 'hs-office-membership-schemas.yaml#/components/schemas/HsOfficeMembershipPatch'
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: 'hs-office-membership-schemas.yaml#/components/schemas/HsOfficeMembership'
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'
delete:
tags:
- hs-office-memberships
description: 'Delete a single membership by its uuid, if permitted for the current subject.'
operationId: deleteMembershipByUuid
parameters:
- $ref: 'auth.yaml#/components/parameters/currentSubject'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: membershipUUID
in: path
required: true
schema:
type: string
format: uuid
description: UUID of the membership to delete.
responses:
"204":
description: No Content
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'
"404":
$ref: 'error-responses.yaml#/components/responses/NotFound'

View File

@ -82,6 +82,10 @@ paths:
/api/hs/office/memberships:
$ref: "hs-office-memberships.yaml"
/api/hs/office/memberships/M-{membershipNumber}:
$ref: "hs-office-memberships-with-membershipNumber.yaml"
/api/hs/office/memberships/{membershipUUID}:
$ref: "hs-office-memberships-with-uuid.yaml"