1
0

add SEPA-mandate API+Controller

This commit is contained in:
Michael Hoennig
2022-10-15 15:32:32 +02:00
parent 67e850f9b2
commit e305c3c935
11 changed files with 913 additions and 47 deletions

View File

@ -3,6 +3,7 @@ openapi-processor-mapping: v2
options:
package-name: net.hostsharing.hsadminng.hs.office.generated.api.v1
model-name-suffix: Resource
bean-validation: true
map:
result: org.springframework.http.ResponseEntity
@ -10,6 +11,7 @@ map:
types:
- type: array => java.util.List
- type: string:uuid => java.util.UUID
- type: string:format => java.lang.String
paths:
/api/hs/office/partners/{partnerUUID}:
@ -24,3 +26,5 @@ map:
null: org.openapitools.jackson.nullable.JsonNullable
/api/hs/office/debitors/{debitorUUID}:
null: org.openapitools.jackson.nullable.JsonNullable
/api/hs/office/sepamandates/{debitorUUID}:
null: org.openapitools.jackson.nullable.JsonNullable

View File

@ -0,0 +1,60 @@
components:
schemas:
HsOfficeSepaMandate:
type: object
properties:
uuid:
type: string
format: uuid
debitor:
$ref: './hs-office-debitor-schemas.yaml#/components/schemas/HsOfficeDebitor'
bankAccount:
$ref: './hs-office-bankaccount-schemas.yaml#/components/schemas/HsOfficeBankAccount'
reference:
type: string
validFrom:
type: string
format: date
validTo:
type: string
format: date
HsOfficeSepaMandatePatch:
type: object
properties:
validTo:
type: string
format: date
additionalProperties: false
HsOfficeSepaMandateInsert:
type: object
properties:
debitorUuid:
type: string
format: uuid
nullable: false
bankAccountUuid:
type: string
format: uuid
nullable: false
reference:
type: string
nullable: false
validFrom:
type: string
format: date
nullable: false
validTo:
type: string
format: date
nullable: true
required:
- debitorUuid
- bankAccountUuid
- reference
- validFrom
additionalProperties: false

View File

@ -0,0 +1,83 @@
get:
tags:
- hs-office-sepaMandates
description: 'Fetch a single SEPA Mandate by its uuid, if visible for the current subject.'
operationId: getSepaMandateByUuid
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: sepaMandateUUID
in: path
required: true
schema:
type: string
format: uuid
description: UUID of the SEPA Mandate to fetch.
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: './hs-office-sepamandate-schemas.yaml#/components/schemas/HsOfficeSepaMandate'
"401":
$ref: './error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: './error-responses.yaml#/components/responses/Forbidden'
patch:
tags:
- hs-office-sepaMandates
description: 'Updates a single SEPA Mandate by its uuid, if permitted for the current subject.'
operationId: patchSepaMandate
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: sepaMandateUUID
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
'application/json':
schema:
$ref: './hs-office-sepamandate-schemas.yaml#/components/schemas/HsOfficeSepaMandatePatch'
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: './hs-office-sepamandate-schemas.yaml#/components/schemas/HsOfficeSepaMandate'
"401":
$ref: './error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: './error-responses.yaml#/components/responses/Forbidden'
delete:
tags:
- hs-office-sepaMandates
description: 'Delete a single SEPA Mandate by its uuid, if permitted for the current subject.'
operationId: deleteSepaMandateByUuid
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: sepaMandateUUID
in: path
required: true
schema:
type: string
format: uuid
description: UUID of the sepaMandate 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

@ -0,0 +1,57 @@
get:
summary: Returns a list of (optionally filtered) SEPA Mandates.
description: Returns the list of (optionally filtered) SEPA Mandates which are visible to the current user or any of it's assumed roles.
tags:
- hs-office-sepaMandates
operationId: listSepaMandatesByIBAN
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: name
in: query
required: false
schema:
type: string
description: (Beginning of) IBAN to filter the results.
responses:
"200":
description: OK
content:
'application/json':
schema:
type: array
items:
$ref: './hs-office-sepamandate-schemas.yaml#/components/schemas/HsOfficeSepaMandate'
"401":
$ref: './error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: './error-responses.yaml#/components/responses/Forbidden'
post:
summary: Adds a new SEPA Mandate.
tags:
- hs-office-sepaMandates
operationId: addSepaMandate
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
requestBody:
description: A JSON object describing the new SEPA-Mandate.
required: true
content:
application/json:
schema:
$ref: '/hs-office-sepamandate-schemas.yaml#/components/schemas/HsOfficeSepaMandateInsert'
responses:
"201":
description: Created
content:
'application/json':
schema:
$ref: './hs-office-sepamandate-schemas.yaml#/components/schemas/HsOfficeSepaMandate'
"401":
$ref: './error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: './error-responses.yaml#/components/responses/Forbidden'
"409":
$ref: './error-responses.yaml#/components/responses/Conflict'

View File

@ -60,3 +60,12 @@ paths:
/api/hs/office/debitors/{debitorUUID}:
$ref: "./hs-office-debitors-with-uuid.yaml"
# SepaMandates
/api/hs/office/sepamandates:
$ref: "./hs-office-sepamandates.yaml"
/api/hs/office/sepamandates/{sepaMandateUUID}:
$ref: "./hs-office-sepamandates-with-uuid.yaml"