From 352446f1c71f7f42aae7e32c40ab1f1c65745be1 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 7 Dec 2024 12:31:43 +0100 Subject: [PATCH] add endpoint /api/hs/office/memberships/M-{membershipNumber} - WIP --- ...ice-memberships-with-membershipNumber.yaml | 85 +++++++++++++++++++ .../api-definition/hs-office/hs-office.yaml | 4 + 2 files changed, 89 insertions(+) create mode 100644 src/main/resources/api-definition/hs-office/hs-office-memberships-with-membershipNumber.yaml diff --git a/src/main/resources/api-definition/hs-office/hs-office-memberships-with-membershipNumber.yaml b/src/main/resources/api-definition/hs-office/hs-office-memberships-with-membershipNumber.yaml new file mode 100644 index 00000000..88cf784a --- /dev/null +++ b/src/main/resources/api-definition/hs-office/hs-office-memberships-with-membershipNumber.yaml @@ -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' diff --git a/src/main/resources/api-definition/hs-office/hs-office.yaml b/src/main/resources/api-definition/hs-office/hs-office.yaml index b7725285..915afb61 100644 --- a/src/main/resources/api-definition/hs-office/hs-office.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office.yaml @@ -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"