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
  /906:
    post:
      summary: Définition d'un message 906
      operationId: message906
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType906'
      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:
    BodyType906:
      type: object
      properties:
        FunctionalNegativeAcknowledgement:
          $ref: '#/components/schemas/FunctionalNegativeAcknowledgementType'
      required:
        - FunctionalNegativeAcknowledgement


    FunctionalNegativeAcknowledgementType:
      type: object
      properties:
        Attributes:
          $ref: '#/components/schemas/AttributesType906'
        FunctionalError:
          type: array
          maxItems: 999
          items:
            $ref: '#/components/schemas/FunctionalErrorType'
        DateRefus:
          $ref: '../fr/fr-v3.yaml#/components/schemas/DateRefusType'
      required:
        - FunctionalError
        - DateRefus

    AttributesType906:
      type: object
      description: |
        | Nom de l'élément            | Référentiels | Règles     | Conditions |
        |-----------------------------|--------------|------------|------------|
        | AdministrativeReferenceCode |              |            |            |
        | SequenceNumber              |              | IC_RG_R232 |            |
      properties:
        AdministrativeReferenceCode:
          $ref: '../ie/types.yaml#/components/schemas/LocalReferenceNumberType'
        SequenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/SequenceNumberType'
      required:
        - AdministrativeReferenceCode
        - SequenceNumber

    FunctionalErrorType:
      type: object
      description: |
        | Nom de l'élément       | Référentiels | Règles     | Conditions |
        |------------------------|--------------|------------|------------|
        | ErrorType              |              |            |            |
        | ErrorReason            |              | FR_RG_R019 |            |
        | ErrorLocation          |              | FR_RG_R020 |            |
      properties:
        ErrorType:
          $ref: '../ie/tcl.yaml#/components/schemas/FunctionalErrorCodes'
        ErrorReason:
          $ref: '../ie/types.yaml#/components/schemas/ErrorReasonType'
        ErrorLocation:
          $ref: '../ie/types.yaml#/components/schemas/ErrorLocationType'
        OriginalAttributeValue:
          $ref: '../ie/types.yaml#/components/schemas/OriginalAttributeValueType'
      required:
        - ErrorType
        - ErrorReason




