openapi: 3.0.3
info:
  title: Interface API Gamma Refonte
  description: Interface API Gamma Refonte
  version: 1.0.0
  contact:
    name: DGDDI - Douane Française
    url: https://www.douane.gouv.fr/

paths:
  # Chemin facultatif
  /1010:
    post:
      summary: Définition d'un message 1010
      operationId: message1010
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType1010'
      parameters:
        - $ref: '../api/headerHttp.yaml#/components/parameters/messageId'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '../api/retourHttp.yaml#/components/schemas/retour200'

components:
  schemas:
    BodyType1010:
      type: object
      properties:
        AttachmentOfReceivableExposedMovementsConsignee:
          $ref: '#/components/schemas/AttachmentOfReceivableExposedMovementsConsigneeType'
      required:
        - AttachmentOfReceivableExposedMovementsConsignee

    AttachmentOfReceivableExposedMovementsConsigneeType:
      type: object
      properties:
        OperatorReference:
          $ref: '#/components/schemas/TraderType1010'
        DebtsMovementsIdentifier:
          type: array
          minItems: 1
          maxItems: 999
          items:
            $ref: '#/components/schemas/DebtMovementsIdentifier'
      required:
        - DebtsMovementsIdentifier
        - OperatorReference
        - ClaimAttachment

    TraderType1010:
      type: object
      description: |
        | Nom de l'élément   | Référentiels | Règles                   | Conditions               |
        |--------------------|--------------|--------------------------|--------------------------|
        | TraderExciseNumber |              | IC_RG_R271<br>IC_RG_R272 | IC_RG_C198<br>FR_RG_C010 |
      properties:
        TraderExciseNumber:
          $ref: '../ie/types.yaml#/components/schemas/ExciseNumberType'

    DebtMovementsIdentifier:
      type: object
      description: |
        | Nom de l'élément   | Référentiels | Règles | Conditions |
        |--------------------|--------------|--------|------------|
        | MovementIdentifier |              |        |            |
        | NumeroCreance      |              |        |            |
      properties:
        NumeroCreance:
          $ref: '../ie/types.yaml#/components/schemas/NumeroCreanceType'
        MovementIdentifier:
          type: array
          minItems: 1
          maxItems: 999
          items:
            $ref: '#/components/schemas/MovementIdentifier'
      required:
        - NumeroCreance
        - MovementIdentifier

    MovementIdentifier:
      type: object
      description: |
        | Nom de l'élément | Référentiels | Règles     | Conditions               |
        |------------------|--------------|------------|--------------------------|
        | ARC              |              | IC_RG_R030 | FR_RG_R144<br>FR_RG_R145 |
        | seqNumber        |              | IC_RG_R232 | FR_RG_R148               |
      properties:
        ARC:
          $ref: '../ie/types.yaml#/components/schemas/AdministrativeReferenceCodeType'
        SeqNumber:
          $ref: '../ie/types.yaml#/components/schemas/SequenceNumberType'
      required:
        - ARC
        - SeqNumber
