1
0

rename hs-admin to hs-office regarding the module name

This commit is contained in:
Michael Hoennig
2022-09-13 13:27:52 +02:00
parent 7465b9df63
commit 4e90f53bf3
43 changed files with 540 additions and 544 deletions

View File

@ -0,0 +1,16 @@
openapi-processor-mapping: v2
options:
package-name: net.hostsharing.hsadminng.hs.office.generated.api.v1
model-name-suffix: Resource
map:
result: org.springframework.http.ResponseEntity
types:
- type: array => java.util.List
- type: string:uuid => java.util.UUID
paths:
/api/hs/office/partners/{packageUUID}:
null: org.openapitools.jackson.nullable.JsonNullable

View File

@ -0,0 +1 @@
../auth.yaml

View File

@ -0,0 +1 @@
../error-responses.yaml

View File

@ -0,0 +1,28 @@
components:
schemas:
HsOfficeContactBase:
type: object
properties:
label:
type: string
postalAddress:
type: string
emailAddresses:
type: string
phoneNumbers:
type: string
HsOfficeContact:
allOf:
- type: object
properties:
uuid:
type: string
format: uuid
- $ref: '#/components/schemas/HsOfficeContactBase'
HsOfficeContactUpdate:
$ref: '#/components/schemas/HsOfficeContactBase'

View File

@ -0,0 +1,45 @@
components:
schemas:
HsOfficePartnerBase:
type: object
properties:
registrationOffice:
type: string
registrationNumber:
type: string
birthName:
type: string
birthday:
type: string
format: date
dateOfDeath:
type: string
format: date
HsOfficePartner:
allOf:
- type: object
properties:
uuid:
type: string
format: uuid
person:
$ref: './hs-office-person-schemas.yaml#/components/schemas/HsOfficePerson'
contact:
$ref: './hs-office-contact-schemas.yaml#/components/schemas/HsOfficeContact'
- $ref: '#/components/schemas/HsOfficePartnerBase'
HsOfficePartnerUpdate:
allOf:
- type: object
properties:
personUuid:
type: string
format: uuid
contactUuid:
type: string
format: uuid
- $ref: '#/components/schemas/HsOfficePartnerBase'

View File

@ -0,0 +1,81 @@
get:
tags:
- hs-office-partners
description: 'Fetch a single business partner by its uuid, if visible for the current subject.'
operationId: getPartnerByUuid
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: partnerUUID
in: path
required: true
schema:
type: string
format: uuid
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'
patch:
tags:
- hs-office-partners
operationId: updatePartner
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: partnerUUID
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
'application/json':
schema:
$ref: './hs-office-partner-schemas.yaml#/components/schemas/HsOfficePartnerUpdate'
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'
delete:
tags:
- hs-office-partners
operationId: deletePartnerByUuid
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: userUuid
in: path
required: true
schema:
type: string
format: uuid
description: UUID of the user 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,56 @@
get:
summary: Returns a list of (optionally filtered) business partners.
description: Returns the list of (optionally filtered) business partners which are visible to the current user or any of it's assumed roles.
tags:
- hs-office-partners
operationId: listPartners
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
- name: name
in: query
required: false
schema:
type: string
description: Customer-prefix to filter the results. TODO
responses:
"200":
description: OK
content:
'application/json':
schema:
type: array
items:
$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'
post:
summary: Adds a new business partner.
tags:
- hs-office-partners
operationId: addPartner
parameters:
- $ref: './auth.yaml#/components/parameters/currentUser'
- $ref: './auth.yaml#/components/parameters/assumedRoles'
requestBody:
content:
'application/json':
schema:
$ref: './hs-office-partner-schemas.yaml#/components/schemas/HsOfficePartner'
required: true
responses:
"201":
description: Created
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'
"409":
$ref: './error-responses.yaml#/components/responses/Conflict'

View File

@ -0,0 +1,33 @@
components:
schemas:
HsOfficePersonBase:
type: object
properties:
personType:
type: string
enum:
- NATURAL # a human
- LEGAL # e.g. Corp., Inc., AG, GmbH, eG
- SOLE_REPRESENTATION # e.g. OHG, GbR
- JOINT_REPRESENTATION # e.g. community of heirs
tradeName:
type: string
givenName:
type: string
familyName:
type: string
HsOfficePerson:
allOf:
- type: object
properties:
uuid:
type: string
format: uuid
- $ref: '#/components/schemas/HsOfficePersonBase'
HsOfficePersonUpdate:
$ref: '#/components/schemas/HsOfficePersonBase'

View File

@ -0,0 +1,16 @@
openapi: 3.0.1
info:
title: Hostsharing hsadmin-ng API
version: v0
servers:
- url: http://localhost:8080
description: Local development default URL.
paths:
/api/hs/office/partners:
$ref: "./hs-office-partners.yaml"
/api/hs/office/partners/{partnerUUID}:
$ref: "./hs-office-partners-with-uuid.yaml"