openapi: 3.0.1
info:
  description: Les 8 fonctions du CCFN selon la norme Z42-020
  version: 1.0.1
  title: NF203 CCFN / Z42-020
  contact:
    email: api@gerermesaffaires.com
externalDocs:
  description: Documentation fonctionnelle des API GererMesAffaires
  url: https://api.gerermesaffaires.com/
security:
  - gma_auth:
      - collaborator
      - owner
paths:
  /deposer:
    post:
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                ID_CCFN:
                  type: string
                  example: P5678
                FILE:
                  type: string
                  format: binary
                ID_ON_UTI:
                  type: number
                  example: 698789689
                ALG:
                  type: string
                  example: sha256
                FOOTPRINT:
                  type: string
                  example: 6I7678B8B789
          application/json:
            schema:
              type: object
              properties:
                ID_CCFN:
                  type: string
                  example: P5678
                FILE:
                  type: object
                  properties:
                    NAME:
                      type: string
                      example: Mon Document
                    CONTENT:
                      type: string
                      example: J9FJA829H9HA18B
                ID_ON_UTI:
                  type: number
                  example: 698789689
                ALG:
                  type: string
                  example: sha256
                FOOTPRINT:
                  type: string
                  example: 6I7678B8B789
      responses:
        '201':
          description: ON déposé
          headers:
            Location:
              schema:
                type: string
                description: IDU
                example: P1234
          content:
            application/json:
              schema:
                type: object
                properties:
                  IDU:
                    type: string
                    example: P1234
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  ID_ON_UTI:
                    type: number
                    example: 698789689
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  SIZE:
                    type: number
                    example: 87756
                  ALG:
                    type: string
                    example: sha512
                  FOOTPRINT:
                    type: string
                    example: GJH78IBUI8BUOUIUT67I5RV5YRDT67I8OU9ONL
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /lire:
    get:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: true
      responses:
        '200':
          description: Lecture ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  IDU:
                    type: string
                    example: P1234
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  ID_ON_UTI:
                    type: number
                    example: 698789689
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  SIZE:
                    type: number
                    example: 87756
                  ALG:
                    type: string
                    example: sha512
                  FOOTPRINT:
                    type: string
                    example: GJH78IBUI8BUOUIUT67I5RV5YRDT67I8OU9ONL
                  FILE:
                    type: object
                    properties:
                      NAME:
                        type: string
                        example: Mon Document
                      CONTENT:
                        type: string
                        example: J9FJA829H9HA18B
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /detruire:
    delete:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: true
      responses:
        '200':
          description: Détruire ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  IDU:
                    type: string
                    example: P1234
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  ID_ON_UTI:
                    type: number
                    example: 698789689
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  SIZE:
                    type: number
                    example: 87756
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /lire-meta-techniques:
    get:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: true
      responses:
        '200':
          description: Lecture des métas techniques de l ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  IDU:
                    type: string
                    example: P1234
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  ID_ON_UTI:
                    type: number
                    example: 698789689
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  SIZE:
                    type: number
                    example: 87756
                  ALG:
                    type: string
                    example: sha512
                  FOOTPRINT:
                    type: string
                    example: GJH78IBUI8BUOUIUT67I5RV5YRDT67I8OU9ONL
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /controler:
    get:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: true
      responses:
        '200':
          description: Contrôler ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  IDU:
                    type: string
                    example: P1234
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  ID_ON_UTI:
                    type: number
                    example: 698789689
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  DEPOT_DATE_HEURE:
                    type: string
                    example: 20210101T180034.000Z
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /lire-journal:
    get:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: false
        - in: query
          name: ID_ON_UTI_START
          schema:
            type: number
            example: 8765
          required: false
        - in: query
          name: ID_ON_UTI_END
          schema:
            type: number
            example: 987668
          required: false
        - in: query
          name: DATE_TIME_START
          schema:
            type: string
            example: '202101011181818'
          required: false
        - in: query
          name: DATE_TIME_END
          schema:
            type: string
            example: '202101011181818'
          required: false
      responses:
        200:
          description: Détruire ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  IDU:
                    type: string
                    example: P1234
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  LOGS:
                    type: array
                    items:
                      type: string
                    example:
                      - ligne
                      - ligne2
                      - ligne3
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /lister:
    get:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: false
        - in: query
          name: ID_ON_UTI_START
          schema:
            type: number
            example: 8765
          required: false
        - in: query
          name: ID_ON_UTI_END
          schema:
            type: number
            example: 987668
          required: false
        - in: query
          name: DATE_TIME_START
          schema:
            type: string
            example: '202101011181818'
          required: false
        - in: query
          name: DATE_TIME_END
          schema:
            type: string
            example: '202101011181818'
          required: false
      responses:
        '200':
          description: Détruire ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  IDUS:
                    type: array
                    items:
                      type: string
                    example:
                      - P676
                      - P798678
                      - P8979
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
  /compter:
    get:
      parameters:
        - in: query
          name: ID_CCFN
          schema:
            type: string
            example: P5678
          required: true
        - in: query
          name: IDU
          schema:
            type: string
            example: P1234
          required: false
        - in: query
          name: ID_ON_UTI_START
          schema:
            type: number
            example: 8765
          required: false
        - in: query
          name: ID_ON_UTI_END
          schema:
            type: number
            example: 987668
          required: false
        - in: query
          name: DATE_TIME_START
          schema:
            type: string
            example: '202101011181818'
          required: false
        - in: query
          name: DATE_TIME_END
          schema:
            type: string
            example: '202101011181818'
          required: false
      responses:
        '200':
          description: Détruire ON
          content:
            application/json:
              schema:
                type: object
                properties:
                  ID_CCFN:
                    type: string
                    example: P5678
                  ID_UTI:
                    type: string
                    example: P9999
                  DATE_TIME:
                    type: string
                    example: 20210101T180034.000Z
                  COUNT:
                    type: number
                    example: 3
                  IDUS:
                    type: array
                    items:
                      type: string
                    example:
                      - P676
                      - P798678
                      - P8979
                  STATUS:
                    type: string
                    example: OK
      security:
        - gma_auth:
            - collaborator
            - owner
components:
  securitySchemes:
    gma_auth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://sandbox.gerermesaffaires.com//openid/v1/authorize
          tokenUrl: https://sandbox.gerermesaffaires.com//openid/v1/token
          refreshUrl: https://sandbox.gerermesaffaires.com//openid/v1/token
          scopes:
            collaborator: blue access
            owner: green access
