
components:

    schemas:

        HsOfficeRelationType:
            type: string
            enum:
                - UNKNOWN
                - PARTNER
                - EX_PARTNER
                - DEBITOR
                - REPRESENTATIVE
                - VIP_CONTACT
                - OPERATIONS
                - OPERATIONS_ALERT
                - SUBSCRIBER

        HsOfficeRelation:
            type: object
            properties:
                uuid:
                    type: string
                    format: uuid
                anchor:
                    $ref: 'hs-office-person-schemas.yaml#/components/schemas/HsOfficePerson'
                holder:
                    $ref: 'hs-office-person-schemas.yaml#/components/schemas/HsOfficePerson'
                type:
                    type: string
                mark:
                    type: string
                    nullable: true
                contact:
                    $ref: 'hs-office-contact-schemas.yaml#/components/schemas/HsOfficeContact'

        HsOfficeRelationPatch:
            type: object
            properties:
                contact.uuid:
                    type: string
                    format: uuid
                    nullable: true

        # arbitrary relation with explicit type
        HsOfficeRelationInsert:
            type: object
            properties:
                anchor.uuid:
                    type: string
                    format: uuid
                holder.uuid:
                    type: string
                    format: uuid
                type:
                    type: string
                    nullable: true
                mark:
                    type: string
                    nullable: true
                contact.uuid:
                    type: string
                    format: uuid
            required:
              - anchor.uuid
              - holder.uuid
              - type
              - contact.uuid

        # relation created as a sub-element with implicitly known type
        HsOfficeRelationSubInsert:
            type: object
            properties:
                anchor.uuid:
                    type: string
                    format: uuid
                holder.uuid:
                    type: string
                    format: uuid
                mark:
                    type: string
                    nullable: true
                contact.uuid:
                    type: string
                    format: uuid
            required:
                - anchor.uuid
                - holder.uuid
                - contact.uuid
