components:

    schemas:

        HsOfficeReasonForTermination:
            type: string
            enum:
                - NONE
                - CANCELLATION
                - TRANSFER
                - DEATH
                - LIQUIDATION
                - EXPULSION

        HsOfficeMembership:
            type: object
            properties:
                uuid:
                    type: string
                    format: uuid
                partner:
                    $ref: './hs-office-partner-schemas.yaml#/components/schemas/HsOfficePartner'
                mainDebitor:
                    $ref: './hs-office-debitor-schemas.yaml#/components/schemas/HsOfficeDebitor'
                memberNumber:
                    type: integer
                    minimum: 1000000
                    maximum: 9999999
                memberNumberSuffix:
                    type: string
                    minLength: 2
                    maxLength: 2
                    pattern: '[0-9]+'
                validFrom:
                   type: string
                   format: date
                validTo:
                   type: string
                   format: date
                reasonForTermination:
                   $ref: '#/components/schemas/HsOfficeReasonForTermination'
                membershipFeeBillable:
                    type: boolean

        HsOfficeMembershipPatch:
            type: object
            properties:
                validTo:
                    type: string
                    format: date
                    nullable: true
                reasonForTermination:
                    nullable: true
                    $ref: '#/components/schemas/HsOfficeReasonForTermination'
                membershipFeeBillable:
                    nullable: true
                    type: boolean
            additionalProperties: false

        HsOfficeMembershipInsert:
            type: object
            properties:
                partnerUuid:
                    type: string
                    format: uuid
                    nullable: false
                memberNumberSuffix:
                    type: string
                    minLength: 2
                    maxLength: 2
                    pattern: '[0-9]+'
                    nullable: false
                validFrom:
                    type: string
                    format: date
                    nullable: false
                validTo:
                    type: string
                    format: date
                    nullable: true
                reasonForTermination:
                    $ref: '#/components/schemas/HsOfficeReasonForTermination'
                membershipFeeBillable:
                    nullable: false
                    type: boolean
            required:
                - partnerUuid
                - memberNumberSuffix
                - validFrom
                - membershipFeeBillable
            additionalProperties: false