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
  /807:
    post:
      summary: Définition d'un message 807
      operationId: message807
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType807'
      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:
    BodyType807:
      type: object
      properties:
        InterruptionOfMovement:
          $ref: '#/components/schemas/InterruptionOfMovementType'
      required:
        - InterruptionOfMovement

    InterruptionOfMovementType:
      type: object
      properties:
        Attributes:
          $ref: '#/components/schemas/AttributesType807'
        ReferenceControlReport:
          type: array
          maxItems: 9
          items:
            $ref: '#/components/schemas/ReferenceControlReportType'
        ReferenceEventReport:
          type: array
          maxItems: 9
          items:
            $ref: '#/components/schemas/ReferenceEventReportType'
      required:
        - Attributes

    AttributesType807:
      type: object
      description: |
        | **Nom de l'élément**          | **Référentiels**         | **Règles** | **Conditions** |
        |-------------------------------|--------------------------|------------|----------------|
        | AdministrativeReferenceCode   | IC_RG_R030               |            |                |
        | ComplementaryInformation      |                          | IC_RG_C143 |                |
        | language                      | Ref_28 (BC12)            | IC_RG_C002 |                |
        | DateAndTimeOfIssuance         |                          |            |                |
        | ReasonForInterruptionCode     | Ref_40 (BC26)            |            |                |
        | ReferenceNumberOfExciseOffice | IC_RG_R032<br>IC_RG_R236 |            |                |
        | ExciseOfficerIdentification   |                          |            |                |
      properties:
        AdministrativeReferenceCode:
          $ref: '../ie/types.yaml#/components/schemas/AdministrativeReferenceCodeType'
        ComplementaryInformation:
          $ref: '#/components/schemas/LSDComplementaryInformationType807'
        DateAndTimeOfIssuance:
          $ref: '../ie/types.yaml#/components/schemas/DateTimeType'
        ReasonForInterruptionCode:
          $ref: '../ie/types.yaml#/components/schemas/ReasonForInterruptionCodeType'
        ReferenceNumberOfExciseOffice:
          $ref: '../ie/types.yaml#/components/schemas/ExciseOfficeCodeType'
        ExciseOfficerIdentification:
          $ref: '../ie/types.yaml#/components/schemas/ExciseOfficerIdentificationType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - AdministrativeReferenceCode
        - DateAndTimeOfIssuance
        - ReasonForInterruptionCode
        - ReferenceNumberOfExciseOffice

    ReferenceControlReportType:
      type: object
      description: |
        | **Nom de l'élément**   | **Référentiels** | **Règles** | **Conditions** |
        |------------------------|------------------|------------|----------------|
        | ControlReportReference | IC_RG_R103       |            |                |
      properties:
        ControlReportReference:
          $ref: '../ie/types.yaml#/components/schemas/ControlReportReferenceType'
      required:
        - ControlReportReference

    ReferenceEventReportType:
      type: object
      description: |
        | **Nom de l'élément** | **Référentiels** | **Règles** | **Conditions** |
        |----------------------|------------------|------------|----------------|
        | EventReportNumber    | IC_RG_R098       |            |                |
      properties:
        EventReportNumber:
          $ref: '../ie/types.yaml#/components/schemas/EventReportNumberType'
      required:
        - EventReportNumber

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