1
0

http-get endpoints for partner, debitor and memberhip-number (#135)

Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/135
Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
Michael Hoennig
2024-12-11 11:35:51 +01:00
parent c7b17ee546
commit 19fac6b5e1
39 changed files with 672 additions and 171 deletions

View File

@@ -13,6 +13,7 @@ map:
- type: string:uuid => java.util.UUID
- type: string:format => java.lang.String
- type: number:currency => java.math.BigDecimal
- type: number:integer => java.lang.Integer
paths:
/api/hs/office/partners/{partnerUUID}:

View File

@@ -27,8 +27,6 @@ components:
nullable: false
membership.memberNumber:
type: string
minLength: 9
maxLength: 9
pattern: 'M-[0-9]{7}'
transactionType:
$ref: '#/components/schemas/HsOfficeCoopAssetsTransactionType'
@@ -69,8 +67,6 @@ components:
nullable: false
membership.memberNumber:
type: string
minLength: 9
maxLength: 9
pattern: 'M-[0-9]{7}'
transactionType:
$ref: '#/components/schemas/HsOfficeCoopAssetsTransactionType'
@@ -130,8 +126,6 @@ components:
format: uuid
adoptingMembership.memberNumber:
type: string
minLength: 9
maxLength: 9
pattern: 'M-[0-9]{7}'
required:
- membership.uuid

View File

@@ -13,8 +13,6 @@ components:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
debitorNumber:
type: string
minLength: 9
maxLength: 9
pattern: 'D-[0-9]{7}'
debitorNumberSuffix:
type: string

View File

@@ -0,0 +1,29 @@
get:
tags:
- hs-office-debitors
description: 'Fetch a single debitor by its debitorNumber, if visible for the current subject.'
operationId: getSingleDebitorByDebitorNumber
parameters:
- $ref: 'auth.yaml#/components/parameters/currentSubject'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: debitorNumber
in: path
required: true
schema:
type: number
format: integer
minimum: 1000000
maximum: 9999999
description: debitor-number of the debitor to fetch.
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: 'hs-office-debitor-schemas.yaml#/components/schemas/HsOfficeDebitor'
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'

View File

@@ -13,15 +13,20 @@ get:
schema:
type: string
description: Prefix of name properties from person or contact to filter the results.
- name: debitorNumber
- name: partnerUuid
in: query
required: false
schema:
type: string
minLength: 9
maxLength: 9
pattern: 'D-[0-9]{7}'
description: Debitor number of the requested debitor.
format: uuid
description: UUID of the business partner, exclusive to `memberNumber`.
- name: partnerNumber
in: query
required: false
schema:
type: string
pattern: 'P-[0-9]{5}'
description: Partner number of the requested debitor.
responses:
"200":
description: OK

View File

@@ -27,14 +27,10 @@ components:
$ref: 'hs-office-debitor-schemas.yaml#/components/schemas/HsOfficeDebitor'
memberNumber:
type: string
minLength: 9
maxLength: 9
pattern: 'M-[0-9]{7}'
memberNumberSuffix:
type: string
minLength: 2
maxLength: 2
pattern: '[0-9]+'
pattern: '[0-9]{2}'
validFrom:
type: string
format: date
@@ -69,9 +65,7 @@ components:
nullable: false
memberNumberSuffix:
type: string
minLength: 2
maxLength: 2
pattern: '[0-9]+'
pattern: '[0-9]{2}'
nullable: false
validFrom:
type: string

View File

@@ -0,0 +1,29 @@
get:
tags:
- hs-office-memberships
description: 'Fetch a single membership by its membershipNumber, if visible for the current subject.'
operationId: getSingleMembershipByMembershipNumber
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'

View File

@@ -15,15 +15,13 @@ get:
type: string
format: uuid
description: UUID of the business partner, exclusive to `memberNumber`.
- name: memberNumber
- name: partnerNumber
in: query
required: false
schema:
type: string
minLength: 9
maxLength: 9
pattern: 'M-[0-9]{7}'
description: Member number, exclusive to `partnerUuid`.
pattern: 'P-[0-9]{5}'
description: partnerNumber of the partner the memberships belong to
responses:
"200":
description: OK

View File

@@ -11,8 +11,6 @@ components:
format: uuid
partnerNumber:
type: string
minLength: 7
maxLength: 7
pattern: 'P-[0-9]{5}'
partnerRel:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
@@ -87,8 +85,6 @@ components:
properties:
partnerNumber:
type: string
minLength: 7
maxLength: 7
pattern: 'P-[0-9]{5}'
partnerRel:
$ref: '#/components/schemas/HsOfficePartnerRelInsert'

View File

@@ -0,0 +1,28 @@
get:
tags:
- hs-office-partners
description: 'Fetch a single business partner by its partner-number (prefixed with "P-"), if visible for the current subject.'
operationId: getSinglePartnerByPartnerNumber
parameters:
- $ref: 'auth.yaml#/components/parameters/currentSubject'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: partnerNumber
in: path
required: true
schema:
type: integer
minimum: 10000
maximum: 99999
description: partner-number (prefixed with "P-") of the partner to fetch.
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: 'hs-office-partner-schemas.yaml#/components/schemas/HsOfficePartner'
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'

View File

@@ -13,6 +13,9 @@ paths:
/api/hs/office/partners:
$ref: "hs-office-partners.yaml"
/api/hs/office/partners/P-{partnerNumber}:
$ref: "hs-office-partners-with-partnerNumber.yaml"
/api/hs/office/partners/{partnerUUID}:
$ref: "hs-office-partners-with-uuid.yaml"
@@ -58,6 +61,9 @@ paths:
/api/hs/office/debitors:
$ref: "hs-office-debitors.yaml"
/api/hs/office/debitors/D-{debitorNumber}:
$ref: "hs-office-debitors-with-debitorNumber.yaml"
/api/hs/office/debitors/{debitorUUID}:
$ref: "hs-office-debitors-with-uuid.yaml"
@@ -76,6 +82,9 @@ 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"