openapi: 3.0.1
info:
  title: Elevate Contract Management
  description: >
    ### Contract Management


    Provides read & write access to manage contract profiles and to allocate
    contracts to customers


    #### Definitions

    * Contract Profile - used to define the contract terms including early
    termination charges and contract term length

    * Customer Contract - a contract profile that has been assigned to a
    customer
  version: '1.11'
servers:
  - url: https://rest.elevatebilling.com/v1
tags:
  - name: contract-profiles
    description: >-
      Contract profiles are used to define early termination charges and
      contract term length
  - name: customer-contracts
    description: Contract profiles that are assigned to customer and sites
paths:
  /contract-profiles:
    get:
      tags:
        - contract-profiles
      summary: Get a list of available contract profiles
      operationId: getContractProfiles
      x-si-permissions:
        - VIEW_CONTRACT_PROFILE
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: contractOwnerId
          in: query
          description: Filter by contract owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by contract profile name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: rolloverContractProfileId
          in: query
          description: Filter by rollover contract profile
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: includeSupersededVersions
          in: query
          description: Filter to include superseded i.e. old versions of the profile
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContractProfile'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    post:
      tags:
        - contract-profiles
      summary: Create a new contract profile
      operationId: createContractProfile
      x-si-permissions:
        - CREATE_CONTRACT_PROFILE
      security:
        - bearerAuth: []
      requestBody:
        description: New contract profile
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractProfile'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractProfile'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractProfile'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    head:
      tags:
        - contract-profiles
      summary: Check if contract profile exists
      operationId: checkContractProfile
      x-si-permissions:
        - VIEW_CONTRACT_PROFILE
      security:
        - bearerAuth: []
      parameters:
        - name: contractOwnerId
          in: query
          description: Filter by contract owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by contract profile name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
      responses:
        '200':
          description: Exists
          content: {}
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /contract-profiles/{contract_profile_id}:
    get:
      tags:
        - contract-profiles
      summary: Get a specific contract profile
      operationId: getContractProfile
      x-si-permissions:
        - VIEW_CONTRACT_PROFILE
      security:
        - bearerAuth: []
      parameters:
        - name: contract_profile_id
          in: path
          description: Contract profile identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Contract profile found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractProfile'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    patch:
      tags:
        - contract-profiles
      summary: Update a contract profile
      description: >-
        Note that changing contract term or early termination charges will
        create a new profile version
      operationId: updateContractProfile
      x-si-json-patch: true
      x-si-allow-patch:
        - /name
        - /contractTerm
        - /earlyTermination(FixedCharge|PercentageCharge)
        - /rolloverContractProfileId
        - /renewalAlertDays
        - /noticePeriodDays
      x-si-permissions:
        - UPDATE_CONTRACT_PROFILE
      security:
        - bearerAuth: []
      parameters:
        - name: contract_profile_id
          in: path
          description: Contract profile identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: A set of JSONPatch operations to be performed
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              Rename:
                value:
                  - op: replace
                    path: /name
                    value: MyFavProfile
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractProfile'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractProfile'
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    delete:
      tags:
        - contract-profiles
      summary: Delete a contract profile
      description: Can only be done if not in use in contract or as roll-over profile
      operationId: deleteContractProfile
      x-si-permissions:
        - DELETE_CONTRACT_PROFILE
      security:
        - bearerAuth: []
      parameters:
        - name: contract_profile_id
          in: path
          description: Contract profile identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Success
          content: {}
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /customer-contracts:
    get:
      tags:
        - customer-contracts
      summary: Get a list of customer contracts
      operationId: getCustomerContracts
      x-si-permissions:
        - VIEW_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by customer contract name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: customerId
          in: query
          description: Filter by customer
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: siteId
          in: query
          description: Filter by site
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: contractProfileId
          in: query
          description: Filter by contract profile
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: startDate
          in: query
          description: Filter by start date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: endDate
          in: query
          description: Filter by end date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: rolloverContractProfileId
          in: query
          description: Filter by rollover contract profile
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: renewalAlert
          in: query
          description: Filter by contracts within renewal alert day(s)
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
          required: false
        - name: noticePeriod
          in: query
          description: Filter by contracts within notice period alert day(s)
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
          required: false
        - name: filter
          in: query
          description: >-
            Filter by text (Name, Assignment Level, Profile Name or Roll-over
            Profile Name)
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: includeSupersededVersions
          in: query
          description: >-
            Filter to include superseded i.e. old versions of the customer
            contract
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
          required: false
        - name: recentWithRPIsOrFuture
          in: query
          description: >-
            If true, then return only customer contracts associated to RPIs that
            are 'recent', or customer contracts starting in the future
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerContract'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    post:
      tags:
        - customer-contracts
      summary: Create a new customer contract
      operationId: createCustomerContract
      x-si-permissions:
        - CREATE_CUSTOMER_CONTRACT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New customer contract
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerContract'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    head:
      tags:
        - customer-contracts
      summary: Check if customer contract exists
      operationId: checkCustomerContract
      x-si-permissions:
        - VIEW_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      parameters:
        - name: name
          in: query
          description: Filter by customer contract name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: customerId
          in: query
          description: Filter by customer
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: siteId
          in: query
          description: Filter by site
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: contractProfileId
          in: query
          description: Filter by contract profile
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: startDate
          in: query
          description: Filter by start date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: endDate
          in: query
          description: Filter by end date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: rolloverContractProfileId
          in: query
          description: Filter by rollover contract profile
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: recentWithRPIsOrFuture
          in: query
          description: >-
            If true, then return only customer contracts associated to RPIs that
            are 'recent', or customer contracts starting in the future
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
          required: false
      responses:
        '200':
          description: Exists
          content: {}
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /customer-contracts/{customer_contract_id}:
    get:
      tags:
        - customer-contracts
      summary: Get a specific customer contract
      operationId: getCustomerContract
      x-si-permissions:
        - VIEW_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      parameters:
        - name: customer_contract_id
          in: path
          description: Customer contract identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Customer contract found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    patch:
      tags:
        - customer-contracts
      summary: Update a customer contract
      description: >-
        Note that once billing starts, only roll-over profile, renewal alert
        days, and notice period days can be edited. End date can be set to
        terminate and renew with a new contract prior to roll-over
      operationId: updateCustomerContract
      x-si-json-patch: true
      x-si-allow-patch:
        - /name
        - /customerId
        - /siteId
        - /contractProfileId
        - /startDate
        - /endDate
        - /rolloverContractProfileId
        - /renewalAlertDays
        - /noticePeriodDays
      x-si-requires-permission-to-update: true
      x-si-permissions:
        - UPDATE_CUSTOMER_CONTRACT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: customer_contract_id
          in: path
          description: Customer contract identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: A set of JSONPatch operations to be performed
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              Rename:
                value:
                  - op: replace
                    path: /name
                    value: MyFavContractProfile
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    delete:
      tags:
        - customer-contracts
      summary: Delete a customer contract
      description: >-
        Delete a customer contract - can only be done if not used by any rental
        product inventories
      operationId: deleteCustomerContract
      x-si-permissions:
        - DELETE_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      parameters:
        - name: customer_contract_id
          in: path
          description: Customer contract identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Success
          content: {}
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /customer-contract-assignments:
    get:
      tags:
        - customer-contracts
      summary: Get a list of RPI and Customer Contract assignments
      operationId: getCustomerContractAssignments
      x-si-permissions:
        - VIEW_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: customerContractId
          in: query
          description: Filter by customer contract
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: rentalProductInventoryId
          in: query
          description: Filter by RPI
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: active
          in: query
          description: Filter active contract assignments
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerContractAssignment'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    post:
      tags:
        - customer-contracts
      summary: Create a new customer contract RPI assignment
      operationId: createCustomerContractAssignment
      x-si-permissions:
        - CREATE_CUSTOMER_CONTRACT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New customer contract assignment
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerContractAssignment'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContractAssignment'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContractAssignment'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    head:
      tags:
        - customer-contracts
      summary: Check if customer contract assignment exists
      operationId: checkCustomerContractAssignment
      x-si-permissions:
        - VIEW_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      parameters:
        - name: customerContractId
          in: query
          description: Filter by customer contract
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: rentalProductInventoryId
          in: query
          description: Filter by RPI
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: active
          in: query
          description: Filter active contract assignments
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: Exists
          content: {}
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /customer-contract-assignments/{customer_contract_assignment_id}:
    get:
      tags:
        - customer-contracts
      summary: Get a specific customer contract assignment
      operationId: getCustomerContractAssignment
      x-si-permissions:
        - VIEW_CUSTOMER_CONTRACT
      security:
        - bearerAuth: []
      parameters:
        - name: customer_contract_assignment_id
          in: path
          description: Customer contract assignment identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Customer contract assignment found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContractAssignment'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
        '412':
          description: Precondition Failed
          content: {}
        '500':
          description: Internal Server Error
          content: {}
        '501':
          description: Not Implemented Yet
          content: {}
    delete:
      tags:
        - customer-contracts
      summary: Delete a customer contract RPI assignment
      operationId: deleteCustomerContractAssignment
      x-si-permissions:
        - DELETE_CUSTOMER_CONTRACT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: customer_contract_assignment_id
          in: path
          description: Customer contract assignment identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Success
          content: {}
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    patch:
      tags:
        - customer-contracts
      summary: Update a customer contract RPI assignment
      operationId: updateCustomerContractAssignment
      x-si-json-patch: true
      x-si-allow-patch:
        - /active
      x-si-requires-permission-to-update: true
      x-si-permissions:
        - UPDATE_CUSTOMER_CONTRACT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: customer_contract_assignment_id
          in: path
          description: Customer contract assignment identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: A set of JSONPatch operations to be performed
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              InactiveContract:
                value:
                  - op: replace
                    path: /active
                    value: 'false'
              ActiveContract:
                value:
                  - op: replace
                    path: /active
                    value: 'true'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContractAssignment'
        '400':
          description: Invalid Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
