openapi: 3.0.1
info:
  title: Flusso B2B Authority
  version: v0
paths:
  /v1/getRichiestaDownload:
    get:
      tags:
        - B2B DSRM
      description: Api per invio richiesta scarico massivo
      parameters:
        - name: snapshotId
          in: query
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer ey...Q==
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RestReturnValueRequestIdOutputDTO'
  /v1/kpi/createRichiestaKPIAuthority:
    post:
      tags:
        - B2B DSRM
      description: Api invio richiesta kpi
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer ey...Q==
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RichiestaKpi'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RestReturnValueRequestIdOutputDTO'
  /v1/analytics/richiestainserimentoreportAuthority:
    post:
      tags:
        - B2B DSRM
      description: Api invio richiesta analytics
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer ey...Q==
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RichiestaAnalytics'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RestReturnValueRequestIdOutputDTO'
  /callback:
    post:
      tags:
        - CALLBACK AUTHORITY
      description: Api di callback esposta dall'Authority
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer ey...Q==
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallbackDto'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RestReturnValue'
components:
  schemas:
    RichiestaKpi:
      type: object
      properties:
        tyKpi:
          type: string
          enum:
            - CALC_NUM_VIAGGI_REGISTRATI
            - CALC_NUM_MAAS_OPERATOR
            - CALC_PERC_VIAGGI_CANCELLATI
            - CALC_PERC_VIAGGI_MODIFICATI_MODO_TRASPORTO
            - CALC_NUM_VIAGGI_CATEGORIE_DEBOLI
            - CALC_PERC_VIAGGI_CATEGORIE_DEBOLI
            - CALC_NUM_VIAGGIATORI_CATEGORIE_DEBOLI
            - CALC_PERC_VIAGGIATORI_CATEGORIE_DEBOLI
            - CALC_PERC_SUCCESS_RATE
            - CALC_RAPP_VIAGGI_TPL
            - CALC_RAPP_VIAGGI_MULTIMODALI
            - CALC_RITARDO_MEDIO
            - CALC_NUM_VIAGGI_INVALIDATI
            - CALC_NUM_UTENTI_UNICI
        timestampInizio:
          type: string
          format: date-time
        timestampFine:
          type: string
          format: date-time
    RichiestaAnalytics:
      type: object
      properties:
        tipologiaReport:
          type: string
          enum:
            - RIEPILOGO_VIAGGI
            - RIEPILOGO_TRATTE
            - RIEPILOGO_VIAGGIATORI
            - RIEPILOGO_VIAGGI_ERRATI
            - RIEPILOGO_GLOBALE
        timestampInizio:
          type: string
          format: date-time
        timestampFine:
          type: string
          format: date-time
    CallbackDto:
      type: object
      properties:
        requestId:
          type: string
          example: '12345'
        presignedUrl:
          type: string
          example: https://www.object-storage.com/temporary-url-xyz
    RestReturnValue:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
        payload:
          type: object
    Result:
      type: object
      properties:
        exitCode:
          type: string
          example: '200'
        text:
          type: string
          example: OK
    RequestIdOutputDTO:
      type: object
      properties:
        requestId:
          type: string
          example: '12345'
    RestReturnValueRequestIdOutputDTO:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
        payload:
          $ref: '#/components/schemas/RequestIdOutputDTO'
