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
  /810:
    post:
      summary: Définition d'un message 810
      operationId: message810
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType810'
      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:
    BodyType810:
      type: object
      properties:
        CancellationOfEAD:
          $ref: '#/components/schemas/CancellationOfEADTypeType810'
      required:
        - CancellationOfEAD

    CancellationOfEADTypeType810:
      type: object
      properties:
        Attributes:
          $ref: '#/components/schemas/AttributesType810'
        ExciseMovementEad:
          $ref: '#/components/schemas/ExciseMovementEadType810'
        Cancellation:
          $ref: '#/components/schemas/CancellationType810'
      required:
        - Attributes
        - ExciseMovementEad
        - Cancellation

    AttributesType810:
      type: object
      description: |
        | **Nom de l'élément**                  | **Référentiels** | **Règles** | **Conditions** |
        |---------------------------------------|------------------|------------|----------------|
        | DateAndTimeofValidationOfCancellation |                  |            | IC_RG_C149     |
      properties:
        DateAndTimeOfValidationOfCancellation:
          $ref: '../ie/types.yaml#/components/schemas/DateTimeType'

    ExciseMovementEadType810:
      type: object
      description: |
        | **Nom de l'élément**        | **Référentiels** | **Règles**                              | **Conditions** |
        |-----------------------------|------------------|-----------------------------------------|----------------|
        | AdministrativeReferenceCode |                  | IC_RG_BR020<br>IC_RG_R030<br>IC_RG_R273 |                |
      properties:
        AdministrativeReferenceCode:
          $ref: '../ie/types.yaml#/components/schemas/AdministrativeReferenceCodeType'
      required:
        - AdministrativeReferenceCode

    CancellationType810:
      type: object
      description: |
        | **Nom de l'élément**          | **Référentiels** | **Règles** | **Conditions** |
        |-------------------------------|------------------|------------|----------------|
        | Cancellation Reason Code      | BC43             |            |                |
        | Complementary Information     |                  |            | IC_RG_C154     |
      properties:
        CancellationReasonCode:
          $ref: '../ie/types.yaml#/components/schemas/CancellationReasonCodeType'
        ComplementaryInformation:
          $ref: '#/components/schemas/LSDComplementaryInformationType810'
      required:
        - CancellationReasonCode

    LSDComplementaryInformationType810:
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/ComplementaryInformationType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_