components:
  schemas:
    ContractProfile:
      required:
        - name
        - contractOwnerId
        - contractTerm
        - earlyTerminationFixedCharge
        - earlyTerminationPercentageCharge
      type: object
      properties:
        id:
          description: Contract profile identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        name:
          type: string
          description: Contract profile Name
          minLength: 1
          maxLength: 100
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        contractOwnerId:
          description: Contract Owner Identifier
          type: integer
          format: int32
          x-si-validation: '@ValidId'
        createdDate:
          readOnly: true
          description: Date when this contract profile was created
          type: string
          format: date-time
        contractTerm:
          description: Contract term in months
          type: integer
          format: int32
        earlyTerminationFixedCharge:
          description: Early termination fixed charge (in major currency)
          type: number
        earlyTerminationPercentageCharge:
          description: Early termination charge as a percentage
          type: integer
          format: int32
          minimum: 0
          maximum: 1000
        rolloverContractProfileId:
          description: >-
            Once term of this contract profile ends, contract using this profile
            will auto-renew as this contract profile
          type: integer
          format: int64
        renewalAlertDays:
          description: Renewal alert will be given this many days before the contract ends
          type: integer
          format: int32
          minimum: 0
          maximum: 28
        noticePeriodDays:
          description: >-
            Notice period alert will be given this many days before the contract
            ends
          type: integer
          format: int32
          minimum: 0
          maximum: 2147483647
        supersededByContractProfileId:
          readOnly: true
          description: >-
            Where this contract profile has been updated and hence superseded by
            a new contract profile (this contract profile can no longer be
            assigned)
          type: integer
          format: int64
    CustomerContract:
      required:
        - customerId
        - contractProfileId
        - startDate
      type: object
      x-si-no-change-allowed-in-finalised-bill-run: >
        fields = { "name", "customerId", "siteId", "contractProfileId",
        "startDate" }
      x-si-only-billrun-owner-can-change-in-closed-bill-run: >
        fields = { "name", "customerId", "siteId", "contractProfileId",
        "startDate" }
      x-si-class-validation: |
        @After(first = "endDate", second = "startDate")
      properties:
        id:
          description: Customer contract identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        name:
          type: string
          description: Generated contract Name
          minLength: 1
          maxLength: 100
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        customerId:
          description: Customer identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        siteId:
          description: Site identifier to restrict contract to a particular site (optional)
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        contractProfileId:
          description: Contract profile for this customer contract
          type: integer
          format: int64
        startDate:
          description: Effective start date of the customer contract
          type: string
          format: date
        endDate:
          description: >-
            Date when this customer contract ends based on start date and
            contract profile term
          type: string
          format: date
        createdDate:
          readOnly: true
          description: Date when this customer contract was created
          type: string
          format: date-time
        rolloverContractProfileId:
          description: >-
            Once term of this contract ends, contract will auto-renew as this
            contract
          type: integer
          format: int64
        renewalAlertDays:
          description: Renewal alert will be given this many days before the contract ends
          type: integer
          format: int32
          minimum: 0
          maximum: 28
        noticePeriodDays:
          description: >-
            Notice period alert will be given this many days before the contract
            ends
          type: integer
          format: int32
          minimum: 0
          maximum: 2147483647
        previousCustomerContractId:
          readOnly: true
          description: >-
            Where this contract had rolled-over from a previous contract,
            contains the previous contract
          type: integer
          format: int64
        renewedCustomerContractId:
          readOnly: true
          description: >-
            Where this contract rolled-over, contains the next contract that
            replaced this contract
          type: integer
          format: int64
    CustomerContractAssignment:
      required:
        - rentalProductInventoryId
        - customerContractId
      type: object
      properties:
        id:
          description: Customer contract identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        rentalProductInventoryId:
          description: Rental Product Inventory identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        customerContractId:
          description: >-
            Customer contract identifier to assign RPI - must be same customer
            (+ optionally site) as RPI
          type: integer
          format: int64
        createdDate:
          readOnly: true
          description: Date when this customer contract assignment was created
          type: string
          format: date-time
        active:
          description: is the customer contract assignment active
          type: boolean
          default: true
    PageParam:
      description: Page of results to show
      minimum: 1
      type: integer
      format: int32
      example: 1
    ResultsPerPageParam:
      description: Results to return per page
      maximum: 1000
      minimum: 1
      type: integer
      format: int32
      example: 100
    SortParam:
      description: >-
        Comma-delimited list of the fields to sort by - defaults to ascending
        order, suffix :desc to change
      example: id,name | name:desc
      type: string
    FieldsParam:
      description: >-
        Comma-delimited list of the field(s) to return if only a subset is
        required
      example: id,name
      type: string
    IdFilterParam:
      description: Filter by this numeric id value
      example: '0'
      type: string
    StringFilterParam:
      description: >-
        Filter by this string value where value can optionally be prefixed
        (in:|like:)
      example: xyz | in:x,y | like:xyz
      type: string
    BooleanFilterParam:
      description: Filter by this boolean value (true or false)
      example: true | false
      type: string
    IdParam:
      description: Identifier
      minimum: 1
      type: integer
      format: int64
      example: 1
    PatchDocument:
      description: A JSONPatch document as defined by RFC 6902
      required:
        - op
        - path
      type: object
      properties:
        op:
          type: string
          description: The JSON Patch operation to be performed
          x-si-exclude: true
          enum:
            - add
            - remove
            - replace
            - move
            - copy
            - test
        path:
          type: string
          description: A JSON-Pointer
        value:
          type: object
          properties: {}
          description: The value to be used within the operations
        from:
          type: string
          description: A string containing a JSON Pointer value
    PatchRequest:
      type: array
      description: >-
        JSON Patch is a format for describing changes to a JSON document as
        specified in RFC 6902. Refer to [jsonpatch.com](http://jsonpatch.com/)
        for more information
      items:
        $ref: '#/components/schemas/PatchDocument'
    DateFilterParam:
      description: >-
        Filter by this date value where value can optionally be prefixed
        (gt:|lt:|gtn:|gen:)
      example: yyyy-MM-dd | lt:yyyy-MM-dd | gt:yyyy-MM-dd | gtn:yyyy-MM-dd
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  parameters:
    page:
      name: page
      in: query
      description: Page of results to show
      schema:
        $ref: '#/components/schemas/PageParam'
      required: true
    pageSize:
      name: pageSize
      description: Results to return per page
      in: query
      schema:
        $ref: '#/components/schemas/ResultsPerPageParam'
      required: true
    sort:
      name: sort
      in: query
      description: >-
        Comma-delimited list of the fields to sort by - defaults to ascending
        order, suffix :desc to change
      schema:
        $ref: '#/components/schemas/SortParam'
      required: false
    fields:
      name: fields
      in: query
      description: >-
        Comma-delimited list of the field(s) to return if only a subset is
        required
      schema:
        $ref: '#/components/schemas/FieldsParam'
      required: false
