
components:

    schemas:

        HsOfficePartner:
            type: object
            properties:
                uuid:
                    type: string
                    format: uuid
                partnerNumber:
                    type: string
                    pattern: 'P-[0-9]{5}'
                partnerRel:
                    $ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
                details:
                    $ref: '#/components/schemas/HsOfficePartnerDetails'

        HsOfficePartnerDetails:
            type: object
            nullable: false
            properties:
                uuid:
                    type: string
                    format: uuid
                registrationOffice:
                    type: string
                    nullable: true
                registrationNumber:
                    type: string
                    nullable: true
                birthName:
                    type: string
                    nullable: true
                birthPlace:
                    type: string
                    nullable: true
                birthday:
                    type: string
                    format: date
                    nullable: true
                dateOfDeath:
                    type: string
                    format: date
                    nullable: true

        HsOfficePartnerPatch:
            type: object
            properties:
                uuid:
                    type: string
                    format: uuid
                    nullable: true
                    description: if given (e.g. taken from a GET request), it must be identical to the patched entities uuid
                partnerNumber:
                    type: string
                    pattern: 'P-[0-9]{5}'
                    nullable: true
                    description: if given (e.g. taken from a GET request), it must be identical to the patched entities partnerNumber
                partnerRel:
                    $ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelationPatch'
                details:
                    $ref: '#/components/schemas/HsOfficePartnerDetailsPatch'
            additionalProperties: false

        HsOfficePartnerDetailsPatch:
            type: object
            nullable: false
            properties:
                registrationOffice:
                    type: string
                    nullable: true
                registrationNumber:
                    type: string
                    nullable: true
                birthName:
                    type: string
                    nullable: true
                birthPlace:
                    type: string
                    nullable: true
                birthday:
                    type: string
                    format: date
                    nullable: true
                dateOfDeath:
                    type: string
                    format: date
                    nullable: true
            additionalProperties: false

        HsOfficePartnerInsert:
            type: object
            properties:
                partnerNumber:
                    type: string
                    pattern: 'P-[0-9]{5}'
                partnerRel:
                    $ref: '#/components/schemas/HsOfficePartnerRelInsert'
                details:
                    $ref: '#/components/schemas/HsOfficePartnerDetailsInsert'
            required:
                - partnerNumber
                - partnerRel
                - details
            additionalProperties: false

        HsOfficePartnerRelInsert:
            type: object
            nullable: false
            properties:
                anchor.uuid:
                    type: string
                    format: uuid
                holder.uuid:
                    type: string
                    format: uuid
                contact.uuid:
                    type: string
                    format: uuid
            required:
                - anchor.uuid
                - holder.uuid
                - relContact.uuid
            additionalProperties: false

        HsOfficePartnerDetailsInsert:
            type: object
            nullable: false
            properties:
                registrationOffice:
                    type: string
                    nullable: true
                registrationNumber:
                    type: string
                    nullable: true
                birthName:
                    type: string
                    nullable: true
                birthPlace:
                    type: string
                    nullable: true
                birthday:
                    type: string
                    format: date
                    nullable: true
                dateOfDeath:
                    type: string
                    format: date
                    nullable: true
            additionalProperties: false
