openapi: 3.0.3
info:
  title: API Geodagio
  description: Cálculo auditável de distância rodoviária e pedágios oficiais.
  version: 1.0.0
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Usuário verificado pelo Auth. Bootstrap de identidade aceita
        usuário sem organização; rotas de negócio exigem membership ativa e
        x-tenant-id quando houver múltiplas organizações.
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
  schemas:
    def-0:
      additionalProperties: false
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          pattern: ^(0|[1-9]\d*)\.\d{2}$
          type: string
        currency:
          type: string
          enum:
            - BRL
      title: Money
    def-1:
      additionalProperties: false
      type: object
      required:
        - requestId
      properties:
        requestId:
          minLength: 8
          maxLength: 128
          type: string
        apiVersion:
          type: string
          enum:
            - v1
        nextCursor:
          anyOf:
            - minLength: 1
              type: string
            - type: "null"
      title: Meta
    def-2:
      additionalProperties: false
      type: object
      required:
        - error
        - meta
      properties:
        error:
          additionalProperties: false
          type: object
          required:
            - code
            - message
          properties:
            code:
              minLength: 1
              type: string
            message:
              minLength: 1
              type: string
            details:
              type: object
              additionalProperties: {}
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
      title: ApiError
    def-3:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 200
          default: 50
          type: integer
        cursor:
          minLength: 1
          type: string
      title: PaginationQuery
    def-4:
      additionalProperties: false
      type: object
      required:
        - name
        - scopes
      properties:
        name:
          minLength: 1
          maxLength: 80
          type: string
        scopes:
          minItems: 1
          maxItems: 11
          uniqueItems: true
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - routes:calculate
              - type: string
                enum:
                  - routes:read
              - type: string
                enum:
                  - imports:write
              - type: string
                enum:
                  - imports:read
              - type: string
                enum:
                  - reference:read
              - type: string
                enum:
                  - reference:write
              - type: string
                enum:
                  - admin:api-keys
              - type: string
                enum:
                  - freight-floor:calculate
              - type: string
                enum:
                  - freight-floor:read
              - type: string
                enum:
                  - freight-floor:imports:write
              - type: string
                enum:
                  - freight-floor:imports:read
        expiresAt:
          format: date-time
          type: string
      title: CreateApiKeyRequest
    def-5:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - id
            - prefix
            - secret
          properties:
            id:
              format: uuid
              type: string
            prefix:
              pattern: ^[a-f0-9]{8}$
              type: string
            secret:
              pattern: ^gdk_live_[a-f0-9]{8}_[A-Za-z0-9_-]{43}$
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: CreateApiKeyResponse
    def-6:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - id
              - name
              - prefix
              - scopes
              - status
              - lastUsedAt
              - expiresAt
              - createdAt
            properties:
              id:
                format: uuid
                type: string
              name:
                minLength: 1
                maxLength: 80
                type: string
              prefix:
                pattern: ^[a-f0-9]{8}$
                type: string
              scopes:
                maxItems: 11
                uniqueItems: true
                type: array
                items:
                  anyOf:
                    - type: string
                      enum:
                        - routes:calculate
                    - type: string
                      enum:
                        - routes:read
                    - type: string
                      enum:
                        - imports:write
                    - type: string
                      enum:
                        - imports:read
                    - type: string
                      enum:
                        - reference:read
                    - type: string
                      enum:
                        - reference:write
                    - type: string
                      enum:
                        - admin:api-keys
                    - type: string
                      enum:
                        - freight-floor:calculate
                    - type: string
                      enum:
                        - freight-floor:read
                    - type: string
                      enum:
                        - freight-floor:imports:write
                    - type: string
                      enum:
                        - freight-floor:imports:read
              status:
                anyOf:
                  - type: string
                    enum:
                      - ACTIVE
                  - type: string
                    enum:
                      - REVOKED
              lastUsedAt:
                anyOf:
                  - format: date-time
                    type: string
                  - type: "null"
              expiresAt:
                anyOf:
                  - format: date-time
                    type: string
                  - type: "null"
              createdAt:
                format: date-time
                type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: ApiKeyListResponse
    def-7:
      additionalProperties: false
      type: object
      required:
        - id
      properties:
        id:
          format: uuid
          type: string
      title: ApiKeyIdParams
    def-8:
      additionalProperties: false
      type: object
      required:
        - axleCount
        - vehicleClassCode
      properties:
        axleCount:
          minimum: 1
          maximum: 20
          type: integer
        vehicleClassCode:
          minLength: 1
          maxLength: 64
          type: string
      title: Vehicle
    def-9:
      additionalProperties: false
      type: object
      required:
        - origin
        - destination
        - vehicle
        - calculationDate
      properties:
        origin:
          minLength: 2
          maxLength: 255
          type: string
        destination:
          minLength: 2
          maxLength: 255
          type: string
        vehicle:
          $ref: "#/components/schemas/def-8"
        calculationDate:
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
      title: CalculationRequest
    def-10:
      additionalProperties: false
      type: object
      required:
        - calculations
      properties:
        calculations:
          minItems: 1
          maxItems: 100
          type: array
          items:
            $ref: "#/components/schemas/def-9"
      title: BatchCalculationRequest
    def-11:
      additionalProperties: false
      type: object
      required:
        - tollPointId
        - tollRateId
        - sequence
        - amount
        - matchDistanceMeters
        - matchConfidence
        - directionResolution
      properties:
        tollPointId:
          format: uuid
          type: string
        tollRateId:
          anyOf:
            - format: uuid
              type: string
            - type: "null"
        sequence:
          minimum: 1
          type: integer
        amount:
          anyOf:
            - $ref: "#/components/schemas/def-0"
            - type: "null"
        matchDistanceMeters:
          minimum: 0
          type: number
        matchConfidence:
          minimum: 0
          maximum: 1
          type: number
        directionResolution:
          anyOf:
            - type: string
              enum:
                - RESOLVED
            - type: string
              enum:
                - NOT_APPLICABLE
            - type: string
              enum:
                - AMBIGUOUS
      title: TollCharge
    def-12:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - id
            - distance
            - tolls
            - status
            - reviewReasons
            - coverage
            - auxiliaryEstimate
            - audit
          properties:
            id:
              format: uuid
              type: string
            distance:
              additionalProperties: false
              type: object
              required:
                - meters
              properties:
                meters:
                  minimum: 0
                  type: integer
            tolls:
              additionalProperties: false
              type: object
              required:
                - total
                - charges
              properties:
                total:
                  anyOf:
                    - $ref: "#/components/schemas/def-0"
                    - type: "null"
                charges:
                  type: array
                  items:
                    $ref: "#/components/schemas/def-11"
            status:
              anyOf:
                - type: string
                  enum:
                    - OK
                - type: string
                  enum:
                    - REVIEW_REQUIRED
            reviewReasons:
              type: array
              items:
                anyOf:
                  - type: string
                    enum:
                      - TOLL_RATE_NOT_FOUND
                  - type: string
                    enum:
                      - AMBIGUOUS_TOLL_DIRECTION
                  - type: string
                    enum:
                      - AMBIGUOUS_TOLL_ROAD
                  - type: string
                    enum:
                      - POTENTIAL_TOLL_UNMATCHED
                  - type: string
                    enum:
                      - GOOGLE_TOLL_SIGNAL_DIVERGENCE
                  - type: string
                    enum:
                      - GOOGLE_TOLL_SIGNAL_MISMATCH
                  - type: string
                    enum:
                      - TOLL_CATALOG_NOT_HOMOLOGATED
            coverage:
              additionalProperties: false
              type: object
              required:
                - status
                - matchedTolls
                - pricedTolls
                - confirmedSubtotal
              properties:
                status:
                  anyOf:
                    - type: string
                      enum:
                        - CONFIRMADA
                    - type: string
                      enum:
                        - COBERTURA_PARCIAL
                    - type: string
                      enum:
                        - TARIFA_NAO_CONFIRMADA
                    - type: string
                      enum:
                        - COBERTURA_INDISPONIVEL
                    - type: string
                      enum:
                        - SEM_PEDAGIO
                matchedTolls:
                  minimum: 0
                  type: integer
                pricedTolls:
                  minimum: 0
                  type: integer
                confirmedSubtotal:
                  anyOf:
                    - $ref: "#/components/schemas/def-0"
                    - type: "null"
            auxiliaryEstimate:
              anyOf:
                - additionalProperties: false
                  type: object
                  required:
                    - provider
                    - official
                    - amount
                  properties:
                    provider:
                      type: string
                      enum:
                        - GOOGLE_ROUTES
                    official:
                      type: boolean
                      enum:
                        - false
                    amount:
                      $ref: "#/components/schemas/def-0"
                - type: "null"
            audit:
              additionalProperties: false
              type: object
              required:
                - googleTollSignal
              properties:
                googleTollSignal:
                  anyOf:
                    - type: object
                      additionalProperties: {}
                    - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: CalculationResponse
    def-13:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - id
              - origin
              - destination
              - vehicle
              - calculationDate
              - distance
              - tolls
              - status
              - reviewReasons
              - createdAt
            properties:
              id:
                format: uuid
                type: string
              origin:
                minLength: 2
                maxLength: 255
                type: string
              destination:
                minLength: 2
                maxLength: 255
                type: string
              vehicle:
                $ref: "#/components/schemas/def-8"
              calculationDate:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              distance:
                additionalProperties: false
                type: object
                required:
                  - meters
                properties:
                  meters:
                    minimum: 0
                    type: integer
              tolls:
                additionalProperties: false
                type: object
                required:
                  - total
                properties:
                  total:
                    anyOf:
                      - $ref: "#/components/schemas/def-0"
                      - type: "null"
              status:
                anyOf:
                  - type: string
                    enum:
                      - OK
                  - type: string
                    enum:
                      - REVIEW_REQUIRED
              reviewReasons:
                type: array
                items:
                  anyOf:
                    - type: string
                      enum:
                        - TOLL_RATE_NOT_FOUND
                    - type: string
                      enum:
                        - AMBIGUOUS_TOLL_DIRECTION
                    - type: string
                      enum:
                        - AMBIGUOUS_TOLL_ROAD
                    - type: string
                      enum:
                        - POTENTIAL_TOLL_UNMATCHED
                    - type: string
                      enum:
                        - GOOGLE_TOLL_SIGNAL_DIVERGENCE
                    - type: string
                      enum:
                        - GOOGLE_TOLL_SIGNAL_MISMATCH
                    - type: string
                      enum:
                        - TOLL_CATALOG_NOT_HOMOLOGATED
              createdAt:
                format: date-time
                type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: CalculationListResponse
    def-14:
      additionalProperties: false
      type: object
      required:
        - id
      properties:
        id:
          format: uuid
          type: string
      title: CalculationIdParams
    def-15:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 200
          default: 50
          type: integer
        cursor:
          minLength: 1
          type: string
        q:
          maxLength: 100
          type: string
        status:
          anyOf:
            - type: string
              enum:
                - OK
            - type: string
              enum:
                - REVIEW_REQUIRED
        axleCount:
          minimum: 1
          maximum: 20
          type: integer
        startDate:
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        endDate:
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
      title: CalculationsQuery
    def-16:
      additionalProperties: false
      type: object
      required:
        - id
        - description
        - mainText
        - secondaryText
        - source
        - fallbackReason
        - fallbackCompatibility
      properties:
        id:
          type: string
        description:
          type: string
        mainText:
          type: string
        secondaryText:
          type: string
        source:
          anyOf:
            - type: string
              enum:
                - GOOGLE
            - type: string
              enum:
                - IBGE
            - type: string
              enum:
                - LOCAL
        fallbackReason:
          anyOf:
            - type: string
              enum:
                - PROVIDER_NOT_CONFIGURED
            - type: string
              enum:
                - PROVIDER_ERROR
            - type: string
              enum:
                - NO_PROVIDER_MATCH
            - type: "null"
        fallbackCompatibility:
          anyOf:
            - type: string
              enum:
                - PRIMARY
            - type: string
              enum:
                - SECONDARY_PROVIDER
            - type: string
              enum:
                - INCOMPATIBLE_GEOCODING_SCOPE
      title: PlaceSuggestion
    def-17:
      additionalProperties: false
      type: object
      required:
        - input
      properties:
        input:
          minLength: 1
          maxLength: 150
          type: string
        scope:
          description: LOCATION sugere endereços, cidades e polos. CITY restringe a
            sugestão a municípios brasileiros.
          default: LOCATION
          anyOf:
            - type: string
              enum:
                - LOCATION
            - type: string
              enum:
                - CITY
      title: PlacesAutocompleteQuery
    def-18:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - id
              - description
              - mainText
              - secondaryText
              - source
              - fallbackReason
              - fallbackCompatibility
            properties:
              id:
                type: string
              description:
                type: string
              mainText:
                type: string
              secondaryText:
                type: string
              source:
                anyOf:
                  - type: string
                    enum:
                      - GOOGLE
                  - type: string
                    enum:
                      - IBGE
                  - type: string
                    enum:
                      - LOCAL
              fallbackReason:
                anyOf:
                  - type: string
                    enum:
                      - PROVIDER_NOT_CONFIGURED
                  - type: string
                    enum:
                      - PROVIDER_ERROR
                  - type: string
                    enum:
                      - NO_PROVIDER_MATCH
                  - type: "null"
              fallbackCompatibility:
                anyOf:
                  - type: string
                    enum:
                      - PRIMARY
                  - type: string
                    enum:
                      - SECONDARY_PROVIDER
                  - type: string
                    enum:
                      - INCOMPATIBLE_GEOCODING_SCOPE
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - count
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            count:
              minimum: 0
              type: integer
      title: PlacesAutocompleteResponse
    def-19:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - code
              - name
              - monthlyCredits
              - priceAmount
              - annualPriceAmount
              - currency
              - overageAllowed
              - trialDays
              - trialCredits
              - features
            properties:
              code:
                minLength: 1
                maxLength: 64
                type: string
              name:
                minLength: 1
                maxLength: 120
                type: string
              monthlyCredits:
                pattern: ^(0|[1-9]\d*)$
                type: string
              priceAmount:
                pattern: ^(0|[1-9]\d*)\.\d{2}$
                type: string
              annualPriceAmount:
                pattern: ^(0|[1-9]\d*)\.\d{2}$
                type: string
              currency:
                type: string
                enum:
                  - BRL
              overageAllowed:
                type: boolean
              trialDays:
                minimum: 0
                maximum: 90
                type: integer
              trialCredits:
                pattern: ^(0|[1-9]\d*)$
                type: string
              features:
                type: object
                additionalProperties: {}
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: BillingPlansResponse
    def-20:
      additionalProperties: false
      description: Saldo e assinatura da organização. O plano gratuito renova para 20
        créditos no dia 1º, à meia-noite de São Paulo, sem acumular franquias ou
        alterar créditos comprados.
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - subscription
            - credits
          properties:
            subscription:
              anyOf:
                - additionalProperties: false
                  type: object
                  required:
                    - planCode
                    - status
                    - periodStart
                    - periodEnd
                    - cancelAtPeriodEnd
                  properties:
                    planCode:
                      minLength: 1
                      maxLength: 64
                      type: string
                    status:
                      anyOf:
                        - type: string
                          enum:
                            - TRIALING
                        - type: string
                          enum:
                            - ACTIVE
                        - type: string
                          enum:
                            - PAST_DUE
                        - type: string
                          enum:
                            - CANCELED
                    periodStart:
                      format: date-time
                      type: string
                    periodEnd:
                      format: date-time
                      type: string
                    cancelAtPeriodEnd:
                      type: boolean
                - type: "null"
            credits:
              additionalProperties: false
              type: object
              required:
                - balance
                - lifetimeGranted
                - lifetimeConsumed
              properties:
                balance:
                  pattern: ^(0|[1-9]\d*)$
                  type: string
                lifetimeGranted:
                  pattern: ^(0|[1-9]\d*)$
                  type: string
                lifetimeConsumed:
                  pattern: ^(0|[1-9]\d*)$
                  type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: BillingOverviewResponse
    def-21:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - code
              - name
              - credits
              - priceAmount
              - currency
            properties:
              code:
                minLength: 1
                maxLength: 64
                type: string
              name:
                minLength: 1
                maxLength: 120
                type: string
              credits:
                pattern: ^(0|[1-9]\d*)$
                type: string
              priceAmount:
                pattern: ^(0|[1-9]\d*)\.\d{2}$
                type: string
              currency:
                type: string
                enum:
                  - BRL
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: BillingPackagesResponse
    def-22:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - url
          properties:
            url:
              format: uri
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: BillingPortalResponse
    def-23:
      additionalProperties: false
      description: Faturas e recibos financeiros da organização. Recibos Pix exigem
        pagamento confirmado; links e arquivos ausentes permanecem nulos.
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - id
              - kind
              - number
              - status
              - amount
              - currency
              - issuedAt
              - periodStart
              - periodEnd
              - description
              - hostedUrl
              - pdfUrl
            properties:
              id:
                type: string
              kind:
                anyOf:
                  - type: string
                    enum:
                      - INVOICE
                  - type: string
                    enum:
                      - RECEIPT
              number:
                anyOf:
                  - type: string
                  - type: "null"
              status:
                anyOf:
                  - type: string
                    enum:
                      - PAID
                  - type: string
                    enum:
                      - OPEN
                  - type: string
                    enum:
                      - VOID
                  - type: string
                    enum:
                      - UNCOLLECTIBLE
                  - type: string
                    enum:
                      - REFUNDED
              amount:
                type: string
              currency:
                type: string
              issuedAt:
                format: date-time
                type: string
              periodStart:
                anyOf:
                  - format: date-time
                    type: string
                  - type: "null"
              periodEnd:
                anyOf:
                  - format: date-time
                    type: string
                  - type: "null"
              description:
                type: string
              hostedUrl:
                anyOf:
                  - format: uri
                    type: string
                  - type: "null"
              pdfUrl:
                anyOf:
                  - format: uri
                    type: string
                  - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: BillingInvoicesResponse
    def-24:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - status
            - message
            - checkoutUrl
          properties:
            status:
              anyOf:
                - type: string
                  enum:
                    - ACTIVATED
                - type: string
                  enum:
                    - CHECKOUT_REQUIRED
            message:
              minLength: 1
              maxLength: 255
              type: string
            checkoutUrl:
              anyOf:
                - format: uri
                  type: string
                - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: ActivateTrialResponse
    def-25:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - CANCELED
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: CancelUnpaidSubscriptionResponse
    def-26:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - checkoutId
            - url
          properties:
            checkoutId:
              format: uuid
              type: string
            url:
              format: uri
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: CheckoutResponse
    def-27:
      anyOf:
        - additionalProperties: false
          type: object
          required:
            - kind
            - code
            - interval
          properties:
            kind:
              type: string
              enum:
                - SUBSCRIPTION
            code:
              pattern: ^[A-Z0-9_]{2,64}$
              type: string
            interval:
              anyOf:
                - type: string
                  enum:
                    - MONTH
                - type: string
                  enum:
                    - YEAR
            provider:
              type: string
              enum:
                - STRIPE
            paymentMethod:
              type: string
              enum:
                - CARD
        - additionalProperties: false
          type: object
          required:
            - kind
            - code
            - provider
            - paymentMethod
          properties:
            kind:
              type: string
              enum:
                - CREDIT_PURCHASE
            code:
              pattern: ^[A-Z0-9_]{2,64}$
              type: string
            provider:
              type: string
              enum:
                - STRIPE
            paymentMethod:
              type: string
              enum:
                - CARD
        - additionalProperties: false
          type: object
          required:
            - kind
            - code
            - provider
            - paymentMethod
          properties:
            kind:
              type: string
              enum:
                - CREDIT_PURCHASE
            code:
              pattern: ^[A-Z0-9_]{2,64}$
              type: string
            provider:
              type: string
              enum:
                - ASAAS
            paymentMethod:
              type: string
              enum:
                - PIX
        - additionalProperties: false
          type: object
          required:
            - kind
            - code
          properties:
            kind:
              type: string
              enum:
                - CREDIT_PURCHASE
            code:
              pattern: ^[A-Z0-9_]{2,64}$
              type: string
      title: CreateCheckoutRequest
    def-28:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - id
              - delta
              - balanceAfter
              - entryType
              - sourceType
              - sourceId
              - createdAt
            properties:
              id:
                format: uuid
                type: string
              delta:
                pattern: ^(0|-?[1-9]\d*)$
                type: string
              balanceAfter:
                pattern: ^(0|[1-9]\d*)$
                type: string
              entryType:
                anyOf:
                  - type: string
                    enum:
                      - PLAN_GRANT
                  - type: string
                    enum:
                      - PURCHASE
                  - type: string
                    enum:
                      - USAGE
                  - type: string
                    enum:
                      - REFUND
                  - type: string
                    enum:
                      - ADJUSTMENT
              sourceType:
                minLength: 1
                maxLength: 120
                type: string
              sourceId:
                anyOf:
                  - minLength: 1
                    maxLength: 200
                    type: string
                  - type: "null"
              createdAt:
                format: date-time
                type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: BillingLedgerResponse
    def-29:
      additionalProperties: false
      type: object
      required:
        - from
        - to
      properties:
        from:
          format: date-time
          type: string
        to:
          format: date-time
          type: string
      title: BillingUsageQuery
    def-30:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - interval
            - totals
            - byMetric
          properties:
            interval:
              additionalProperties: false
              type: object
              required:
                - from
                - to
              properties:
                from:
                  format: date-time
                  type: string
                to:
                  format: date-time
                  type: string
            totals:
              additionalProperties: false
              type: object
              required:
                - quantity
                - creditsConsumed
              properties:
                quantity:
                  pattern: ^(0|[1-9]\d*)$
                  type: string
                creditsConsumed:
                  pattern: ^(0|[1-9]\d*)$
                  type: string
            byMetric:
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - metric
                  - quantity
                  - creditsConsumed
                properties:
                  metric:
                    anyOf:
                      - type: string
                        enum:
                          - ROUTE_CALCULATION
                      - type: string
                        enum:
                          - IMPORT_ROW
                      - type: string
                        enum:
                          - FREIGHT_FLOOR_CALCULATION
                      - type: string
                        enum:
                          - FREIGHT_FLOOR_IMPORT_ROW
                      - type: string
                        enum:
                          - RNTRC_LOOKUP
                      - type: string
                        enum:
                          - RNTRC_VALIDATE
                      - type: string
                        enum:
                          - RNTRC_WATCH_TARGET
                      - type: string
                        enum:
                          - RNTRC_IMPORT_ROW
                      - type: string
                        enum:
                          - COMPOSITE_PRECHECK
                      - type: string
                        enum:
                          - FUEL_PRICE_LOOKUP
                      - type: string
                        enum:
                          - FUEL_STATION_LOOKUP
                      - type: string
                        enum:
                          - FUEL_ROUTE_COST
                      - type: string
                        enum:
                          - FUEL_ROUTE_STATIONS
                      - type: string
                        enum:
                          - FUEL_IMPORT_ROW
                      - type: string
                        enum:
                          - STOPS_PPD_LOOKUP
                      - type: string
                        enum:
                          - STOPS_ROUTE_SEARCH
                      - type: string
                        enum:
                          - STOPS_ROUTE_COVERAGE
                      - type: string
                        enum:
                          - STOPS_ROUTE_PLAN
                      - type: string
                        enum:
                          - STOPS_BATCH_ITEM
                      - type: string
                        enum:
                          - EMISSIONS_FUEL_CALCULATION
                      - type: string
                        enum:
                          - EMISSIONS_ROUTE_CALCULATION
                      - type: string
                        enum:
                          - EMISSIONS_ACTIVITY_CALCULATION
                      - type: string
                        enum:
                          - EMISSIONS_COMPARE
                      - type: string
                        enum:
                          - EMISSIONS_BATCH_ITEM
                      - type: string
                        enum:
                          - EMISSIONS_REPORT_EXPORT
                      - type: string
                        enum:
                          - VEHICLE_COMPLIANCE_VALIDATE
                      - type: string
                        enum:
                          - AXLE_COMPLIANCE_VALIDATE
                      - type: string
                        enum:
                          - DIMENSIONS_COMPLIANCE_VALIDATE
                      - type: string
                        enum:
                          - AET_PRECHECK
                      - type: string
                        enum:
                          - VEHICLE_ROUTE_PRECHECK
                      - type: string
                        enum:
                          - TRAFFIC_RESTRICTION_QUERY
                      - type: string
                        enum:
                          - VEHICLE_COMPLIANCE_BATCH_ITEM
                      - type: string
                        enum:
                          - DFE_DOCUMENT_VALIDATE
                      - type: string
                        enum:
                          - DFE_CTE_VALIDATE
                      - type: string
                        enum:
                          - DFE_MDFE_VALIDATE
                      - type: string
                        enum:
                          - DFE_RECONCILE_OPERATION
                      - type: string
                        enum:
                          - DFE_RELATIONSHIP_VALIDATE
                      - type: string
                        enum:
                          - DFE_STATUS_QUERY
                      - type: string
                        enum:
                          - DFE_BATCH_ITEM
                      - type: string
                        enum:
                          - DRIVER_LOOKUP
                      - type: string
                        enum:
                          - DRIVER_VALIDATE
                      - type: string
                        enum:
                          - DRIVER_OPERATION_PRECHECK
                      - type: string
                        enum:
                          - DRIVER_WATCH_TARGET
                      - type: string
                        enum:
                          - DRIVER_IMPORT_ROW
                      - type: string
                        enum:
                          - CIOT_PRECHECK
                      - type: string
                        enum:
                          - CIOT_REGISTER
                      - type: string
                        enum:
                          - CIOT_CLOSE
                      - type: string
                        enum:
                          - CIOT_CANCEL
                      - type: string
                        enum:
                          - CIOT_QUERY
                      - type: string
                        enum:
                          - CIOT_IMPORT_ROW
                      - type: string
                        enum:
                          - VPO_CALCULATION
                      - type: string
                        enum:
                          - VPO_PROVISION
                      - type: string
                        enum:
                          - VPO_RECONCILE
                      - type: string
                        enum:
                          - VPO_CANCEL
                      - type: string
                        enum:
                          - VPO_QUERY
                      - type: string
                        enum:
                          - TRIC_PRECHECK
                      - type: string
                        enum:
                          - TRIC_LICENSE_QUERY
                      - type: string
                        enum:
                          - TRIC_CORRIDOR_LOOKUP
                      - type: string
                        enum:
                          - TRIC_CUSTOMS_VALIDATE
                      - type: string
                        enum:
                          - OPERATION_360_RUN
                  quantity:
                    pattern: ^(0|[1-9]\d*)$
                    type: string
                  creditsConsumed:
                    pattern: ^(0|[1-9]\d*)$
                    type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: BillingUsageResponse
    def-31:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - tenantId
            - actorType
            - actorId
            - roles
            - scopes
            - platformAdmin
          properties:
            tenantId:
              format: uuid
              type: string
            actorType:
              anyOf:
                - type: string
                  enum:
                    - USER
                - type: string
                  enum:
                    - API_KEY
            actorId:
              minLength: 1
              type: string
            roles:
              type: array
              items:
                type: string
            scopes:
              type: array
              items:
                type: string
            platformAdmin:
              type: boolean
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: CurrentActorResponse
    def-32:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - id
              - purpose
              - recipientMasked
              - outcome
              - providerMessageRef
              - errorCode
              - createdAt
            properties:
              id:
                format: uuid
                type: string
              purpose:
                minLength: 1
                maxLength: 120
                type: string
              recipientMasked:
                minLength: 3
                maxLength: 254
                type: string
              outcome:
                anyOf:
                  - type: string
                    enum:
                      - SENT
                  - type: string
                    enum:
                      - FAILED
              providerMessageRef:
                anyOf:
                  - minLength: 1
                    type: string
                  - type: "null"
              errorCode:
                anyOf:
                  - minLength: 1
                    type: string
                  - type: "null"
              createdAt:
                format: date-time
                type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: EmailLogsResponse
    def-33:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - configured
            - senderName
            - senderEmail
            - replyTo
            - source
            - updatedAt
          properties:
            configured:
              type: boolean
            senderName:
              anyOf:
                - minLength: 2
                  maxLength: 120
                  type: string
                - type: "null"
            senderEmail:
              anyOf:
                - format: email
                  maxLength: 254
                  type: string
                - type: "null"
            replyTo:
              anyOf:
                - format: email
                  maxLength: 254
                  type: string
                - type: "null"
            source:
              anyOf:
                - type: string
                  enum:
                    - DATABASE
                - type: string
                  enum:
                    - ENVIRONMENT
                - type: string
                  enum:
                    - NONE
            updatedAt:
              anyOf:
                - format: date-time
                  type: string
                - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: EmailSettingsResponse
    def-34:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - configured
            - source
            - maskedKey
          properties:
            configured:
              type: boolean
            source:
              anyOf:
                - type: string
                  enum:
                    - ENVIRONMENT
                - type: string
                  enum:
                    - NONE
            maskedKey:
              anyOf:
                - minLength: 1
                  maxLength: 64
                  type: string
                - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: GoogleMapsStatusResponse
    def-35:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - success
            - latencyMs
            - status
            - distanceMeters
            - durationSeconds
            - message
          properties:
            success:
              type: boolean
              enum:
                - true
            latencyMs:
              minimum: 0
              type: integer
            status:
              type: number
              enum:
                - 200
            distanceMeters:
              minimum: 1
              type: integer
            durationSeconds:
              minimum: 1
              type: integer
            message:
              minLength: 1
              maxLength: 300
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: GoogleMapsTestResponse
    def-36:
      additionalProperties: false
      type: object
      required:
        - recipientEmail
      properties:
        recipientEmail:
          format: email
          maxLength: 254
          type: string
      title: TestEmailRequest
    def-37:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - accepted
            - messageId
          properties:
            accepted:
              type: boolean
              enum:
                - true
            messageId:
              minLength: 1
              maxLength: 300
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TestEmailResponse
    def-38:
      additionalProperties: false
      type: object
      required:
        - senderName
        - senderEmail
        - replyTo
      properties:
        senderName:
          minLength: 2
          maxLength: 120
          type: string
        senderEmail:
          format: email
          maxLength: 254
          type: string
        replyTo:
          anyOf:
            - format: email
              maxLength: 254
              type: string
            - type: "null"
        apiKey:
          minLength: 12
          maxLength: 512
          type: string
      title: UpdateEmailSettingsRequest
    def-39:
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - slug
        - planCode
        - status
        - balance
        - lifetimeGranted
        - lifetimeConsumed
        - memberCount
        - createdAt
      properties:
        id:
          format: uuid
          type: string
        name:
          minLength: 1
          maxLength: 120
          type: string
        slug:
          minLength: 1
          maxLength: 120
          type: string
        planCode:
          minLength: 1
          type: string
        status:
          anyOf:
            - type: string
              enum:
                - ACTIVE
            - type: string
              enum:
                - TRIALING
            - type: string
              enum:
                - TRIAL_EXPIRED
            - type: string
              enum:
                - PAST_DUE
            - type: string
              enum:
                - SUSPENDED
            - type: string
              enum:
                - CANCELED
        balance:
          type: string
        lifetimeGranted:
          type: string
        lifetimeConsumed:
          type: string
        memberCount:
          minimum: 0
          type: integer
        createdAt:
          format: date-time
          type: string
      title: AdminTenantSummary
    def-40:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-39"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - type: string
                - type: "null"
      title: AdminTenantListResponse
    def-41:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - tenant
            - billing
            - membersCount
            - apiKeysCount
            - activePoliciesCount
            - recentOperationsCount
            - webhookDeliveriesSummary
            - supportNotice
          properties:
            tenant:
              additionalProperties: false
              type: object
              required:
                - id
                - name
                - slug
                - planCode
                - status
                - createdAt
              properties:
                id:
                  format: uuid
                  type: string
                name:
                  type: string
                slug:
                  type: string
                planCode:
                  type: string
                status:
                  type: string
                createdAt:
                  format: date-time
                  type: string
            billing:
              additionalProperties: false
              type: object
              required:
                - balance
                - lifetimeGranted
                - lifetimeConsumed
                - overageAllowed
              properties:
                balance:
                  type: string
                lifetimeGranted:
                  type: string
                lifetimeConsumed:
                  type: string
                overageAllowed:
                  type: boolean
            membersCount:
              minimum: 0
              type: integer
            apiKeysCount:
              minimum: 0
              type: integer
            activePoliciesCount:
              minimum: 0
              type: integer
            recentOperationsCount:
              minimum: 0
              type: integer
            webhookDeliveriesSummary:
              additionalProperties: false
              type: object
              required:
                - success
                - failed
                - pending
                - retryScheduled
              properties:
                success:
                  minimum: 0
                  type: integer
                failed:
                  minimum: 0
                  type: integer
                pending:
                  minimum: 0
                  type: integer
                retryScheduled:
                  minimum: 0
                  type: integer
            supportNotice:
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminTenantDiagnosticsResponse
    def-42:
      additionalProperties: false
      type: object
      required:
        - amount
        - reason
        - idempotencyKey
      properties:
        amount:
          description: Quantidade de créditos a adicionar (positivo) ou deduzir (negativo)
          type: integer
        reason:
          minLength: 10
          maxLength: 500
          description: Motivo obrigatório para auditoria de conformidade
          type: string
        idempotencyKey:
          minLength: 4
          maxLength: 128
          description: Chave de idempotência para garantir execução única
          type: string
      title: AdminCreditAdjustmentRequest
    def-43:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - tenantId
            - previousBalance
            - newBalance
            - delta
            - reason
            - adjustedBy
            - adjustedAt
          properties:
            tenantId:
              format: uuid
              type: string
            previousBalance:
              type: string
            newBalance:
              type: string
            delta:
              type: string
            reason:
              type: string
            adjustedBy:
              type: string
            adjustedAt:
              format: date-time
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminCreditAdjustmentResponse
    def-44:
      additionalProperties: false
      type: object
      properties:
        days:
          minimum: 7
          maximum: 90
          default: 30
          type: integer
      title: CustomerInsightsQuery
    def-45:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - periodDays
            - generatedAt
            - customers
            - usage
            - plans
            - tools
            - topCustomers
            - observations
          properties:
            periodDays:
              minimum: 7
              maximum: 90
              type: integer
            generatedAt:
              format: date-time
              type: string
            customers:
              additionalProperties: false
              type: object
              required:
                - total
                - active
                - engaged
                - dormant
              properties:
                total:
                  minimum: 0
                  type: integer
                active:
                  minimum: 0
                  type: integer
                engaged:
                  minimum: 0
                  type: integer
                dormant:
                  minimum: 0
                  type: integer
            usage:
              additionalProperties: false
              type: object
              required:
                - events
                - creditsConsumed
              properties:
                events:
                  type: string
                creditsConsumed:
                  type: string
            plans:
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - planCode
                  - customers
                  - activeCustomers
                properties:
                  planCode:
                    type: string
                  customers:
                    type: integer
                  activeCustomers:
                    type: integer
            tools:
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - metric
                  - events
                  - creditsConsumed
                  - activeCustomers
                properties:
                  metric:
                    type: string
                  events:
                    type: string
                  creditsConsumed:
                    type: string
                  activeCustomers:
                    minimum: 0
                    type: integer
            topCustomers:
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - tenantId
                  - tenantName
                  - planCode
                  - events
                  - creditsConsumed
                  - lastUsedAt
                properties:
                  tenantId:
                    format: uuid
                    type: string
                  tenantName:
                    type: string
                  planCode:
                    type: string
                  events:
                    type: string
                  creditsConsumed:
                    type: string
                  lastUsedAt:
                    anyOf:
                      - format: date-time
                        type: string
                      - type: "null"
            observations:
              type: array
              items:
                type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: CustomerInsightsResponse
    def-46:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - exists
            - filename
            - sizeBytes
            - sizeKb
            - sizeFormatted
            - downloadUrl
            - isCustomUpload
          properties:
            exists:
              description: Indica se o arquivo PDF do e-book está disponível
              type: boolean
            filename:
              description: Nome do arquivo PDF oficial
              type: string
            sizeBytes:
              description: Tamanho do arquivo em bytes
              type: number
            sizeKb:
              description: Tamanho do arquivo em kilobytes
              type: number
            sizeFormatted:
              description: Tamanho formatado para exibição amigável
              type: string
            updatedAt:
              description: Data/hora ISO da última modificação
              type: string
            downloadUrl:
              description: URL pública relativa ou absoluta de download do e-book
              type: string
            isCustomUpload:
              description: Indica se o arquivo atual foi enviado manualmente via upload
              type: boolean
            coverUrl:
              description: URL pública da imagem de capa do e-book
              type: string
            coverSizeBytes:
              description: Tamanho em bytes da imagem de capa
              type: number
          title: AdminEbookStatusData
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookStatusResponse
    def-47:
      additionalProperties: false
      type: object
      required:
        - exists
        - filename
        - sizeBytes
        - sizeKb
        - sizeFormatted
        - downloadUrl
        - isCustomUpload
      properties:
        exists:
          description: Indica se o arquivo PDF do e-book está disponível
          type: boolean
        filename:
          description: Nome do arquivo PDF oficial
          type: string
        sizeBytes:
          description: Tamanho do arquivo em bytes
          type: number
        sizeKb:
          description: Tamanho do arquivo em kilobytes
          type: number
        sizeFormatted:
          description: Tamanho formatado para exibição amigável
          type: string
        updatedAt:
          description: Data/hora ISO da última modificação
          type: string
        downloadUrl:
          description: URL pública relativa ou absoluta de download do e-book
          type: string
        isCustomUpload:
          description: Indica se o arquivo atual foi enviado manualmente via upload
          type: boolean
        coverUrl:
          description: URL pública da imagem de capa do e-book
          type: string
        coverSizeBytes:
          description: Tamanho em bytes da imagem de capa
          type: number
      title: AdminEbookStatusData
    def-48:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - success
            - message
            - filename
            - sizeBytes
            - sizeFormatted
            - downloadUrl
            - updatedAt
          properties:
            success:
              type: boolean
              enum:
                - true
            message:
              type: string
            filename:
              type: string
            sizeBytes:
              type: number
            sizeFormatted:
              type: string
            downloadUrl:
              type: string
            updatedAt:
              type: string
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookUploadResponse
    def-49:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - success
            - message
            - coverUrl
            - sizeBytes
            - updatedAt
          properties:
            success:
              type: boolean
              enum:
                - true
            message:
              type: string
            coverUrl:
              type: string
            sizeBytes:
              type: number
            updatedAt:
              type: string
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookCoverUploadResponse
    def-50:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - success
            - message
            - restoredDefault
          properties:
            success:
              type: boolean
              enum:
                - true
            message:
              type: string
            restoredDefault:
              type: boolean
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookDeleteResponse
    def-51:
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - email
        - capturedAt
      properties:
        id:
          description: Identificador único do lead
          type: string
        name:
          description: Nome completo
          type: string
        email:
          description: E-mail cadastrado
          type: string
        company:
          description: Empresa informada (ou vazio)
          type: string
        capturedAt:
          description: Data/hora ISO da captura do lead
          type: string
        source:
          description: Origem da captura
          type: string
      title: AdminEbookLeadItem
    def-52:
      additionalProperties: false
      type: object
      required:
        - name
        - email
      properties:
        name:
          minLength: 2
          maxLength: 160
          description: Nome completo do lead
          type: string
        email:
          format: email
          maxLength: 255
          description: E-mail corporativo ou pessoal
          type: string
        company:
          maxLength: 160
          description: Nome da transportadora ou empresa (opcional)
          type: string
      title: PublicEbookLeadSubmit
    def-53:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - success
            - message
            - downloadUrl
            - leadId
          properties:
            success:
              type: boolean
              enum:
                - true
            message:
              type: string
            downloadUrl:
              type: string
            leadId:
              type: string
            lead:
              $ref: "#/components/schemas/def-51"
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: PublicEbookLeadSubmitResponse
    def-54:
      additionalProperties: false
      type: object
      properties:
        search:
          description: Termo de busca por nome, e-mail ou empresa
          type: string
        page:
          minimum: 1
          default: 1
          description: Número da página
          type: integer
        limit:
          minimum: 1
          maximum: 500
          default: 50
          description: Itens por página
          type: integer
      title: AdminEbookLeadsQuery
    def-55:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - leads
            - total
            - page
            - limit
            - totalPages
          properties:
            leads:
              type: array
              items:
                $ref: "#/components/schemas/def-51"
            items:
              type: array
              items:
                $ref: "#/components/schemas/def-51"
            total:
              description: Total de leads capturados
              type: integer
            today:
              description: Leads cadastrados hoje
              type: integer
            page:
              description: Página atual
              type: integer
            limit:
              description: Limite de itens por página
              type: integer
            totalPages:
              description: Total de páginas calculadas
              type: integer
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookLeadsListResponse
    def-56:
      additionalProperties: false
      type: object
      required:
        - id
        - recipientEmail
        - recipientName
        - status
        - sentAt
        - source
      properties:
        id:
          description: Identificador único do log de envio
          type: string
        recipientEmail:
          description: E-mail de destino
          type: string
        recipientName:
          description: Nome do destinatário
          type: string
        company:
          description: Empresa do destinatário (se informada)
          type: string
        status:
          description: Status da entrega do e-mail
          anyOf:
            - type: string
              enum:
                - SENT
            - type: string
              enum:
                - FAILED
        messageId:
          description: ID da mensagem retornado pelo Brevo
          type: string
        errorMessage:
          description: Mensagem de erro caso o envio falhe
          type: string
        sentAt:
          description: Data/hora ISO do envio
          type: string
        source:
          description: Origem do disparo
          anyOf:
            - type: string
              enum:
                - POPUP_LEAD
            - type: string
              enum:
                - ADMIN_TEST
            - type: string
              enum:
                - ADMIN_MANUAL
      title: AdminEbookEmailLogItem
    def-57:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - logs
            - total
            - sent
            - failed
            - successRate
          properties:
            logs:
              type: array
              items:
                $ref: "#/components/schemas/def-56"
            total:
              description: Total de e-mails disparados
              type: integer
            sent:
              description: E-mails enviados com sucesso
              type: integer
            failed:
              description: E-mails que falharam
              type: integer
            successRate:
              description: Taxa de sucesso percentual (0 a 100)
              type: number
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookEmailLogsResponse
    def-58:
      additionalProperties: false
      type: object
      required:
        - recipientEmail
      properties:
        recipientEmail:
          format: email
          description: E-mail para envio de teste do e-book
          type: string
        recipientName:
          maxLength: 160
          description: Nome do destinatário no teste
          type: string
      title: AdminEbookSendTestEmail
    def-59:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - success
            - message
            - messageId
            - recipientEmail
            - sentAt
          properties:
            success:
              type: boolean
              enum:
                - true
            message:
              type: string
            messageId:
              type: string
            recipientEmail:
              type: string
            sentAt:
              type: string
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: AdminEbookSendTestEmailResponse
    def-60:
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - authority
        - sourceType
        - canonicalUrl
        - status
        - lastCheckedAt
      properties:
        id:
          format: uuid
          type: string
        name:
          type: string
        authority:
          type: string
        sourceType:
          type: string
        canonicalUrl:
          format: uri
          type: string
        status:
          anyOf:
            - type: string
              enum:
                - ACTIVE
            - type: string
              enum:
                - STALE
            - type: string
              enum:
                - DISABLED
        lastCheckedAt:
          anyOf:
            - type: string
            - type: "null"
      title: TollSource
    def-61:
      additionalProperties: false
      type: object
      required:
        - id
        - sourceId
        - externalRef
        - type
        - name
        - roadCode
        - roadKm
        - direction
        - operator
        - stateCode
        - latitude
        - longitude
        - active
        - validFrom
        - validTo
      properties:
        id:
          format: uuid
          type: string
        sourceId:
          format: uuid
          type: string
        externalRef:
          anyOf:
            - type: string
            - type: "null"
        type:
          anyOf:
            - type: string
              enum:
                - PLAZA
            - type: string
              enum:
                - FREE_FLOW
        name:
          type: string
        roadCode:
          type: string
        roadKm:
          anyOf:
            - type: string
            - type: "null"
        direction:
          anyOf:
            - type: string
            - type: "null"
        operator:
          anyOf:
            - type: string
            - type: "null"
        stateCode:
          minLength: 2
          maxLength: 2
          type: string
        latitude:
          type: number
        longitude:
          type: number
        active:
          type: boolean
        validFrom:
          format: date
          type: string
        validTo:
          anyOf:
            - type: string
            - type: "null"
      title: TollPoint
    def-62:
      additionalProperties: false
      type: object
      required:
        - id
        - tollPointId
        - tollPointName
        - sourceId
        - vehicleClassCode
        - axleCount
        - amount
        - currency
        - validFrom
        - validTo
        - sourceReference
        - verifiedAt
      properties:
        id:
          format: uuid
          type: string
        tollPointId:
          format: uuid
          type: string
        tollPointName:
          type: string
        sourceId:
          format: uuid
          type: string
        vehicleClassCode:
          type: string
        axleCount:
          anyOf:
            - type: integer
            - type: "null"
        amount:
          pattern: ^\d+\.\d{2}$
          type: string
        currency:
          type: string
          enum:
            - BRL
        validFrom:
          format: date
          type: string
        validTo:
          anyOf:
            - type: string
            - type: "null"
        sourceReference:
          type: string
        verifiedAt:
          format: date-time
          type: string
      title: TollRate
    def-63:
      additionalProperties: false
      type: object
      required:
        - sources
        - points
        - rates
        - activePoints
      properties:
        sources:
          minimum: 0
          type: integer
        points:
          minimum: 0
          type: integer
        rates:
          minimum: 0
          type: integer
        activePoints:
          minimum: 0
          type: integer
      title: ReferenceSummary
    def-64:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-63"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: ReferenceSummaryResponse
    def-65:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-60"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: TollSourcesResponse
    def-66:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-61"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: TollPointsResponse
    def-67:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-62"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
            - nextCursor
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: TollRatesResponse
    def-68:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-60"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollSourceResponse
    def-69:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-61"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollPointResponse
    def-70:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-62"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollRateResponse
    def-71:
      additionalProperties: false
      type: object
      required:
        - name
        - authority
        - sourceType
        - canonicalUrl
      properties:
        name:
          minLength: 2
          maxLength: 160
          type: string
        authority:
          minLength: 2
          maxLength: 160
          type: string
        sourceType:
          minLength: 2
          maxLength: 60
          type: string
        canonicalUrl:
          format: uri
          maxLength: 1000
          type: string
      title: CreateTollSource
    def-72:
      additionalProperties: false
      type: object
      required:
        - sourceId
        - type
        - name
        - roadCode
        - stateCode
        - latitude
        - longitude
        - validFrom
      properties:
        sourceId:
          format: uuid
          type: string
        externalRef:
          minLength: 1
          maxLength: 160
          type: string
        type:
          anyOf:
            - type: string
              enum:
                - PLAZA
            - type: string
              enum:
                - FREE_FLOW
        name:
          minLength: 2
          maxLength: 200
          type: string
        roadCode:
          minLength: 2
          maxLength: 30
          type: string
        roadKm:
          minimum: 0
          maximum: 10000
          type: number
        direction:
          maxLength: 80
          type: string
        operator:
          maxLength: 160
          type: string
        stateCode:
          pattern: ^[A-Za-z]{2}$
          type: string
        latitude:
          minimum: -90
          maximum: 90
          type: number
        longitude:
          minimum: -180
          maximum: 180
          type: number
        validFrom:
          format: date
          type: string
        validTo:
          format: date
          type: string
      title: CreateTollPoint
    def-73:
      additionalProperties: false
      type: object
      required:
        - tollPointId
        - sourceId
        - vehicleClassCode
        - amount
        - validFrom
        - sourceReference
        - verifiedAt
      properties:
        tollPointId:
          format: uuid
          type: string
        sourceId:
          format: uuid
          type: string
        vehicleClassCode:
          minLength: 1
          maxLength: 60
          type: string
        axleCount:
          minimum: 1
          maximum: 20
          type: integer
        amount:
          pattern: ^\d{1,10}\.\d{2}$
          type: string
        validFrom:
          format: date
          type: string
        validTo:
          format: date
          type: string
        sourceReference:
          minLength: 3
          maxLength: 1000
          type: string
        verifiedAt:
          format: date-time
          type: string
      title: CreateTollRate
    def-74:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 200
          default: 50
          type: integer
        cursor:
          minLength: 1
          type: string
      title: TollSourcesQuery
    def-75:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 200
          default: 50
          type: integer
        cursor:
          minLength: 1
          type: string
        sourceId:
          format: uuid
          type: string
        q:
          minLength: 1
          maxLength: 120
          type: string
      title: TollPointsQuery
    def-76:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 200
          default: 50
          type: integer
        cursor:
          minLength: 1
          type: string
        tollPointId:
          format: uuid
          type: string
      title: TollRatesQuery
    def-77:
      additionalProperties: false
      type: object
      required:
        - sourcesCount
        - pointsCount
        - ratesCount
        - activePointsCount
        - cachedRoutesCount
        - totalCacheHits
        - lastCheckedAt
      properties:
        sourcesCount:
          minimum: 0
          type: integer
        pointsCount:
          minimum: 0
          type: integer
        ratesCount:
          minimum: 0
          type: integer
        activePointsCount:
          minimum: 0
          type: integer
        cachedRoutesCount:
          minimum: 0
          type: integer
        totalCacheHits:
          minimum: 0
          type: integer
        lastCheckedAt:
          type: string
      title: TollCatalogStats
    def-78:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - success
            - message
            - prunedExpiredRoutes
            - stats
          properties:
            success:
              type: boolean
            message:
              type: string
            prunedExpiredRoutes:
              minimum: 0
              type: integer
            stats:
              $ref: "#/components/schemas/def-77"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollSyncResponse
    def-79:
      additionalProperties: false
      type: object
      required:
        - service
      properties:
        service:
          anyOf:
            - type: string
              enum:
                - GOOGLE
            - type: string
              enum:
                - SUPABASE
            - type: string
              enum:
                - STRIPE
            - type: string
              enum:
                - BREVO
            - type: string
              enum:
                - VPS
      title: FinancialServiceParams
    def-80:
      additionalProperties: false
      type: object
      required:
        - monthlyBudget
        - warningPercent
        - criticalPercent
        - enabled
      properties:
        monthlyBudget:
          pattern: ^(?:0\.0[1-9]|0\.[1-9]\d|[1-9]\d{0,11}\.\d{2})$
          type: string
        warningPercent:
          minimum: 1
          maximum: 99
          type: integer
        criticalPercent:
          minimum: 2
          maximum: 100
          type: integer
        enabled:
          type: boolean
      title: FinancialBudgetRequest
    def-81:
      additionalProperties: false
      type: object
      required:
        - amount
        - periodStart
      properties:
        amount:
          pattern: ^(?:0|[1-9]\d{0,11})\.\d{2}$
          type: string
        periodStart:
          pattern: ^\d{4}-\d{2}-01$
          type: string
      title: FinancialSpendRequest
    def-82:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - service
              - monthlyBudget
              - warningPercent
              - criticalPercent
              - enabled
              - currentSpend
              - snapshotSource
              - lastCollectedAt
              - periodStart
              - percentUsed
              - status
            properties:
              service:
                anyOf:
                  - type: string
                    enum:
                      - GOOGLE
                  - type: string
                    enum:
                      - SUPABASE
                  - type: string
                    enum:
                      - STRIPE
                  - type: string
                    enum:
                      - BREVO
                  - type: string
                    enum:
                      - VPS
              monthlyBudget:
                anyOf:
                  - pattern: ^(?:0|[1-9]\d{0,11})\.\d{2}$
                    type: string
                  - type: "null"
              warningPercent:
                type: integer
              criticalPercent:
                type: integer
              enabled:
                type: boolean
              currentSpend:
                pattern: ^(?:0|[1-9]\d{0,11})\.\d{2}$
                type: string
              snapshotSource:
                anyOf:
                  - type: string
                    enum:
                      - MANUAL
                  - type: string
                    enum:
                      - AUTOMATIC
                  - type: "null"
              lastCollectedAt:
                anyOf:
                  - format: date-time
                    type: string
                  - type: "null"
              periodStart:
                pattern: ^\d{4}-\d{2}-01$
                type: string
              percentUsed:
                anyOf:
                  - minimum: 0
                    type: number
                  - type: "null"
              status:
                anyOf:
                  - type: string
                    enum:
                      - NOT_CONFIGURED
                  - type: string
                    enum:
                      - OK
                  - type: string
                    enum:
                      - WARNING
                  - type: string
                    enum:
                      - CRITICAL
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: FinancialAlertsResponse
    def-83:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - updated
          properties:
            updated:
              type: boolean
              enum:
                - true
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: FinancialAlertMutationResponse
    def-84:
      additionalProperties: false
      type: object
      required:
        - id
      properties:
        id:
          format: uuid
          type: string
      title: ImportJobParams
    def-85:
      additionalProperties: false
      type: object
      required:
        - id
        - jobType
        - status
        - totalRows
        - processedRows
        - okRows
        - reviewRows
        - failedRows
        - startedAt
        - finishedAt
        - errorCode
        - attemptCount
      properties:
        id:
          format: uuid
          type: string
        jobType:
          anyOf:
            - type: string
              enum:
                - ROUTE_CALCULATION
            - type: string
              enum:
                - FREIGHT_FLOOR_CALCULATION
            - type: string
              enum:
                - FREIGHT_FLOOR_PRECIOT_VALIDATION
        status:
          anyOf:
            - type: string
              enum:
                - UPLOADED
            - type: string
              enum:
                - VALIDATING
            - type: string
              enum:
                - QUEUED
            - type: string
              enum:
                - PROCESSING
            - type: string
              enum:
                - COMPLETED
            - type: string
              enum:
                - COMPLETED_WITH_REVIEW
            - type: string
              enum:
                - REJECTED
            - type: string
              enum:
                - FAILED
        totalRows:
          minimum: 0
          type: integer
        processedRows:
          minimum: 0
          type: integer
        okRows:
          minimum: 0
          type: integer
        reviewRows:
          minimum: 0
          type: integer
        failedRows:
          minimum: 0
          type: integer
        startedAt:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        finishedAt:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        errorCode:
          anyOf:
            - minLength: 1
              maxLength: 80
              type: string
            - type: "null"
        attemptCount:
          minimum: 0
          type: integer
      title: ImportJob
    def-86:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-85"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            reused:
              type: boolean
      title: ImportJobResponse
    def-87:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - url
            - expiresInSeconds
          properties:
            url:
              format: uri
              type: string
            expiresInSeconds:
              minimum: 1
              type: integer
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: ImportResultResponse
    def-88:
      additionalProperties: false
      type: object
      required:
        - specifiedInContract
        - dedicatedOrFidelizedFleet
        - twoOrThreeShifts
        - laborAndTrafficRulesAcknowledged
        - loadUnloadTotalHoursAtMost3
        - loadingUnloadingByContractor
      properties:
        specifiedInContract:
          anyOf:
            - type: boolean
            - type: "null"
        dedicatedOrFidelizedFleet:
          anyOf:
            - type: boolean
            - type: "null"
        twoOrThreeShifts:
          anyOf:
            - type: boolean
            - type: "null"
        laborAndTrafficRulesAcknowledged:
          anyOf:
            - type: boolean
            - type: "null"
        loadUnloadTotalHoursAtMost3:
          anyOf:
            - type: boolean
            - type: "null"
        loadingUnloadingByContractor:
          anyOf:
            - type: boolean
            - type: "null"
      title: HighPerformanceEvidence
    def-89:
      additionalProperties: false
      type: object
      required:
        - mode
        - reason
        - returnDistanceKm
        - distanceSource
      properties:
        mode:
          anyOf:
            - type: string
              enum:
                - NONE
            - type: string
              enum:
                - REQUIRED
        reason:
          anyOf:
            - type: string
              enum:
                - CONTAINER_TRANSPORT
            - type: string
              enum:
                - SANITARY_RESTRICTION
            - type: string
              enum:
                - CERTIFICATION_RESTRICTION
            - type: "null"
        returnDistanceKm:
          anyOf:
            - pattern: ^(0|[1-9]\d*)(\.\d{1,3})?$
              type: string
            - type: "null"
        distanceSource:
          anyOf:
            - minLength: 2
              maxLength: 64
              type: string
            - type: "null"
      title: EmptyReturnDetails
    def-90:
      additionalProperties: false
      type: object
      required:
        - remuneratedRoadFreight
        - contractedPerTrip
        - territory
        - dieselVehicle
        - ownCargo
        - tacAgregadoContract
        - singleTransportContract
        - singleContractor
        - exclusiveVehicleComposition
        - singleOriginDestinationPair
        - singleTransportDocument
        - ciotExemptionReason
      properties:
        remuneratedRoadFreight:
          anyOf:
            - type: boolean
            - type: "null"
        contractedPerTrip:
          anyOf:
            - type: boolean
            - type: "null"
        territory:
          anyOf:
            - type: string
              enum:
                - NATIONAL
            - type: string
              enum:
                - INTERNATIONAL
            - type: "null"
        dieselVehicle:
          anyOf:
            - type: boolean
            - type: "null"
        ownCargo:
          anyOf:
            - type: boolean
            - type: "null"
        tacAgregadoContract:
          anyOf:
            - type: boolean
            - type: "null"
        singleTransportContract:
          anyOf:
            - type: boolean
            - type: "null"
        singleContractor:
          anyOf:
            - type: boolean
            - type: "null"
        exclusiveVehicleComposition:
          anyOf:
            - type: boolean
            - type: "null"
        singleOriginDestinationPair:
          anyOf:
            - type: boolean
            - type: "null"
        singleTransportDocument:
          anyOf:
            - type: boolean
            - type: "null"
        ciotExemptionReason:
          anyOf:
            - type: string
            - type: "null"
      title: FreightFloorApplicabilityFacts
    def-91:
      additionalProperties: false
      type: object
      required:
        - origin
        - destination
        - calculationDate
        - cargoTypes
        - axleCount
        - contractingMode
        - performance
        - emptyReturn
      properties:
        origin:
          minLength: 2
          maxLength: 255
          type: string
        destination:
          minLength: 2
          maxLength: 255
          type: string
        calculationDate:
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        cargoTypes:
          minItems: 1
          maxItems: 12
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - GRANEL_SOLIDO
              - type: string
                enum:
                  - GRANEL_LIQUIDO
              - type: string
                enum:
                  - FRIGORIFICADA_OU_AQUECIDA
              - type: string
                enum:
                  - CONTEINERIZADA
              - type: string
                enum:
                  - CARGA_GERAL
              - type: string
                enum:
                  - NEOGRANEL
              - type: string
                enum:
                  - PERIGOSA_GRANEL_SOLIDO
              - type: string
                enum:
                  - PERIGOSA_GRANEL_LIQUIDO
              - type: string
                enum:
                  - PERIGOSA_FRIGORIFICADA_AQUECIDA
              - type: string
                enum:
                  - PERIGOSA_CONTEINERIZADA
              - type: string
                enum:
                  - PERIGOSA_CARGA_GERAL
              - type: string
                enum:
                  - GRANEL_PRESSURIZADA
        axleCount:
          minimum: 2
          maximum: 9
          type: integer
        contractingMode:
          anyOf:
            - type: string
              enum:
                - FULL_COMPOSITION
            - type: string
              enum:
                - TRACTION_UNIT_ONLY
        performance:
          additionalProperties: false
          type: object
          required:
            - mode
          properties:
            mode:
              anyOf:
                - type: string
                  enum:
                    - STANDARD
                - type: string
                  enum:
                    - HIGH_PERFORMANCE
            evidence:
              $ref: "#/components/schemas/def-88"
        emptyReturn:
          $ref: "#/components/schemas/def-89"
        options:
          additionalProperties: false
          type: object
          properties:
            includeTolls:
              type: boolean
      title: FreightFloorCalculateRequest
    def-92:
      additionalProperties: false
      type: object
      required:
        - origin
        - destination
        - calculationDate
        - cargoTypes
        - axleCount
        - contractingMode
        - performance
        - emptyReturn
        - declaredFreight
        - operationFacts
      properties:
        origin:
          minLength: 2
          maxLength: 255
          type: string
        destination:
          minLength: 2
          maxLength: 255
          type: string
        calculationDate:
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        cargoTypes:
          minItems: 1
          maxItems: 12
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - GRANEL_SOLIDO
              - type: string
                enum:
                  - GRANEL_LIQUIDO
              - type: string
                enum:
                  - FRIGORIFICADA_OU_AQUECIDA
              - type: string
                enum:
                  - CONTEINERIZADA
              - type: string
                enum:
                  - CARGA_GERAL
              - type: string
                enum:
                  - NEOGRANEL
              - type: string
                enum:
                  - PERIGOSA_GRANEL_SOLIDO
              - type: string
                enum:
                  - PERIGOSA_GRANEL_LIQUIDO
              - type: string
                enum:
                  - PERIGOSA_FRIGORIFICADA_AQUECIDA
              - type: string
                enum:
                  - PERIGOSA_CONTEINERIZADA
              - type: string
                enum:
                  - PERIGOSA_CARGA_GERAL
              - type: string
                enum:
                  - GRANEL_PRESSURIZADA
        axleCount:
          minimum: 2
          maximum: 9
          type: integer
        contractingMode:
          anyOf:
            - type: string
              enum:
                - FULL_COMPOSITION
            - type: string
              enum:
                - TRACTION_UNIT_ONLY
        performance:
          additionalProperties: false
          type: object
          required:
            - mode
          properties:
            mode:
              anyOf:
                - type: string
                  enum:
                    - STANDARD
                - type: string
                  enum:
                    - HIGH_PERFORMANCE
            evidence:
              $ref: "#/components/schemas/def-88"
        emptyReturn:
          $ref: "#/components/schemas/def-89"
        options:
          additionalProperties: false
          type: object
          properties:
            includeTolls:
              type: boolean
        declaredFreight:
          anyOf:
            - pattern: ^(0|[1-9]\d*)\.\d{2}$
              type: string
            - type: "null"
        operationFacts:
          $ref: "#/components/schemas/def-90"
      title: FreightFloorValidateRequest
    def-93:
      additionalProperties: false
      type: object
      required:
        - calculations
      properties:
        calculations:
          minItems: 1
          maxItems: 100
          type: array
          items:
            $ref: "#/components/schemas/def-91"
      title: BatchFreightFloorRequest
    def-94:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 100
          default: 25
          type: integer
        cursor:
          type: string
      title: FreightFloorListQuery
    def-95:
      additionalProperties: false
      type: object
      required:
        - id
        - status
        - distance
        - selection
        - coefficient
        - floor
        - regulation
        - warnings
      properties:
        id:
          type: string
        status:
          type: string
        distance:
          type: object
          required:
            - meters
            - kilometers
            - source
          properties:
            meters:
              minimum: 1
              type: integer
            kilometers:
              pattern: ^\d+\.\d{3}$
              type: string
            source:
              type: string
        selection:
          type: object
          required:
            - tableCode
            - cargoTypeApplied
            - requestedAxleCount
            - appliedAxleCount
            - axleFallbackApplied
          properties:
            tableCode:
              anyOf:
                - type: string
                  enum:
                    - A
                - type: string
                  enum:
                    - B
                - type: string
                  enum:
                    - C
                - type: string
                  enum:
                    - D
            cargoTypeApplied:
              type: string
            requestedAxleCount:
              type: integer
            appliedAxleCount:
              anyOf:
                - type: integer
                - type: "null"
            axleFallbackApplied:
              type: boolean
        coefficient:
          type: object
          required:
            - ccd
            - cc
          properties:
            ccd:
              anyOf:
                - type: string
                - type: "null"
            cc:
              anyOf:
                - type: string
                - type: "null"
        floor:
          type: object
          required:
            - baseLoadedAmount
            - emptyReturnAmount
            - amount
            - currency
          properties:
            baseLoadedAmount:
              type: string
            emptyReturnAmount:
              type: string
            amount:
              type: string
            currency:
              type: string
              enum:
                - BRL
        regulation:
          type: object
          required:
            - sourceVersionId
            - resolution
            - tableCode
            - effectiveFrom
            - effectiveTo
            - canonicalUrl
            - verifiedAt
            - fingerprint
          properties:
            sourceVersionId:
              anyOf:
                - type: string
                - type: "null"
            resolution:
              anyOf:
                - type: string
                - type: "null"
            tableCode:
              anyOf:
                - type: string
                  enum:
                    - A
                - type: string
                  enum:
                    - B
                - type: string
                  enum:
                    - C
                - type: string
                  enum:
                    - D
            effectiveFrom:
              anyOf:
                - type: string
                - type: "null"
            effectiveTo:
              anyOf:
                - type: string
                - type: "null"
            canonicalUrl:
              anyOf:
                - type: string
                - type: "null"
            verifiedAt:
              anyOf:
                - type: string
                - type: "null"
            fingerprint:
              anyOf:
                - type: string
                - type: "null"
        warnings:
          type: array
          items:
            type: string
      title: FreightFloorResult
    def-96:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-95"
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: FreightFloorCalculationResponse
    def-97:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - id
            - kind
            - floorApplicability
            - ciotRequirement
            - preCiot
            - declaredFreight
            - minimumFreight
            - difference
            - shortfall
            - differencePercent
            - calculation
          properties:
            id:
              type: string
            kind:
              type: string
              enum:
                - PRE_CIOT_ASSESSMENT
            floorApplicability:
              type: object
              required:
                - status
                - reasons
              properties:
                status:
                  type: string
                reasons:
                  type: array
                  items:
                    type: string
            ciotRequirement:
              type: object
              required:
                - status
                - reasons
              properties:
                status:
                  type: string
                reasons:
                  type: array
                  items:
                    type: string
            preCiot:
              type: object
              required:
                - status
                - officialCiotIssued
                - officialAnttValidationPerformed
                - message
              properties:
                status:
                  type: string
                officialCiotIssued:
                  type: boolean
                  enum:
                    - false
                officialAnttValidationPerformed:
                  type: boolean
                  enum:
                    - false
                message:
                  type: string
            declaredFreight:
              anyOf:
                - type: string
                - type: "null"
            minimumFreight:
              type: string
            difference:
              anyOf:
                - type: string
                - type: "null"
            shortfall:
              type: string
            differencePercent:
              type: string
            calculation:
              $ref: "#/components/schemas/def-95"
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: FreightFloorValidationResponse
    def-98:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - activeCount
            - activeProductCount
            - activeProductIds
            - totalCount
            - totalProductCount
            - pausedCount
            - activeIds
            - systemStatus
          properties:
            activeCount:
              minimum: 0
              type: integer
            activeProductCount:
              minimum: 0
              type: integer
            activeProductIds:
              type: array
              items:
                type: string
            totalCount:
              minimum: 0
              type: integer
            totalProductCount:
              minimum: 0
              type: integer
            pausedCount:
              minimum: 0
              type: integer
            activeIds:
              type: array
              items:
                type: string
            systemStatus:
              anyOf:
                - type: string
                  enum:
                    - OPERATIONAL
                - type: string
                  enum:
                    - DEGRADED
                - type: string
                  enum:
                    - MAINTENANCE
                - type: string
                  enum:
                    - OUTAGE
            health:
              additionalProperties: false
              type: object
              required:
                - scope
                - moduleProbes
                - status
                - checkedAt
                - stale
                - checks
              properties:
                scope:
                  type: string
                  enum:
                    - ESSENTIAL_DEPENDENCIES
                moduleProbes:
                  type: string
                  enum:
                    - NOT_IMPLEMENTED
                status:
                  anyOf:
                    - type: string
                      enum:
                        - HEALTHY
                    - type: string
                      enum:
                        - DEGRADED
                    - type: string
                      enum:
                        - UNAVAILABLE
                    - type: string
                      enum:
                        - UNKNOWN
                checkedAt:
                  format: date-time
                  type: string
                stale:
                  type: boolean
                checks:
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - status
                      - code
                    properties:
                      id:
                        anyOf:
                          - type: string
                            enum:
                              - catalog
                          - type: string
                            enum:
                              - database-readiness
                          - type: string
                            enum:
                              - freight-floor-source
                          - type: string
                            enum:
                              - provider-configuration
                      status:
                        anyOf:
                          - type: string
                            enum:
                              - HEALTHY
                          - type: string
                            enum:
                              - DEGRADED
                          - type: string
                            enum:
                              - UNAVAILABLE
                          - type: string
                            enum:
                              - UNKNOWN
                      code:
                        type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: PublicApiSummaryResponse
    def-99:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - systemStatus
            - statusLabel
            - lastCheckedAt
            - overallUptime
            - metrics
            - modules
            - incident
          properties:
            systemStatus:
              anyOf:
                - type: string
                  enum:
                    - OPERATIONAL
                - type: string
                  enum:
                    - DEGRADED
                - type: string
                  enum:
                    - OUTAGE
                - type: string
                  enum:
                    - MAINTENANCE
            health:
              additionalProperties: false
              type: object
              required:
                - scope
                - moduleProbes
                - status
                - checkedAt
                - stale
                - checks
              properties:
                scope:
                  type: string
                  enum:
                    - ESSENTIAL_DEPENDENCIES
                moduleProbes:
                  type: string
                  enum:
                    - NOT_IMPLEMENTED
                status:
                  anyOf:
                    - type: string
                      enum:
                        - HEALTHY
                    - type: string
                      enum:
                        - DEGRADED
                    - type: string
                      enum:
                        - UNAVAILABLE
                    - type: string
                      enum:
                        - UNKNOWN
                checkedAt:
                  format: date-time
                  type: string
                stale:
                  type: boolean
                checks:
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - status
                      - code
                    properties:
                      id:
                        anyOf:
                          - type: string
                            enum:
                              - catalog
                          - type: string
                            enum:
                              - database-readiness
                          - type: string
                            enum:
                              - freight-floor-source
                          - type: string
                            enum:
                              - provider-configuration
                      status:
                        anyOf:
                          - type: string
                            enum:
                              - HEALTHY
                          - type: string
                            enum:
                              - DEGRADED
                          - type: string
                            enum:
                              - UNAVAILABLE
                          - type: string
                            enum:
                              - UNKNOWN
                      code:
                        type: string
            statusLabel:
              type: string
            lastCheckedAt:
              type: string
            overallUptime:
              anyOf:
                - type: number
                - type: "null"
            metrics:
              type: object
              required:
                - uptime24h
                - uptime30d
                - averageLatencyMs
              properties:
                uptime24h:
                  anyOf:
                    - type: number
                    - type: "null"
                uptime30d:
                  anyOf:
                    - type: number
                    - type: "null"
                averageLatencyMs:
                  anyOf:
                    - type: number
                    - type: "null"
            modules:
              type: array
              items:
                type: object
                required:
                  - id
                  - name
                  - category
                  - status
                  - statusLabel
                  - latencyMs
                  - uptimePercentage
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  category:
                    type: string
                  status:
                    anyOf:
                      - type: string
                        enum:
                          - OPERATIONAL
                      - type: string
                        enum:
                          - DEGRADED
                      - type: string
                        enum:
                          - PAUSED
                      - type: string
                        enum:
                          - DISABLED
                      - type: string
                        enum:
                          - UNKNOWN
                  statusLabel:
                    type: string
                  latencyMs:
                    anyOf:
                      - type: number
                      - type: "null"
                  uptimePercentage:
                    anyOf:
                      - type: number
                      - type: "null"
                  orchestration:
                    type: boolean
            incident:
              anyOf:
                - type: "null"
                - type: object
                  required:
                    - active
                    - title
                    - description
                  properties:
                    active:
                      type: boolean
                    title:
                      type: string
                    description:
                      type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: PublicSystemStatusResponse
    def-100:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - configured
            - maskedKey
            - host
            - keyLocation
            - source
            - updatedAt
            - lastSubmittedAt
            - lastSubmissionCount
            - lastSubmissionStatus
          properties:
            configured:
              type: boolean
            maskedKey:
              anyOf:
                - minLength: 1
                  maxLength: 64
                  type: string
                - type: "null"
            host:
              minLength: 1
              maxLength: 254
              type: string
            keyLocation:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
            source:
              anyOf:
                - type: string
                  enum:
                    - DATABASE
                - type: string
                  enum:
                    - ENVIRONMENT
                - type: string
                  enum:
                    - NONE
            updatedAt:
              anyOf:
                - format: date-time
                  type: string
                - type: "null"
            lastSubmittedAt:
              anyOf:
                - format: date-time
                  type: string
                - type: "null"
            lastSubmissionCount:
              anyOf:
                - minimum: 0
                  type: integer
                - type: "null"
            lastSubmissionStatus:
              anyOf:
                - type: string
                - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: IndexNowStatusResponse
    def-101:
      additionalProperties: false
      type: object
      required:
        - key
      properties:
        key:
          minLength: 8
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]+$
          type: string
      title: UpdateIndexNowSettingsRequest
    def-102:
      additionalProperties: false
      type: object
      properties:
        key:
          minLength: 8
          maxLength: 128
          type: string
      title: IndexNowTestRequest
    def-103:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - success
            - httpStatus
            - latencyMs
            - message
          properties:
            success:
              type: boolean
            httpStatus:
              minimum: 100
              maximum: 599
              type: integer
            latencyMs:
              minimum: 0
              type: integer
            message:
              minLength: 1
              maxLength: 500
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: IndexNowTestResponse
    def-104:
      additionalProperties: false
      type: object
      properties:
        urls:
          maxItems: 100
          type: array
          items:
            minLength: 1
            maxLength: 500
            type: string
        key:
          minLength: 8
          maxLength: 128
          type: string
      title: IndexNowSubmitRequest
    def-105:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - success
            - httpStatus
            - latencyMs
            - submittedCount
            - urls
            - message
          properties:
            success:
              type: boolean
            httpStatus:
              minimum: 100
              maximum: 599
              type: integer
            latencyMs:
              minimum: 0
              type: integer
            submittedCount:
              minimum: 0
              type: integer
            urls:
              type: array
              items:
                type: string
            message:
              minLength: 1
              maxLength: 500
              type: string
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: IndexNowSubmitResponse
    def-106:
      additionalProperties: false
      type: object
      required:
        - id
        - status
        - startedAt
        - finishedAt
        - summary
        - findings
        - usedOpenAi
        - trigger
      properties:
        id:
          type: string
        status:
          anyOf:
            - type: string
              enum:
                - HEALTHY
            - type: string
              enum:
                - DIVERGENT
            - type: string
              enum:
                - FAILED
        startedAt:
          format: date-time
          type: string
        finishedAt:
          format: date-time
          type: string
        summary:
          type: string
        findings:
          type: array
          items:
            type: string
        usedOpenAi:
          type: boolean
        trigger:
          anyOf:
            - type: string
              enum:
                - MANUAL
            - type: string
              enum:
                - SCHEDULED
      title: AdminAgentRun
    def-107:
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - description
        - enabled
        - executionMode
        - schedule
        - depth
        - recommendedSchedule
        - permissions
        - lastRun
      properties:
        id:
          anyOf:
            - type: string
              enum:
                - ADMIN_INFORMATION_AUDITOR
            - type: string
              enum:
                - API_ARTIFACT_AUDITOR
            - type: string
              enum:
                - DATA_FRESHNESS_SENTINEL
            - type: string
              enum:
                - EXTERNAL_DEPENDENCY_AUDITOR
            - type: string
              enum:
                - ANP_DATASET_REFRESH_AGENT
            - type: string
              enum:
                - SYSTEM_ERROR_SENTRY_AGENT
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        executionMode:
          anyOf:
            - type: string
              enum:
                - ON_DEMAND
            - type: string
              enum:
                - SCHEDULED
        schedule:
          anyOf:
            - type: object
              required:
                - mode
              properties:
                mode:
                  type: string
                  enum:
                    - ON_DEMAND
            - type: object
              required:
                - mode
                - intervalHours
              properties:
                mode:
                  type: string
                  enum:
                    - INTERVAL_HOURS
                intervalHours:
                  minimum: 1
                  maximum: 48
                  type: integer
            - type: object
              required:
                - mode
                - hour
                - minute
              properties:
                mode:
                  type: string
                  enum:
                    - DAILY
                hour:
                  minimum: 0
                  maximum: 23
                  type: integer
                minute:
                  minimum: 0
                  maximum: 59
                  type: integer
            - type: object
              required:
                - mode
                - weekday
                - hour
                - minute
              properties:
                mode:
                  type: string
                  enum:
                    - WEEKLY
                weekday:
                  minimum: 0
                  maximum: 6
                  type: integer
                hour:
                  minimum: 0
                  maximum: 23
                  type: integer
                minute:
                  minimum: 0
                  maximum: 59
                  type: integer
        depth:
          anyOf:
            - type: string
              enum:
                - STANDARD
            - type: string
              enum:
                - STRICT
        recommendedSchedule:
          additionalProperties: false
          type: object
          required:
            - label
            - rationale
            - schedule
          properties:
            label:
              type: string
            rationale:
              type: string
            schedule:
              anyOf:
                - type: object
                  required:
                    - mode
                  properties:
                    mode:
                      type: string
                      enum:
                        - ON_DEMAND
                - type: object
                  required:
                    - mode
                    - intervalHours
                  properties:
                    mode:
                      type: string
                      enum:
                        - INTERVAL_HOURS
                    intervalHours:
                      minimum: 1
                      maximum: 48
                      type: integer
                - type: object
                  required:
                    - mode
                    - hour
                    - minute
                  properties:
                    mode:
                      type: string
                      enum:
                        - DAILY
                    hour:
                      minimum: 0
                      maximum: 23
                      type: integer
                    minute:
                      minimum: 0
                      maximum: 59
                      type: integer
                - type: object
                  required:
                    - mode
                    - weekday
                    - hour
                    - minute
                  properties:
                    mode:
                      type: string
                      enum:
                        - WEEKLY
                    weekday:
                      minimum: 0
                      maximum: 6
                      type: integer
                    hour:
                      minimum: 0
                      maximum: 23
                      type: integer
                    minute:
                      minimum: 0
                      maximum: 59
                      type: integer
        permissions:
          type: array
          items:
            type: string
            enum:
              - READ_ADMIN_STATE
        lastRun:
          anyOf:
            - $ref: "#/components/schemas/def-106"
            - type: "null"
      title: AdminAgent
    def-108:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - configured
            - source
            - maskedKey
            - model
            - updatedAt
          properties:
            configured:
              type: boolean
            source:
              anyOf:
                - type: string
                  enum:
                    - DATABASE
                - type: string
                  enum:
                    - NONE
            maskedKey:
              anyOf:
                - type: string
                - type: "null"
            model:
              type: string
            updatedAt:
              anyOf:
                - format: date-time
                  type: string
                - type: "null"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: OpenAiStatusResponse
    def-109:
      additionalProperties: false
      type: object
      required:
        - apiKey
      properties:
        apiKey:
          minLength: 20
          maxLength: 300
          type: string
        model:
          minLength: 2
          maxLength: 80
          default: gpt-5-mini
          type: string
      title: SaveOpenAiRequest
    def-110:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          additionalProperties: false
          type: object
          required:
            - success
            - latencyMs
          properties:
            success:
              type: boolean
              enum:
                - true
            latencyMs:
              minimum: 0
              type: integer
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: OpenAiTestResponse
    def-111:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-107"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: AdminAgentsResponse
    def-112:
      additionalProperties: false
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
        schedule:
          anyOf:
            - type: object
              required:
                - mode
              properties:
                mode:
                  type: string
                  enum:
                    - ON_DEMAND
            - type: object
              required:
                - mode
                - intervalHours
              properties:
                mode:
                  type: string
                  enum:
                    - INTERVAL_HOURS
                intervalHours:
                  minimum: 1
                  maximum: 48
                  type: integer
            - type: object
              required:
                - mode
                - hour
                - minute
              properties:
                mode:
                  type: string
                  enum:
                    - DAILY
                hour:
                  minimum: 0
                  maximum: 23
                  type: integer
                minute:
                  minimum: 0
                  maximum: 59
                  type: integer
            - type: object
              required:
                - mode
                - weekday
                - hour
                - minute
              properties:
                mode:
                  type: string
                  enum:
                    - WEEKLY
                weekday:
                  minimum: 0
                  maximum: 6
                  type: integer
                hour:
                  minimum: 0
                  maximum: 23
                  type: integer
                minute:
                  minimum: 0
                  maximum: 59
                  type: integer
        depth:
          anyOf:
            - type: string
              enum:
                - STANDARD
            - type: string
              enum:
                - STRICT
      title: UpdateAdminAgentRequest
    def-113:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-107"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: AdminAgentResponse
    def-114:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-106"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
            nextCursor:
              anyOf:
                - minLength: 1
                  type: string
                - type: "null"
      title: AdminAgentRunResponse
paths:
  /api/v1/freight-floor/calculate:
    post:
      summary: Calcula o piso mínimo ANTT com fonte regulatória versionada.
      tags:
        - Freight Floor
      description: Exige freight-floor:calculate e Idempotency-Key. Pedágio/VPO não
        integra o piso.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - origin
                - destination
                - calculationDate
                - cargoTypes
                - axleCount
                - contractingMode
                - performance
                - emptyReturn
              properties:
                origin:
                  minLength: 2
                  maxLength: 255
                  type: string
                destination:
                  minLength: 2
                  maxLength: 255
                  type: string
                calculationDate:
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  type: string
                cargoTypes:
                  minItems: 1
                  maxItems: 12
                  type: array
                  items:
                    anyOf:
                      - const: GRANEL_SOLIDO
                        type: string
                      - const: GRANEL_LIQUIDO
                        type: string
                      - const: FRIGORIFICADA_OU_AQUECIDA
                        type: string
                      - const: CONTEINERIZADA
                        type: string
                      - const: CARGA_GERAL
                        type: string
                      - const: NEOGRANEL
                        type: string
                      - const: PERIGOSA_GRANEL_SOLIDO
                        type: string
                      - const: PERIGOSA_GRANEL_LIQUIDO
                        type: string
                      - const: PERIGOSA_FRIGORIFICADA_AQUECIDA
                        type: string
                      - const: PERIGOSA_CONTEINERIZADA
                        type: string
                      - const: PERIGOSA_CARGA_GERAL
                        type: string
                      - const: GRANEL_PRESSURIZADA
                        type: string
                axleCount:
                  minimum: 2
                  maximum: 9
                  type: integer
                contractingMode:
                  anyOf:
                    - const: FULL_COMPOSITION
                      type: string
                    - const: TRACTION_UNIT_ONLY
                      type: string
                performance:
                  additionalProperties: false
                  type: object
                  required:
                    - mode
                  properties:
                    mode:
                      anyOf:
                        - const: STANDARD
                          type: string
                        - const: HIGH_PERFORMANCE
                          type: string
                    evidence:
                      additionalProperties: false
                      type: object
                      required:
                        - specifiedInContract
                        - dedicatedOrFidelizedFleet
                        - twoOrThreeShifts
                        - laborAndTrafficRulesAcknowledged
                        - loadUnloadTotalHoursAtMost3
                        - loadingUnloadingByContractor
                      properties:
                        specifiedInContract:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        dedicatedOrFidelizedFleet:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        twoOrThreeShifts:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        laborAndTrafficRulesAcknowledged:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        loadUnloadTotalHoursAtMost3:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        loadingUnloadingByContractor:
                          anyOf:
                            - type: boolean
                            - type: "null"
                emptyReturn:
                  additionalProperties: false
                  type: object
                  required:
                    - mode
                    - reason
                    - returnDistanceKm
                    - distanceSource
                  properties:
                    mode:
                      anyOf:
                        - const: NONE
                          type: string
                        - const: REQUIRED
                          type: string
                    reason:
                      anyOf:
                        - const: CONTAINER_TRANSPORT
                          type: string
                        - const: SANITARY_RESTRICTION
                          type: string
                        - const: CERTIFICATION_RESTRICTION
                          type: string
                        - type: "null"
                    returnDistanceKm:
                      anyOf:
                        - pattern: ^(0|[1-9]\d*)(\.\d{1,3})?$
                          type: string
                        - type: "null"
                    distanceSource:
                      anyOf:
                        - minLength: 2
                          maxLength: 64
                          type: string
                        - type: "null"
                options:
                  additionalProperties: false
                  type: object
                  properties:
                    includeTolls:
                      type: boolean
            example: &a1
              origin: São Paulo, SP
              destination: Curitiba, PR
              calculationDate: 2026-09-03
              cargoTypes:
                - CARGA_GERAL
              axleCount: 6
              contractingMode: FULL_COMPOSITION
              performance:
                mode: STANDARD
              emptyReturn:
                mode: NONE
                reason: null
                returnDistanceKm: null
                distanceSource: null
      parameters:
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-96"
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-96"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "402":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/validate:
    post:
      summary: Executa pré-checagem de frete e CIOT sem integração oficial.
      tags:
        - Freight Floor
      description: Aplicabilidade do piso e obrigatoriedade do CIOT são decisões separadas.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - origin
                - destination
                - calculationDate
                - cargoTypes
                - axleCount
                - contractingMode
                - performance
                - emptyReturn
                - declaredFreight
                - operationFacts
              properties:
                origin:
                  minLength: 2
                  maxLength: 255
                  type: string
                destination:
                  minLength: 2
                  maxLength: 255
                  type: string
                calculationDate:
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  type: string
                cargoTypes:
                  minItems: 1
                  maxItems: 12
                  type: array
                  items:
                    anyOf:
                      - const: GRANEL_SOLIDO
                        type: string
                      - const: GRANEL_LIQUIDO
                        type: string
                      - const: FRIGORIFICADA_OU_AQUECIDA
                        type: string
                      - const: CONTEINERIZADA
                        type: string
                      - const: CARGA_GERAL
                        type: string
                      - const: NEOGRANEL
                        type: string
                      - const: PERIGOSA_GRANEL_SOLIDO
                        type: string
                      - const: PERIGOSA_GRANEL_LIQUIDO
                        type: string
                      - const: PERIGOSA_FRIGORIFICADA_AQUECIDA
                        type: string
                      - const: PERIGOSA_CONTEINERIZADA
                        type: string
                      - const: PERIGOSA_CARGA_GERAL
                        type: string
                      - const: GRANEL_PRESSURIZADA
                        type: string
                axleCount:
                  minimum: 2
                  maximum: 9
                  type: integer
                contractingMode:
                  anyOf:
                    - const: FULL_COMPOSITION
                      type: string
                    - const: TRACTION_UNIT_ONLY
                      type: string
                performance:
                  additionalProperties: false
                  type: object
                  required:
                    - mode
                  properties:
                    mode:
                      anyOf:
                        - const: STANDARD
                          type: string
                        - const: HIGH_PERFORMANCE
                          type: string
                    evidence:
                      additionalProperties: false
                      type: object
                      required:
                        - specifiedInContract
                        - dedicatedOrFidelizedFleet
                        - twoOrThreeShifts
                        - laborAndTrafficRulesAcknowledged
                        - loadUnloadTotalHoursAtMost3
                        - loadingUnloadingByContractor
                      properties:
                        specifiedInContract:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        dedicatedOrFidelizedFleet:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        twoOrThreeShifts:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        laborAndTrafficRulesAcknowledged:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        loadUnloadTotalHoursAtMost3:
                          anyOf:
                            - type: boolean
                            - type: "null"
                        loadingUnloadingByContractor:
                          anyOf:
                            - type: boolean
                            - type: "null"
                emptyReturn:
                  additionalProperties: false
                  type: object
                  required:
                    - mode
                    - reason
                    - returnDistanceKm
                    - distanceSource
                  properties:
                    mode:
                      anyOf:
                        - const: NONE
                          type: string
                        - const: REQUIRED
                          type: string
                    reason:
                      anyOf:
                        - const: CONTAINER_TRANSPORT
                          type: string
                        - const: SANITARY_RESTRICTION
                          type: string
                        - const: CERTIFICATION_RESTRICTION
                          type: string
                        - type: "null"
                    returnDistanceKm:
                      anyOf:
                        - pattern: ^(0|[1-9]\d*)(\.\d{1,3})?$
                          type: string
                        - type: "null"
                    distanceSource:
                      anyOf:
                        - minLength: 2
                          maxLength: 64
                          type: string
                        - type: "null"
                options:
                  additionalProperties: false
                  type: object
                  properties:
                    includeTolls:
                      type: boolean
                declaredFreight:
                  anyOf:
                    - pattern: ^(0|[1-9]\d*)\.\d{2}$
                      type: string
                    - type: "null"
                operationFacts:
                  additionalProperties: false
                  type: object
                  required:
                    - remuneratedRoadFreight
                    - contractedPerTrip
                    - territory
                    - dieselVehicle
                    - ownCargo
                    - tacAgregadoContract
                    - singleTransportContract
                    - singleContractor
                    - exclusiveVehicleComposition
                    - singleOriginDestinationPair
                    - singleTransportDocument
                    - ciotExemptionReason
                  properties:
                    remuneratedRoadFreight:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    contractedPerTrip:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    territory:
                      anyOf:
                        - const: NATIONAL
                          type: string
                        - const: INTERNATIONAL
                          type: string
                        - type: "null"
                    dieselVehicle:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    ownCargo:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    tacAgregadoContract:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    singleTransportContract:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    singleContractor:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    exclusiveVehicleComposition:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    singleOriginDestinationPair:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    singleTransportDocument:
                      anyOf:
                        - type: boolean
                        - type: "null"
                    ciotExemptionReason:
                      anyOf:
                        - type: string
                        - type: "null"
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              calculationDate: 2026-09-03
              cargoTypes:
                - GRANEL_SOLIDO
              axleCount: 2
              contractingMode: FULL_COMPOSITION
              performance:
                mode: STANDARD
              emptyReturn:
                mode: NONE
                reason: null
                returnDistanceKm: null
                distanceSource: null
              declaredFreight: null
              operationFacts:
                remuneratedRoadFreight: null
                contractedPerTrip: null
                territory: null
                dieselVehicle: null
                ownCargo: null
                tacAgregadoContract: null
                singleTransportContract: null
                singleContractor: null
                exclusiveVehicleComposition: null
                singleOriginDestinationPair: null
                singleTransportDocument: null
                ciotExemptionReason: null
      parameters:
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-97"
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-97"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "402":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/batch:
    post:
      summary: Calcula até 100 pisos com erro isolado por item.
      tags:
        - Freight Floor
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - calculations
              properties:
                calculations:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - origin
                      - destination
                      - calculationDate
                      - cargoTypes
                      - axleCount
                      - contractingMode
                      - performance
                      - emptyReturn
                    properties:
                      origin:
                        minLength: 2
                        maxLength: 255
                        type: string
                      destination:
                        minLength: 2
                        maxLength: 255
                        type: string
                      calculationDate:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      cargoTypes:
                        minItems: 1
                        maxItems: 12
                        type: array
                        items:
                          anyOf:
                            - const: GRANEL_SOLIDO
                              type: string
                            - const: GRANEL_LIQUIDO
                              type: string
                            - const: FRIGORIFICADA_OU_AQUECIDA
                              type: string
                            - const: CONTEINERIZADA
                              type: string
                            - const: CARGA_GERAL
                              type: string
                            - const: NEOGRANEL
                              type: string
                            - const: PERIGOSA_GRANEL_SOLIDO
                              type: string
                            - const: PERIGOSA_GRANEL_LIQUIDO
                              type: string
                            - const: PERIGOSA_FRIGORIFICADA_AQUECIDA
                              type: string
                            - const: PERIGOSA_CONTEINERIZADA
                              type: string
                            - const: PERIGOSA_CARGA_GERAL
                              type: string
                            - const: GRANEL_PRESSURIZADA
                              type: string
                      axleCount:
                        minimum: 2
                        maximum: 9
                        type: integer
                      contractingMode:
                        anyOf:
                          - const: FULL_COMPOSITION
                            type: string
                          - const: TRACTION_UNIT_ONLY
                            type: string
                      performance:
                        additionalProperties: false
                        type: object
                        required:
                          - mode
                        properties:
                          mode:
                            anyOf:
                              - const: STANDARD
                                type: string
                              - const: HIGH_PERFORMANCE
                                type: string
                          evidence:
                            additionalProperties: false
                            type: object
                            required:
                              - specifiedInContract
                              - dedicatedOrFidelizedFleet
                              - twoOrThreeShifts
                              - laborAndTrafficRulesAcknowledged
                              - loadUnloadTotalHoursAtMost3
                              - loadingUnloadingByContractor
                            properties:
                              specifiedInContract:
                                anyOf:
                                  - type: boolean
                                  - type: "null"
                              dedicatedOrFidelizedFleet:
                                anyOf:
                                  - type: boolean
                                  - type: "null"
                              twoOrThreeShifts:
                                anyOf:
                                  - type: boolean
                                  - type: "null"
                              laborAndTrafficRulesAcknowledged:
                                anyOf:
                                  - type: boolean
                                  - type: "null"
                              loadUnloadTotalHoursAtMost3:
                                anyOf:
                                  - type: boolean
                                  - type: "null"
                              loadingUnloadingByContractor:
                                anyOf:
                                  - type: boolean
                                  - type: "null"
                      emptyReturn:
                        additionalProperties: false
                        type: object
                        required:
                          - mode
                          - reason
                          - returnDistanceKm
                          - distanceSource
                        properties:
                          mode:
                            anyOf:
                              - const: NONE
                                type: string
                              - const: REQUIRED
                                type: string
                          reason:
                            anyOf:
                              - const: CONTAINER_TRANSPORT
                                type: string
                              - const: SANITARY_RESTRICTION
                                type: string
                              - const: CERTIFICATION_RESTRICTION
                                type: string
                              - type: "null"
                          returnDistanceKm:
                            anyOf:
                              - pattern: ^(0|[1-9]\d*)(\.\d{1,3})?$
                                type: string
                              - type: "null"
                          distanceSource:
                            anyOf:
                              - minLength: 2
                                maxLength: 64
                                type: string
                              - type: "null"
                      options:
                        additionalProperties: false
                        type: object
                        properties:
                          includeTolls:
                            type: boolean
            example:
              calculations:
                - *a1
      parameters:
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/admin/financial-fiscal/cases/{id}:
    get:
      summary: Consulta o detalhe seguro de uma ocorrencia.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/cases/{id}/timeline:
    get:
      summary: Lista a timeline sanitizada de pagamento, fiscal, documento e entrega.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/cases/{id}/acknowledge:
    post:
      summary: Reconhece uma ocorrencia sem alterar estados externos.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/cases/{id}/resolve:
    post:
      summary: Registra resolucao manual auditavel.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/documents/{id}/publish:
    post:
      summary: Publica versao pronta para o tenant.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/documents/{id}/archive:
    post:
      summary: Arquiva documento preservando suas versoes.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/documents/{id}/send:
    post:
      summary: Enfileira comunicacao transacional do documento.
      tags:
        - Financial & Fiscal Center
      description: Requer Idempotency-Key; aceite pelo Brevo nao e interpretado como
        entrega ou abertura.
      parameters:
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
        - schema:
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "202":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/documents/{id}/download:
    get:
      summary: Gera URL assinada curta para Platform Admin.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/overview:
    get:
      summary: Consolida pendencias financeiras e fiscais da plataforma.
      tags:
        - Financial & Fiscal Center
      description: Exclusivo de Platform Admin. Pagamento, documento fiscal e entrega
        de e-mail permanecem estados independentes.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - financialPending
                      - fiscalPending
                      - paidWithoutInvoice
                      - rejected
                      - actionRequired
                      - manualDocuments
                      - emailFailures
                      - critical
                    properties:
                      financialPending:
                        type: integer
                      fiscalPending:
                        type: integer
                      paidWithoutInvoice:
                        type: integer
                      rejected:
                        type: integer
                      actionRequired:
                        type: integer
                      manualDocuments:
                        type: integer
                      emailFailures:
                        type: integer
                      critical:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/def-1"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/cases:
    get:
      summary: Lista ocorrencias operacionais por cursor.
      tags:
        - Financial & Fiscal Center
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - items
                      - nextCursor
                    properties:
                      items:
                        type: array
                        items:
                          type: object
                          required:
                            - id
                            - caseType
                            - severity
                            - status
                          properties:
                            id:
                              type: string
                            caseType:
                              type: string
                            severity:
                              type: string
                            status:
                              type: string
                      nextCursor:
                        anyOf:
                          - type: string
                          - type: "null"
                  meta:
                    $ref: "#/components/schemas/def-1"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-fiscal/documents/upload:
    post:
      summary: Recebe documento manual em Storage privado para revisao.
      tags:
        - Financial & Fiscal Center
      description: Exclusivo de Platform Admin. Requer multipart/form-data; o arquivo
        e validado por assinatura e nunca altera o estado do pagamento ou do
        provider fiscal.
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - documentId
                      - versionId
                      - status
                    properties:
                      documentId:
                        type: string
                      versionId:
                        type: string
                      status:
                        type: string
                        enum:
                          - DRAFT
                  meta:
                    $ref: "#/components/schemas/def-1"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "413":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/documents:
    get:
      summary: Lista documentos publicados do tenant autenticado.
      tags:
        - Billing
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - type
                        - origin
                        - status
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        origin:
                          type: string
                        status:
                          type: string
                  meta:
                    $ref: "#/components/schemas/def-1"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/documents/{id}/download:
    get:
      summary: Gera URL assinada curta de documento do proprio tenant.
      tags:
        - Billing
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/freight-floor/calculations:
    get:
      summary: Lista snapshots históricos do tenant por cursor.
      tags:
        - Freight Floor
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 100
            default: 25
            type: integer
        - in: query
          name: cursor
          required: false
          schema:
            type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/calculations/{id}:
    get:
      summary: Consulta snapshot ANTT sem recalcular.
      tags:
        - Freight Floor
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: 00000000-0000-4000-8000-000000000001
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-96"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/imports/xlsx:
    post:
      summary: Cria importação XLSX assíncrona de piso ou pré-CIOT.
      tags:
        - Freight Floor
      parameters:
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-86"
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-86"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "413":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                mode:
                  type: string
                  enum:
                    - CALCULATION
                    - PRE_CIOT
                  example: CALCULATION
              required:
                - file
                - mode
  /api/v1/freight-floor/imports/template:
    get:
      summary: Baixa o template XLSX seguro e versionado.
      tags:
        - Freight Floor
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/freight-floor/imports/{id}:
    get:
      summary: Consulta o progresso da importaÃ§Ã£o.
      tags:
        - Freight Floor
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: 00000000-0000-4000-8000-000000000001
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/imports/{id}/result:
    get:
      summary: ObtÃ©m URL temporÃ¡ria do resultado XLSX.
      tags:
        - Freight Floor
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: 00000000-0000-4000-8000-000000000001
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/analytics:
    get:
      summary: Agrega indicadores regulatÃ³rios do tenant.
      tags:
        - Freight Floor
      parameters:
        - in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
          example: 2026-09-03T12:00:00Z
        - in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
          example: 2026-09-03T12:00:00Z
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/freight-floor/calculations/export.csv:
    get:
      summary: Exporta histÃ³rico ANTT do tenant em CSV.
      tags:
        - Freight Floor
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: freight-floor
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/antt-freight/sources:
    get:
      summary: Lista fontes regulatÃ³rias e cobertura A-D.
      tags:
        - ANTT Admin
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/antt-freight/sources/{id}/verify:
    post:
      summary: Verifica cobertura estrutural da fonte.
      tags:
        - ANTT Admin
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/antt-freight/sources/{id}/publish:
    post:
      summary: Publica manualmente uma fonte verificada e com paridade.
      tags:
        - ANTT Admin
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/antt-freight/sources/{id}/parity:
    post:
      summary: Registra evidÃªncia humana de paridade.
      tags:
        - ANTT Admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - evidence
              properties:
                evidence:
                  minLength: 12
                  maxLength: 1000
                  type: string
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/antt-freight/sources/{id}/reject:
    post:
      summary: Rejeita uma fonte nÃ£o publicada com justificativa.
      tags:
        - ANTT Admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                reason:
                  minLength: 8
                  maxLength: 500
                  type: string
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema: {}
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/routes/calculate:
    post:
      summary: Calcula rota, distância e pedágios para um veículo.
      tags:
        - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - origin
                - destination
                - vehicle
                - calculationDate
              properties:
                origin:
                  minLength: 2
                  maxLength: 255
                  type: string
                destination:
                  minLength: 2
                  maxLength: 255
                  type: string
                vehicle:
                  additionalProperties: false
                  type: object
                  required:
                    - axleCount
                    - vehicleClassCode
                  properties:
                    axleCount:
                      minimum: 1
                      maximum: 20
                      type: integer
                    vehicleClassCode:
                      minLength: 1
                      maxLength: 64
                      type: string
                calculationDate:
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  type: string
            example: &a2
              origin: São Paulo, SP
              destination: Curitiba, PR
              vehicle:
                axleCount: 6
                vehicleClassCode: TRUCK_SEMI_TRAILER
              calculationDate: 2026-09-03
      parameters:
        - schema:
            type: string
          in: header
          name: authorization
          required: false
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-12"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "402":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: toll-calculation
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/routes/batch:
    post:
      summary: Calcula até 100 rotas em lote.
      tags:
        - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - calculations
              properties:
                calculations:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - origin
                      - destination
                      - vehicle
                      - calculationDate
                    properties:
                      origin:
                        minLength: 2
                        maxLength: 255
                        type: string
                      destination:
                        minLength: 2
                        maxLength: 255
                        type: string
                      vehicle:
                        additionalProperties: false
                        type: object
                        required:
                          - axleCount
                          - vehicleClassCode
                        properties:
                          axleCount:
                            minimum: 1
                            maximum: 20
                            type: integer
                          vehicleClassCode:
                            minLength: 1
                            maxLength: 64
                            type: string
                      calculationDate:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
            example:
              calculations:
                - *a2
      parameters:
        - schema:
            type: string
          in: header
          name: authorization
          required: false
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      responses:
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "413":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: toll-calculation
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/routes/places-autocomplete:
    get:
      summary: Sugestões e autocomplete de cidades, endereços e polos logísticos com
        Google Places.
      tags:
        - Routes
      description: "Retorna predições estruturadas para acelerar origem e destino. Use
        scope=CITY para campos de município: a busca solicita somente cidades ao
        Google Places e mantém fallback local."
      parameters:
        - in: query
          name: input
          required: true
          schema:
            minLength: 1
            maxLength: 150
            type: string
          example: São Paulo
        - in: query
          name: scope
          required: false
          schema:
            description: LOCATION sugere endereços, cidades e polos. CITY restringe a
              sugestão a municípios brasileiros.
            default: LOCATION
            anyOf:
              - const: LOCATION
                type: string
              - const: CITY
                type: string
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - description
                        - mainText
                        - secondaryText
                        - source
                        - fallbackReason
                        - fallbackCompatibility
                      properties:
                        id:
                          type: string
                        description:
                          type: string
                        mainText:
                          type: string
                        secondaryText:
                          type: string
                        source:
                          anyOf:
                            - const: GOOGLE
                              type: string
                            - const: IBGE
                              type: string
                            - const: LOCAL
                              type: string
                        fallbackReason:
                          anyOf:
                            - const: PROVIDER_NOT_CONFIGURED
                              type: string
                            - const: PROVIDER_ERROR
                              type: string
                            - const: NO_PROVIDER_MATCH
                              type: string
                            - type: "null"
                        fallbackCompatibility:
                          anyOf:
                            - const: PRIMARY
                              type: string
                            - const: SECONDARY_PROVIDER
                              type: string
                            - const: INCOMPATIBLE_GEOCODING_SCOPE
                              type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                      - count
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      count:
                        minimum: 0
                        type: integer
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: toll-calculation
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/calculations/{id}:
    get:
      summary: Consulta um cálculo do tenant por ID.
      tags:
        - Routes
      description: Exige routes:read. Recursos de outro tenant retornam 404.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - distance
                      - tolls
                      - status
                      - reviewReasons
                      - coverage
                      - auxiliaryEstimate
                      - audit
                    properties:
                      id:
                        format: uuid
                        type: string
                      distance:
                        additionalProperties: false
                        type: object
                        required:
                          - meters
                        properties:
                          meters:
                            minimum: 0
                            type: integer
                      tolls:
                        additionalProperties: false
                        type: object
                        required:
                          - total
                          - charges
                        properties:
                          total:
                            anyOf:
                              - additionalProperties: false
                                type: object
                                required:
                                  - amount
                                  - currency
                                properties:
                                  amount:
                                    pattern: ^(0|[1-9]\d*)\.\d{2}$
                                    type: string
                                  currency:
                                    const: BRL
                                    type: string
                              - type: "null"
                          charges:
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - tollPointId
                                - tollRateId
                                - sequence
                                - amount
                                - matchDistanceMeters
                                - matchConfidence
                                - directionResolution
                              properties:
                                tollPointId:
                                  format: uuid
                                  type: string
                                tollRateId:
                                  anyOf:
                                    - format: uuid
                                      type: string
                                    - type: "null"
                                sequence:
                                  minimum: 1
                                  type: integer
                                amount:
                                  anyOf:
                                    - additionalProperties: false
                                      type: object
                                      required:
                                        - amount
                                        - currency
                                      properties:
                                        amount:
                                          pattern: ^(0|[1-9]\d*)\.\d{2}$
                                          type: string
                                        currency:
                                          const: BRL
                                          type: string
                                    - type: "null"
                                matchDistanceMeters:
                                  minimum: 0
                                  type: number
                                matchConfidence:
                                  minimum: 0
                                  maximum: 1
                                  type: number
                                directionResolution:
                                  anyOf:
                                    - const: RESOLVED
                                      type: string
                                    - const: NOT_APPLICABLE
                                      type: string
                                    - const: AMBIGUOUS
                                      type: string
                      status:
                        anyOf:
                          - const: OK
                            type: string
                          - const: REVIEW_REQUIRED
                            type: string
                      reviewReasons:
                        type: array
                        items:
                          anyOf:
                            - const: TOLL_RATE_NOT_FOUND
                              type: string
                            - const: AMBIGUOUS_TOLL_DIRECTION
                              type: string
                            - const: AMBIGUOUS_TOLL_ROAD
                              type: string
                            - const: POTENTIAL_TOLL_UNMATCHED
                              type: string
                            - const: GOOGLE_TOLL_SIGNAL_DIVERGENCE
                              type: string
                            - const: GOOGLE_TOLL_SIGNAL_MISMATCH
                              type: string
                            - const: TOLL_CATALOG_NOT_HOMOLOGATED
                              type: string
                      coverage:
                        additionalProperties: false
                        type: object
                        required:
                          - status
                          - matchedTolls
                          - pricedTolls
                          - confirmedSubtotal
                        properties:
                          status:
                            anyOf:
                              - const: CONFIRMADA
                                type: string
                              - const: COBERTURA_PARCIAL
                                type: string
                              - const: TARIFA_NAO_CONFIRMADA
                                type: string
                              - const: COBERTURA_INDISPONIVEL
                                type: string
                              - const: SEM_PEDAGIO
                                type: string
                          matchedTolls:
                            minimum: 0
                            type: integer
                          pricedTolls:
                            minimum: 0
                            type: integer
                          confirmedSubtotal:
                            anyOf:
                              - additionalProperties: false
                                type: object
                                required:
                                  - amount
                                  - currency
                                properties:
                                  amount:
                                    pattern: ^(0|[1-9]\d*)\.\d{2}$
                                    type: string
                                  currency:
                                    const: BRL
                                    type: string
                              - type: "null"
                      auxiliaryEstimate:
                        anyOf:
                          - additionalProperties: false
                            type: object
                            required:
                              - provider
                              - official
                              - amount
                            properties:
                              provider:
                                const: GOOGLE_ROUTES
                                type: string
                              official:
                                const: false
                                type: boolean
                              amount:
                                additionalProperties: false
                                type: object
                                required:
                                  - amount
                                  - currency
                                properties:
                                  amount:
                                    pattern: ^(0|[1-9]\d*)\.\d{2}$
                                    type: string
                                  currency:
                                    const: BRL
                                    type: string
                          - type: "null"
                      audit:
                        additionalProperties: false
                        type: object
                        required:
                          - googleTollSignal
                        properties:
                          googleTollSignal:
                            anyOf:
                              - type: object
                                patternProperties:
                                  ^(.*)$: {}
                              - type: "null"
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      x-runtime-contract: true
  /api/v1/calculations:
    get:
      summary: Lista cálculos concluídos do tenant.
      tags:
        - Routes
      description: Exige routes:read e usa cursor opaco por created_at/id.
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
        - in: query
          name: cursor
          required: false
          schema:
            minLength: 1
            type: string
        - in: query
          name: q
          required: false
          schema:
            maxLength: 100
            type: string
        - in: query
          name: status
          required: false
          schema:
            anyOf:
              - const: OK
                type: string
              - const: REVIEW_REQUIRED
                type: string
        - in: query
          name: axleCount
          required: false
          schema:
            minimum: 1
            maximum: 20
            type: integer
        - in: query
          name: startDate
          required: false
          schema:
            pattern: ^\d{4}-\d{2}-\d{2}$
            type: string
        - in: query
          name: endDate
          required: false
          schema:
            pattern: ^\d{4}-\d{2}-\d{2}$
            type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - origin
                        - destination
                        - vehicle
                        - calculationDate
                        - distance
                        - tolls
                        - status
                        - reviewReasons
                        - createdAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        origin:
                          minLength: 2
                          maxLength: 255
                          type: string
                        destination:
                          minLength: 2
                          maxLength: 255
                          type: string
                        vehicle:
                          additionalProperties: false
                          type: object
                          required:
                            - axleCount
                            - vehicleClassCode
                          properties:
                            axleCount:
                              minimum: 1
                              maximum: 20
                              type: integer
                            vehicleClassCode:
                              minLength: 1
                              maxLength: 64
                              type: string
                        calculationDate:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        distance:
                          additionalProperties: false
                          type: object
                          required:
                            - meters
                          properties:
                            meters:
                              minimum: 0
                              type: integer
                        tolls:
                          additionalProperties: false
                          type: object
                          required:
                            - total
                          properties:
                            total:
                              anyOf:
                                - additionalProperties: false
                                  type: object
                                  required:
                                    - amount
                                    - currency
                                  properties:
                                    amount:
                                      pattern: ^(0|[1-9]\d*)\.\d{2}$
                                      type: string
                                    currency:
                                      const: BRL
                                      type: string
                                - type: "null"
                        status:
                          anyOf:
                            - const: OK
                              type: string
                            - const: REVIEW_REQUIRED
                              type: string
                        reviewReasons:
                          type: array
                          items:
                            anyOf:
                              - const: TOLL_RATE_NOT_FOUND
                                type: string
                              - const: AMBIGUOUS_TOLL_DIRECTION
                                type: string
                              - const: AMBIGUOUS_TOLL_ROAD
                                type: string
                              - const: POTENTIAL_TOLL_UNMATCHED
                                type: string
                              - const: GOOGLE_TOLL_SIGNAL_DIVERGENCE
                                type: string
                              - const: GOOGLE_TOLL_SIGNAL_MISMATCH
                                type: string
                              - const: TOLL_CATALOG_NOT_HOMOLOGATED
                                type: string
                        createdAt:
                          format: date-time
                          type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                      - nextCursor
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      x-runtime-contract: true
  /api/v1/imports/xlsx:
    post:
      summary: Recebe XLSX e cria job assíncrono.
      tags:
        - Imports
      description: Exige imports:write e Idempotency-Key. O progresso é persistido por
        linhas concluídas.
      parameters:
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - jobType
                      - status
                      - totalRows
                      - processedRows
                      - okRows
                      - reviewRows
                      - failedRows
                      - startedAt
                      - finishedAt
                      - errorCode
                      - attemptCount
                    properties:
                      id:
                        format: uuid
                        type: string
                      jobType:
                        anyOf:
                          - const: ROUTE_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_PRECIOT_VALIDATION
                            type: string
                      status:
                        anyOf:
                          - const: UPLOADED
                            type: string
                          - const: VALIDATING
                            type: string
                          - const: QUEUED
                            type: string
                          - const: PROCESSING
                            type: string
                          - const: COMPLETED
                            type: string
                          - const: COMPLETED_WITH_REVIEW
                            type: string
                          - const: REJECTED
                            type: string
                          - const: FAILED
                            type: string
                      totalRows:
                        minimum: 0
                        type: integer
                      processedRows:
                        minimum: 0
                        type: integer
                      okRows:
                        minimum: 0
                        type: integer
                      reviewRows:
                        minimum: 0
                        type: integer
                      failedRows:
                        minimum: 0
                        type: integer
                      startedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      finishedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      errorCode:
                        anyOf:
                          - minLength: 1
                            maxLength: 80
                            type: string
                          - type: "null"
                      attemptCount:
                        minimum: 0
                        type: integer
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      reused:
                        type: boolean
        "202":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - jobType
                      - status
                      - totalRows
                      - processedRows
                      - okRows
                      - reviewRows
                      - failedRows
                      - startedAt
                      - finishedAt
                      - errorCode
                      - attemptCount
                    properties:
                      id:
                        format: uuid
                        type: string
                      jobType:
                        anyOf:
                          - const: ROUTE_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_PRECIOT_VALIDATION
                            type: string
                      status:
                        anyOf:
                          - const: UPLOADED
                            type: string
                          - const: VALIDATING
                            type: string
                          - const: QUEUED
                            type: string
                          - const: PROCESSING
                            type: string
                          - const: COMPLETED
                            type: string
                          - const: COMPLETED_WITH_REVIEW
                            type: string
                          - const: REJECTED
                            type: string
                          - const: FAILED
                            type: string
                      totalRows:
                        minimum: 0
                        type: integer
                      processedRows:
                        minimum: 0
                        type: integer
                      okRows:
                        minimum: 0
                        type: integer
                      reviewRows:
                        minimum: 0
                        type: integer
                      failedRows:
                        minimum: 0
                        type: integer
                      startedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      finishedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      errorCode:
                        anyOf:
                          - minLength: 1
                            maxLength: 80
                            type: string
                          - type: "null"
                      attemptCount:
                        minimum: 0
                        type: integer
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      reused:
                        type: boolean
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "409":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                axleCount:
                  type: integer
                  minimum: 1
                  maximum: 20
                  example: 6
                vehicleClassCode:
                  type: string
                  example: TRUCK_SEMI_TRAILER
                calculationDate:
                  type: string
                  example: 2026-09-03
              required:
                - file
                - axleCount
                - vehicleClassCode
                - calculationDate
  /api/v1/imports/{id}:
    get:
      summary: Consulta progresso real de importação.
      tags:
        - Imports
      description: Exige imports:read. Contadores vêm dos checkpoints persistidos pelo
        worker.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - jobType
                      - status
                      - totalRows
                      - processedRows
                      - okRows
                      - reviewRows
                      - failedRows
                      - startedAt
                      - finishedAt
                      - errorCode
                      - attemptCount
                    properties:
                      id:
                        format: uuid
                        type: string
                      jobType:
                        anyOf:
                          - const: ROUTE_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_PRECIOT_VALIDATION
                            type: string
                      status:
                        anyOf:
                          - const: UPLOADED
                            type: string
                          - const: VALIDATING
                            type: string
                          - const: QUEUED
                            type: string
                          - const: PROCESSING
                            type: string
                          - const: COMPLETED
                            type: string
                          - const: COMPLETED_WITH_REVIEW
                            type: string
                          - const: REJECTED
                            type: string
                          - const: FAILED
                            type: string
                      totalRows:
                        minimum: 0
                        type: integer
                      processedRows:
                        minimum: 0
                        type: integer
                      okRows:
                        minimum: 0
                        type: integer
                      reviewRows:
                        minimum: 0
                        type: integer
                      failedRows:
                        minimum: 0
                        type: integer
                      startedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      finishedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      errorCode:
                        anyOf:
                          - minLength: 1
                            maxLength: 80
                            type: string
                          - type: "null"
                      attemptCount:
                        minimum: 0
                        type: integer
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      reused:
                        type: boolean
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      x-runtime-contract: true
  /api/v1/imports/{id}/result:
    get:
      summary: Obtém resultado por URL assinada.
      tags:
        - Imports
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - url
                      - expiresInSeconds
                    properties:
                      url:
                        format: uri
                        type: string
                      expiresInSeconds:
                        minimum: 1
                        type: integer
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      x-runtime-contract: true
  /api/v1/billing/plans:
    get:
      summary: Lista planos SaaS ativos.
      tags:
        - Billing
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-19"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/overview:
    get:
      summary: Consulta assinatura e saldo de créditos do tenant.
      tags:
        - Billing
      description: Disponível somente para usuários com papel financeiro no tenant.
        Exibe a assinatura cancelada mais recente quando não houver assinatura
        vigente; TRIALING com periodEnd vencido não comprova pagamento. A
        franquia DEVELOPER gratuita renova para 20 créditos no dia 1º do mês em
        America/Sao_Paulo, sem acumular sobras ou meses antigos. Créditos
        comprados e planos pagos são preservados. A leitura reconcilia uma
        renovação gratuita devida de forma idempotente; inconsistência
        financeira retorna 503 CREDIT_ACCOUNT_UNAVAILABLE.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Saldo e assinatura da organização. O plano gratuito renova para 20
            créditos no dia 1º, à meia-noite de São Paulo, sem acumular
            franquias ou alterar créditos comprados.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-20"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/packages:
    get:
      summary: Lista pacotes avulsos de créditos ativos.
      tags:
        - Billing
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-21"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/checkout:
    post:
      summary: Cria Checkout Stripe ou Asaas para assinatura ou pacote de créditos.
      tags:
        - Billing
      description: Somente owner/admin via JWT. Assinaturas usam Stripe/cartão;
        pacotes avulsos aceitam Stripe/cartão ou Asaas/PIX por seleção
        explícita. Exige Idempotency-Key; a URL de retorno é definida pelo
        servidor.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-27"
      parameters:
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-26"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/invoices:
    get:
      summary: Lista faturas Stripe e recibos de recargas por cartão ou Pix da
        organização.
      tags:
        - Billing
      description: Histórico financeiro exclusivo da organização autenticada. Preserva
        faturas Stripe pagas ou em aberto, inclusive de valor zero, e inclui
        recibos de recargas Asaas após confirmação persistida do pagamento.
        Sessões de checkout pendentes ou falhas não são recibos pagos. hostedUrl
        e pdfUrl são nulos quando nenhum arquivo real está disponível. A
        consulta não gera cobrança, fatura fiscal ou créditos.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Faturas e recibos financeiros da organização. Recibos Pix exigem
            pagamento confirmado; links e arquivos ausentes permanecem nulos.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-23"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/subscriptions/cancel-unpaid:
    post:
      summary: Encerra assinatura com cobrança pendente, anula a fatura em aberto e
        volta ao plano Desenvolvedor.
      tags:
        - Billing
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-25"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/portal:
    post:
      summary: Cria portal do cliente quando o gateway oferece essa capacidade.
      tags:
        - Billing
      description: Com intent=plan-change e assinatura em dia, abre direto na escolha
        de plano; caso contrário, abre a página inicial do portal.
      parameters:
        - schema:
            type: string
            enum:
              - plan-change
          in: query
          name: intent
          required: false
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-22"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/webhooks/{provider}:
    post:
      summary: Recebe eventos assinados e idempotentes do gateway configurado.
      tags:
        - Billing
      description: Stripe exige assinatura sobre o corpo bruto; Asaas exige o token
        exclusivo no header asaas-access-token. A confirmação de compra avulsa
        confere valor e moeda registrados na preparação do checkout. Reentregas
        e eventos de cobrança/checkout usam a mesma identidade financeira.
        Retorna 409 BILLING_PAYMENT_IDENTITY_CONFLICT quando a identidade exige
        conciliação e 422 BILLING_PAYMENT_EXPECTATION_MISMATCH para valor ou
        moeda divergentes, sem liberar créditos. Checkouts históricos sem
        snapshot usam a transação anterior quando disponível; sem ambas as
        evidências, preservam a compatibilidade legada.
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - stripe
              - type: string
                enum:
                  - mercado-pago
              - type: string
                enum:
                  - asaas
          in: path
          name: provider
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - received
                    properties:
                      received:
                        type: boolean
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/usage:
    get:
      summary: Resume consumo de créditos por métrica em um intervalo.
      tags:
        - Billing
      description: Disponível somente para usuários owner ou admin. O intervalo é
        [from,to), em UTC, e pode ter no máximo 366 dias.
      parameters:
        - schema:
            format: date-time
            type: string
          in: query
          name: from
          required: true
        - schema:
            format: date-time
            type: string
          in: query
          name: to
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-30"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/billing/ledger:
    get:
      summary: Lista o extrato de créditos do tenant.
      tags:
        - Billing
      description: Disponível somente para usuários owner ou admin. Usa cursor opaco e
        não expõe metadata interna nem chave de idempotência.
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-28"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/api-keys:
    post:
      summary: Cria API key e mostra o segredo uma vez.
      tags:
        - API Keys
      description: Exige o scope admin:api-keys. O segredo nunca poderá ser consultado
        depois.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-4"
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-5"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
    get:
      summary: Lista metadados de API keys do tenant.
      tags:
        - API Keys
      description: Exige admin:api-keys. Nunca retorna segredo nem secret_hash.
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-6"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/api-keys/{id}:
    delete:
      summary: Revoga uma API key do tenant.
      tags:
        - API Keys
      description: Exige admin:api-keys e registra evento de auditoria.
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "204":
          description: Default Response
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/me:
    get:
      summary: Retorna o ator autenticado e suas permissões.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-31"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/google-maps/status:
    get:
      summary: Consulta a configuração privada do Google Maps sem revelar a chave.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-34"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/google-maps/test:
    post:
      summary: Testa a credencial ativa com uma chamada real e limitada ao Google
        Routes.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-35"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "429":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/openai/status:
    get:
      summary: Consulta a configuração OpenAI sem revelar a chave.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-108"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/openai/settings:
    put:
      summary: Salva a chave OpenAI no cofre criptografado da plataforma.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-109"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-108"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/openai/test:
    post:
      summary: Valida a credencial OpenAI sem executar um agente.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-110"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "502":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/agents:
    get:
      summary: Lista os agentes administrativos seguros.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-111"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/agents/{id}:
    put:
      summary: Ativa ou desativa um agente administrativo.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-112"
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-113"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/agents/{id}/run:
    post:
      summary: Executa uma auditoria administrativa somente leitura.
      tags:
        - Platform
      security:
        - bearerAuth: []
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-114"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/indexnow/status:
    get:
      summary: Consulta o status da integração IndexNow (Bing Webmaster Tools) e
        última submissão.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-100"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/indexnow/settings:
    put:
      summary: Salva a chave de API IndexNow com criptografia AES-256-GCM no banco de
        dados.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-101"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-100"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/indexnow/test:
    post:
      summary: Testa a conexão e validação da chave com o protocolo IndexNow / Bing.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-102"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-103"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/integrations/indexnow/submit:
    post:
      summary: Submete lista de URLs canônicas atualizadas/pendentes ao Bing e
        buscadores IndexNow.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-104"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-105"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/email/settings:
    get:
      summary: Consulta configuração Brevo sem revelar token.
      tags:
        - Platform
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-33"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
    put:
      summary: Salva remetente e token Brevo cifrado.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-38"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-33"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/email/test:
    post:
      summary: Envia e-mail transacional de teste via Brevo.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-36"
      security:
        - bearerAuth: []
      responses:
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-37"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/email/logs:
    get:
      summary: Lista logs sanitizados de e-mail.
      tags:
        - Platform
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-32"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/tenants:
    get:
      summary: Lista organizações cadastradas com métricas de uso para o Platform Admin.
      tags:
        - Platform
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-40"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/customer-insights:
    get:
      summary: Consulta indicadores agregados de clientes, planos e uso para o
        Platform Admin.
      tags:
        - Platform
      parameters:
        - schema:
            minimum: 7
            maximum: 90
            default: 30
            type: integer
          in: query
          name: days
          required: false
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-45"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/tenants/{id}/diagnostics:
    get:
      summary: Consulta diagnósticos somente-leitura de suporte da organização com
        auditoria.
      tags:
        - Platform
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-41"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/tenants/{id}/credits/adjust:
    post:
      summary: Realiza ajuste manual de créditos da organização com justificativa e
        auditoria.
      tags:
        - Platform
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-42"
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-43"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/reference/sources:
    get:
      summary: Lista fontes oficiais.
      tags:
        - Reference
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-65"
  /api/v1/admin/financial-alerts:
    get:
      summary: Consolida orçamentos e consumo mensal dos provedores.
      tags:
        - Financial Alerts
      description: Exclusivo do administrador da plataforma. Stripe pode permanecer
        NOT_CONFIGURED até a conta ser conectada.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-82"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-alerts/{service}/budget:
    put:
      summary: Configura o limite mensal e os thresholds de alerta.
      tags:
        - Financial Alerts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-80"
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - GOOGLE
              - type: string
                enum:
                  - SUPABASE
              - type: string
                enum:
                  - STRIPE
              - type: string
                enum:
                  - BREVO
              - type: string
                enum:
                  - VPS
          in: path
          name: service
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-83"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/financial-alerts/{service}/spend:
    put:
      summary: Registra ou atualiza manualmente o gasto mensal do provedor.
      tags:
        - Financial Alerts
      description: Ponto de extensão para coletores automáticos futuros.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-81"
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - GOOGLE
              - type: string
                enum:
                  - SUPABASE
              - type: string
                enum:
                  - STRIPE
              - type: string
                enum:
                  - BREVO
              - type: string
                enum:
                  - VPS
          in: path
          name: service
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-83"
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/reference/toll-points:
    get:
      summary: Lista praças e pórticos.
      tags:
        - Reference
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
        - schema:
            format: uuid
            type: string
          in: query
          name: sourceId
          required: false
        - schema:
            minLength: 1
            maxLength: 120
            type: string
          in: query
          name: q
          required: false
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-66"
  /api/v1/reference/toll-rates:
    get:
      summary: Lista tarifas oficiais versionadas.
      tags:
        - Reference
      parameters:
        - schema:
            minimum: 1
            maximum: 200
            default: 50
            type: integer
          in: query
          name: limit
          required: false
        - schema:
            minLength: 1
            type: string
          in: query
          name: cursor
          required: false
        - schema:
            format: uuid
            type: string
          in: query
          name: tollPointId
          required: false
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-67"
  /api/v1/reference/summary:
    get:
      summary: Retorna totais globais do catálogo de pedágios.
      tags:
        - Reference
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-64"
  /api/v1/admin/reference/sources:
    post:
      summary: Cadastra fonte oficial com auditoria.
      tags:
        - Reference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-71"
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-68"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/reference/toll-points:
    post:
      summary: Cadastra praça ou pórtico com auditoria.
      tags:
        - Reference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-72"
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-69"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/reference/toll-rates:
    post:
      summary: Publica tarifa oficial versionada com auditoria.
      tags:
        - Reference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/def-73"
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-70"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/reference/sync:
    post:
      summary: Executa rotina de sincronização regulatória e limpeza do cache de rotas
        expiradas.
      tags:
        - Reference
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-78"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/fiscal/invoices:
    get:
      summary: Lista NFS-e do tenant autenticado.
      tags:
        - Fiscal
      description: Exclusivo para owner/admin; dados de outro tenant nunca são aceitos
        por parâmetro.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - status
                        - invoiceNumber
                        - amount
                        - issuedAt
                        - errorCode
                        - hasPdf
                        - hasXml
                        - createdAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        status:
                          type: string
                        invoiceNumber:
                          anyOf:
                            - type: string
                            - type: "null"
                        amount:
                          type: string
                        issuedAt:
                          anyOf:
                            - format: date-time
                              type: string
                            - type: "null"
                        errorCode:
                          anyOf:
                            - type: string
                            - type: "null"
                        hasPdf:
                          type: boolean
                        hasXml:
                          type: boolean
                        createdAt:
                          format: date-time
                          type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/fiscal/invoices/{id}/download:
    get:
      summary: Cria URL assinada curta para PDF ou XML privado.
      tags:
        - Fiscal
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - PDF
              - type: string
                enum:
                  - XML
          in: query
          name: kind
          required: true
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - url
                      - expiresInSeconds
                    properties:
                      url:
                        format: uri
                        type: string
                      expiresInSeconds:
                        type: integer
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/fiscal/webhooks/focus-nfe:
    post:
      summary: Recebe notificação Focus NFe verificada e idempotente.
      tags:
        - Fiscal
      description: Atualiza a obrigação e enfileira documentos; não executa emissão
        nem billing no request.
      parameters:
        - schema:
            type: string
          in: header
          name: authorization
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - received
                    properties:
                      received:
                        type: boolean
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/fiscal/configuration:
    get:
      summary: Consulta configuração fiscal sem segredos.
      tags:
        - Fiscal
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - provider
                      - environment
                      - enabled
                      - checklistConfirmed
                      - publicConfig
                      - updatedAt
                    properties:
                      provider:
                        anyOf:
                          - type: string
                            enum:
                              - FOCUS_NFE
                          - type: string
                            enum:
                              - UNAVAILABLE
                      environment:
                        anyOf:
                          - type: string
                            enum:
                              - DISABLED
                          - type: string
                            enum:
                              - HOMOLOGATION
                          - type: string
                            enum:
                              - PRODUCTION
                      enabled:
                        type: boolean
                      checklistConfirmed:
                        type: boolean
                      publicConfig:
                        additionalProperties: false
                        type: object
                        required:
                          - legalName
                          - tradeName
                          - cnpj
                          - companySize
                          - legalNature
                          - taxRegime
                          - mei
                          - municipalRegistration
                          - municipality
                          - state
                          - municipalityCode
                          - addressStreet
                          - addressNumber
                          - addressComplement
                          - addressDistrict
                          - postalCode
                          - primaryCnae
                          - secondaryCnaes
                          - serviceProfile
                          - lc116Item
                          - municipalServiceCode
                          - serviceListItem
                          - cnaeReference
                          - operationNature
                          - specialTaxRegime
                          - taxationRps
                          - simpleNational
                          - municipalReferenceIssRate
                          - simpleEffectiveIssRate
                          - issWithheld
                          - serviceDescription
                          - fiscalEmail
                          - issuerMode
                          - homologationStatus
                          - nationalMandatoryFrom
                          - nationalConfigurationApproved
                          - taxAssessments
                        properties:
                          legalName:
                            type: string
                            enum:
                              - GEODAGIO CONSULTORIA EM TI LTDA
                          tradeName:
                            minLength: 1
                            maxLength: 120
                            type: string
                          cnpj:
                            type: string
                            enum:
                              - "68955818000100"
                          companySize:
                            type: string
                            enum:
                              - ME
                          legalNature:
                            minLength: 1
                            maxLength: 160
                            type: string
                          taxRegime:
                            type: string
                            enum:
                              - SIMPLES_NACIONAL
                          mei:
                            type: boolean
                            enum:
                              - false
                          municipalRegistration:
                            type: string
                            enum:
                              - "04834755"
                          municipality:
                            type: string
                            enum:
                              - Sao Paulo
                          state:
                            type: string
                            enum:
                              - SP
                          municipalityCode:
                            type: string
                            enum:
                              - "3550308"
                          addressStreet:
                            type: string
                            enum:
                              - Rua Pais Leme
                          addressNumber:
                            type: string
                            enum:
                              - "215"
                          addressComplement:
                            type: string
                            enum:
                              - Conjunto 1713
                          addressDistrict:
                            type: string
                            enum:
                              - Pinheiros
                          postalCode:
                            type: string
                            enum:
                              - "05424150"
                          primaryCnae:
                            type: string
                            enum:
                              - "6319400"
                          secondaryCnaes:
                            type: array
                            items:
                              - type: string
                                enum:
                                  - "6201501"
                              - type: string
                                enum:
                                  - "6201502"
                              - type: string
                                enum:
                                  - "6202300"
                              - type: string
                                enum:
                                  - "6204000"
                              - type: string
                                enum:
                                  - "6311900"
                            additionalItems: false
                            minItems: 5
                            maxItems: 5
                          serviceProfile:
                            type: string
                            enum:
                              - SAAS_API_ACCESS
                          lc116Item:
                            type: string
                            enum:
                              - "1.05"
                          municipalServiceCode:
                            type: string
                            enum:
                              - "02800"
                          serviceListItem:
                            type: string
                            enum:
                              - "02800"
                          cnaeReference:
                            type: string
                            enum:
                              - "6319400"
                          operationNature:
                            type: string
                            enum:
                              - "1"
                          specialTaxRegime:
                            type: string
                            enum:
                              - "6"
                          taxationRps:
                            type: string
                            enum:
                              - T
                          simpleNational:
                            type: boolean
                            enum:
                              - true
                          municipalReferenceIssRate:
                            type: string
                            enum:
                              - "2.9"
                          simpleEffectiveIssRate:
                            anyOf:
                              - pattern: ^\d+(?:\.\d{1,4})?$
                                type: string
                              - type: "null"
                          issWithheld:
                            type: boolean
                          serviceDescription:
                            minLength: 12
                            maxLength: 2000
                            type: string
                          fiscalEmail:
                            format: email
                            maxLength: 254
                            type: string
                          issuerMode:
                            anyOf:
                              - type: string
                                enum:
                                  - SP_MUNICIPAL
                              - type: string
                                enum:
                                  - NACIONAL
                          homologationStatus:
                            anyOf:
                              - type: string
                                enum:
                                  - NOT_STARTED
                              - type: string
                                enum:
                                  - CONFIGURED
                              - type: string
                                enum:
                                  - TESTING
                              - type: string
                                enum:
                                  - APPROVED
                              - type: string
                                enum:
                                  - BLOCKED
                          nationalMandatoryFrom:
                            type: string
                            enum:
                              - 2026-11-01
                          nationalConfigurationApproved:
                            type: boolean
                          taxAssessments:
                            maxItems: 120
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - competence
                                - grossRevenue
                                - effectiveRate
                                - dasAmount
                                - dueDate
                                - status
                                - source
                              properties:
                                competence:
                                  pattern: ^\d{4}-(?:0[1-9]|1[0-2])$
                                  type: string
                                grossRevenue:
                                  pattern: ^\d+(?:\.\d{2})$
                                  type: string
                                effectiveRate:
                                  anyOf:
                                    - pattern: ^\d+(?:\.\d{1,4})?$
                                      type: string
                                    - type: "null"
                                dasAmount:
                                  pattern: ^\d+(?:\.\d{2})$
                                  type: string
                                dueDate:
                                  anyOf:
                                    - format: date
                                      type: string
                                    - type: "null"
                                status:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - PENDING
                                    - type: string
                                      enum:
                                        - PAID
                                    - type: string
                                      enum:
                                        - OVERDUE
                                source:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - ACCOUNTANT
                                    - type: string
                                      enum:
                                        - CONTABILIZEI_EXPORT
                                    - type: string
                                      enum:
                                        - MANUAL_CONFIRMED
                      updatedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
    put:
      summary: Valida e salva configuração fiscal da empresa emissora.
      tags:
        - Fiscal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - provider
                - environment
                - enabled
                - publicConfig
                - confirmChecklist
              properties:
                provider:
                  anyOf:
                    - type: string
                      enum:
                        - FOCUS_NFE
                    - type: string
                      enum:
                        - UNAVAILABLE
                environment:
                  anyOf:
                    - type: string
                      enum:
                        - DISABLED
                    - type: string
                      enum:
                        - HOMOLOGATION
                    - type: string
                      enum:
                        - PRODUCTION
                enabled:
                  type: boolean
                publicConfig:
                  anyOf:
                    - additionalProperties: false
                      type: object
                      required:
                        - legalName
                        - tradeName
                        - cnpj
                        - companySize
                        - legalNature
                        - taxRegime
                        - mei
                        - municipalRegistration
                        - municipality
                        - state
                        - municipalityCode
                        - addressStreet
                        - addressNumber
                        - addressComplement
                        - addressDistrict
                        - postalCode
                        - primaryCnae
                        - secondaryCnaes
                        - serviceProfile
                        - lc116Item
                        - municipalServiceCode
                        - serviceListItem
                        - cnaeReference
                        - operationNature
                        - specialTaxRegime
                        - taxationRps
                        - simpleNational
                        - municipalReferenceIssRate
                        - simpleEffectiveIssRate
                        - issWithheld
                        - serviceDescription
                        - fiscalEmail
                        - issuerMode
                        - homologationStatus
                        - nationalMandatoryFrom
                        - nationalConfigurationApproved
                        - taxAssessments
                      properties:
                        legalName:
                          type: string
                          enum:
                            - GEODAGIO CONSULTORIA EM TI LTDA
                        tradeName:
                          minLength: 1
                          maxLength: 120
                          type: string
                        cnpj:
                          type: string
                          enum:
                            - "68955818000100"
                        companySize:
                          type: string
                          enum:
                            - ME
                        legalNature:
                          minLength: 1
                          maxLength: 160
                          type: string
                        taxRegime:
                          type: string
                          enum:
                            - SIMPLES_NACIONAL
                        mei:
                          type: boolean
                          enum:
                            - false
                        municipalRegistration:
                          type: string
                          enum:
                            - "04834755"
                        municipality:
                          type: string
                          enum:
                            - Sao Paulo
                        state:
                          type: string
                          enum:
                            - SP
                        municipalityCode:
                          type: string
                          enum:
                            - "3550308"
                        addressStreet:
                          type: string
                          enum:
                            - Rua Pais Leme
                        addressNumber:
                          type: string
                          enum:
                            - "215"
                        addressComplement:
                          type: string
                          enum:
                            - Conjunto 1713
                        addressDistrict:
                          type: string
                          enum:
                            - Pinheiros
                        postalCode:
                          type: string
                          enum:
                            - "05424150"
                        primaryCnae:
                          type: string
                          enum:
                            - "6319400"
                        secondaryCnaes:
                          type: array
                          items:
                            - type: string
                              enum:
                                - "6201501"
                            - type: string
                              enum:
                                - "6201502"
                            - type: string
                              enum:
                                - "6202300"
                            - type: string
                              enum:
                                - "6204000"
                            - type: string
                              enum:
                                - "6311900"
                          additionalItems: false
                          minItems: 5
                          maxItems: 5
                        serviceProfile:
                          type: string
                          enum:
                            - SAAS_API_ACCESS
                        lc116Item:
                          type: string
                          enum:
                            - "1.05"
                        municipalServiceCode:
                          type: string
                          enum:
                            - "02800"
                        serviceListItem:
                          type: string
                          enum:
                            - "02800"
                        cnaeReference:
                          type: string
                          enum:
                            - "6319400"
                        operationNature:
                          type: string
                          enum:
                            - "1"
                        specialTaxRegime:
                          type: string
                          enum:
                            - "6"
                        taxationRps:
                          type: string
                          enum:
                            - T
                        simpleNational:
                          type: boolean
                          enum:
                            - true
                        municipalReferenceIssRate:
                          type: string
                          enum:
                            - "2.9"
                        simpleEffectiveIssRate:
                          anyOf:
                            - pattern: ^\d+(?:\.\d{1,4})?$
                              type: string
                            - type: "null"
                        issWithheld:
                          type: boolean
                        serviceDescription:
                          minLength: 12
                          maxLength: 2000
                          type: string
                        fiscalEmail:
                          format: email
                          maxLength: 254
                          type: string
                        issuerMode:
                          anyOf:
                            - type: string
                              enum:
                                - SP_MUNICIPAL
                            - type: string
                              enum:
                                - NACIONAL
                        homologationStatus:
                          anyOf:
                            - type: string
                              enum:
                                - NOT_STARTED
                            - type: string
                              enum:
                                - CONFIGURED
                            - type: string
                              enum:
                                - TESTING
                            - type: string
                              enum:
                                - APPROVED
                            - type: string
                              enum:
                                - BLOCKED
                        nationalMandatoryFrom:
                          type: string
                          enum:
                            - 2026-11-01
                        nationalConfigurationApproved:
                          type: boolean
                        taxAssessments:
                          maxItems: 120
                          type: array
                          items:
                            additionalProperties: false
                            type: object
                            required:
                              - competence
                              - grossRevenue
                              - effectiveRate
                              - dasAmount
                              - dueDate
                              - status
                              - source
                            properties:
                              competence:
                                pattern: ^\d{4}-(?:0[1-9]|1[0-2])$
                                type: string
                              grossRevenue:
                                pattern: ^\d+(?:\.\d{2})$
                                type: string
                              effectiveRate:
                                anyOf:
                                  - pattern: ^\d+(?:\.\d{1,4})?$
                                    type: string
                                  - type: "null"
                              dasAmount:
                                pattern: ^\d+(?:\.\d{2})$
                                type: string
                              dueDate:
                                anyOf:
                                  - format: date
                                    type: string
                                  - type: "null"
                              status:
                                anyOf:
                                  - type: string
                                    enum:
                                      - PENDING
                                  - type: string
                                    enum:
                                      - PAID
                                  - type: string
                                    enum:
                                      - OVERDUE
                              source:
                                anyOf:
                                  - type: string
                                    enum:
                                      - ACCOUNTANT
                                  - type: string
                                    enum:
                                      - CONTABILIZEI_EXPORT
                                  - type: string
                                    enum:
                                      - MANUAL_CONFIRMED
                    - additionalProperties: false
                      type: object
                      properties: {}
                confirmChecklist:
                  type: boolean
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - provider
                      - environment
                      - enabled
                      - checklistConfirmed
                      - publicConfig
                      - updatedAt
                    properties:
                      provider:
                        anyOf:
                          - type: string
                            enum:
                              - FOCUS_NFE
                          - type: string
                            enum:
                              - UNAVAILABLE
                      environment:
                        anyOf:
                          - type: string
                            enum:
                              - DISABLED
                          - type: string
                            enum:
                              - HOMOLOGATION
                          - type: string
                            enum:
                              - PRODUCTION
                      enabled:
                        type: boolean
                      checklistConfirmed:
                        type: boolean
                      publicConfig:
                        additionalProperties: false
                        type: object
                        required:
                          - legalName
                          - tradeName
                          - cnpj
                          - companySize
                          - legalNature
                          - taxRegime
                          - mei
                          - municipalRegistration
                          - municipality
                          - state
                          - municipalityCode
                          - addressStreet
                          - addressNumber
                          - addressComplement
                          - addressDistrict
                          - postalCode
                          - primaryCnae
                          - secondaryCnaes
                          - serviceProfile
                          - lc116Item
                          - municipalServiceCode
                          - serviceListItem
                          - cnaeReference
                          - operationNature
                          - specialTaxRegime
                          - taxationRps
                          - simpleNational
                          - municipalReferenceIssRate
                          - simpleEffectiveIssRate
                          - issWithheld
                          - serviceDescription
                          - fiscalEmail
                          - issuerMode
                          - homologationStatus
                          - nationalMandatoryFrom
                          - nationalConfigurationApproved
                          - taxAssessments
                        properties:
                          legalName:
                            type: string
                            enum:
                              - GEODAGIO CONSULTORIA EM TI LTDA
                          tradeName:
                            minLength: 1
                            maxLength: 120
                            type: string
                          cnpj:
                            type: string
                            enum:
                              - "68955818000100"
                          companySize:
                            type: string
                            enum:
                              - ME
                          legalNature:
                            minLength: 1
                            maxLength: 160
                            type: string
                          taxRegime:
                            type: string
                            enum:
                              - SIMPLES_NACIONAL
                          mei:
                            type: boolean
                            enum:
                              - false
                          municipalRegistration:
                            type: string
                            enum:
                              - "04834755"
                          municipality:
                            type: string
                            enum:
                              - Sao Paulo
                          state:
                            type: string
                            enum:
                              - SP
                          municipalityCode:
                            type: string
                            enum:
                              - "3550308"
                          addressStreet:
                            type: string
                            enum:
                              - Rua Pais Leme
                          addressNumber:
                            type: string
                            enum:
                              - "215"
                          addressComplement:
                            type: string
                            enum:
                              - Conjunto 1713
                          addressDistrict:
                            type: string
                            enum:
                              - Pinheiros
                          postalCode:
                            type: string
                            enum:
                              - "05424150"
                          primaryCnae:
                            type: string
                            enum:
                              - "6319400"
                          secondaryCnaes:
                            type: array
                            items:
                              - type: string
                                enum:
                                  - "6201501"
                              - type: string
                                enum:
                                  - "6201502"
                              - type: string
                                enum:
                                  - "6202300"
                              - type: string
                                enum:
                                  - "6204000"
                              - type: string
                                enum:
                                  - "6311900"
                            additionalItems: false
                            minItems: 5
                            maxItems: 5
                          serviceProfile:
                            type: string
                            enum:
                              - SAAS_API_ACCESS
                          lc116Item:
                            type: string
                            enum:
                              - "1.05"
                          municipalServiceCode:
                            type: string
                            enum:
                              - "02800"
                          serviceListItem:
                            type: string
                            enum:
                              - "02800"
                          cnaeReference:
                            type: string
                            enum:
                              - "6319400"
                          operationNature:
                            type: string
                            enum:
                              - "1"
                          specialTaxRegime:
                            type: string
                            enum:
                              - "6"
                          taxationRps:
                            type: string
                            enum:
                              - T
                          simpleNational:
                            type: boolean
                            enum:
                              - true
                          municipalReferenceIssRate:
                            type: string
                            enum:
                              - "2.9"
                          simpleEffectiveIssRate:
                            anyOf:
                              - pattern: ^\d+(?:\.\d{1,4})?$
                                type: string
                              - type: "null"
                          issWithheld:
                            type: boolean
                          serviceDescription:
                            minLength: 12
                            maxLength: 2000
                            type: string
                          fiscalEmail:
                            format: email
                            maxLength: 254
                            type: string
                          issuerMode:
                            anyOf:
                              - type: string
                                enum:
                                  - SP_MUNICIPAL
                              - type: string
                                enum:
                                  - NACIONAL
                          homologationStatus:
                            anyOf:
                              - type: string
                                enum:
                                  - NOT_STARTED
                              - type: string
                                enum:
                                  - CONFIGURED
                              - type: string
                                enum:
                                  - TESTING
                              - type: string
                                enum:
                                  - APPROVED
                              - type: string
                                enum:
                                  - BLOCKED
                          nationalMandatoryFrom:
                            type: string
                            enum:
                              - 2026-11-01
                          nationalConfigurationApproved:
                            type: boolean
                          taxAssessments:
                            maxItems: 120
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - competence
                                - grossRevenue
                                - effectiveRate
                                - dasAmount
                                - dueDate
                                - status
                                - source
                              properties:
                                competence:
                                  pattern: ^\d{4}-(?:0[1-9]|1[0-2])$
                                  type: string
                                grossRevenue:
                                  pattern: ^\d+(?:\.\d{2})$
                                  type: string
                                effectiveRate:
                                  anyOf:
                                    - pattern: ^\d+(?:\.\d{1,4})?$
                                      type: string
                                    - type: "null"
                                dasAmount:
                                  pattern: ^\d+(?:\.\d{2})$
                                  type: string
                                dueDate:
                                  anyOf:
                                    - format: date
                                      type: string
                                    - type: "null"
                                status:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - PENDING
                                    - type: string
                                      enum:
                                        - PAID
                                    - type: string
                                      enum:
                                        - OVERDUE
                                source:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - ACCOUNTANT
                                    - type: string
                                      enum:
                                        - CONTABILIZEI_EXPORT
                                    - type: string
                                      enum:
                                        - MANUAL_CONFIRMED
                      updatedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting:
    get:
      summary: Consolida integração, mappings, pacotes e saúde do provider.
      tags:
        - Accounting
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - integration
                      - mappings
                      - packages
                      - providerHealth
                      - financialSummary
                      - transactions
                    properties:
                      integration:
                        type: object
                        required:
                          - providerKey
                          - enabled
                          - status
                          - deliveryChannel
                          - fallbackPolicy
                          - publicConfig
                          - secretConfigured
                          - updatedAt
                        properties:
                          providerKey:
                            type: string
                          enabled:
                            type: boolean
                          status:
                            type: string
                          deliveryChannel:
                            anyOf:
                              - type: string
                                enum:
                                  - API
                              - type: string
                                enum:
                                  - SFTP
                              - type: string
                                enum:
                                  - SECURE_UPLOAD
                              - type: string
                                enum:
                                  - SECURE_EMAIL
                              - type: string
                                enum:
                                  - MANUAL
                          fallbackPolicy:
                            type: array
                            items:
                              anyOf:
                                - type: string
                                  enum:
                                    - API
                                - type: string
                                  enum:
                                    - SFTP
                                - type: string
                                  enum:
                                    - SECURE_UPLOAD
                                - type: string
                                  enum:
                                    - SECURE_EMAIL
                                - type: string
                                  enum:
                                    - MANUAL
                          publicConfig:
                            type: object
                            additionalProperties: {}
                          secretConfigured:
                            type: boolean
                          updatedAt:
                            anyOf:
                              - format: date-time
                                type: string
                              - type: "null"
                      mappings:
                        type: array
                        items:
                          type: object
                          required:
                            - id
                            - name
                            - version
                            - status
                            - schemaVersion
                            - mappingSha256
                            - createdAt
                            - publishedAt
                          properties:
                            id:
                              format: uuid
                              type: string
                            name:
                              type: string
                            version:
                              type: integer
                            status:
                              type: string
                            schemaVersion:
                              type: string
                            mappingSha256:
                              type: string
                            createdAt:
                              format: date-time
                              type: string
                            publishedAt:
                              anyOf:
                                - format: date-time
                                  type: string
                                - type: "null"
                      packages:
                        type: array
                        items:
                          type: object
                          required:
                            - id
                            - version
                            - periodFrom
                            - periodTo
                            - timezone
                            - status
                            - mappingVersion
                            - packageSha256
                            - transactionCount
                            - invoiceCount
                            - refundCount
                            - reconciliationCount
                            - errorCode
                            - createdAt
                          properties:
                            id:
                              format: uuid
                              type: string
                            version:
                              type: integer
                            periodFrom:
                              format: date-time
                              type: string
                            periodTo:
                              format: date-time
                              type: string
                            timezone:
                              type: string
                            status:
                              type: string
                            mappingVersion:
                              anyOf:
                                - type: integer
                                - type: "null"
                            packageSha256:
                              anyOf:
                                - type: string
                                - type: "null"
                            transactionCount:
                              type: integer
                            invoiceCount:
                              type: integer
                            refundCount:
                              type: integer
                            reconciliationCount:
                              type: integer
                            errorCode:
                              anyOf:
                                - type: string
                                - type: "null"
                            createdAt:
                              format: date-time
                              type: string
                      providerHealth:
                        type: object
                        required:
                          - status
                          - checkedAt
                          - code
                        properties:
                          status:
                            type: string
                          checkedAt:
                            format: date-time
                            type: string
                          code:
                            anyOf:
                              - type: string
                              - type: "null"
                      financialSummary:
                        type: object
                        required:
                          - grossRevenue
                          - subscriptionRevenue
                          - creditRevenue
                          - approvedPayments
                          - refunds
                          - chargebacks
                          - discounts
                          - gatewayFees
                          - netReceived
                          - fiscal
                          - reconciliation
                          - source
                        properties:
                          grossRevenue:
                            pattern: ^\d+(?:\.\d{2})$
                            type: string
                          subscriptionRevenue:
                            pattern: ^\d+(?:\.\d{2})$
                            type: string
                          creditRevenue:
                            pattern: ^\d+(?:\.\d{2})$
                            type: string
                          approvedPayments:
                            minimum: 0
                            type: integer
                          refunds:
                            pattern: ^\d+(?:\.\d{2})$
                            type: string
                          chargebacks:
                            pattern: ^\d+(?:\.\d{2})$
                            type: string
                          discounts:
                            anyOf:
                              - pattern: ^\d+(?:\.\d{2})$
                                type: string
                              - type: "null"
                          gatewayFees:
                            anyOf:
                              - pattern: ^\d+(?:\.\d{2})$
                                type: string
                              - type: "null"
                          netReceived:
                            anyOf:
                              - pattern: ^\d+(?:\.\d{2})$
                                type: string
                              - type: "null"
                          fiscal:
                            type: object
                            required:
                              - authorized
                              - pending
                              - rejected
                              - canceled
                              - invoicedAmount
                            properties:
                              authorized:
                                minimum: 0
                                type: integer
                              pending:
                                minimum: 0
                                type: integer
                              rejected:
                                minimum: 0
                                type: integer
                              canceled:
                                minimum: 0
                                type: integer
                              invoicedAmount:
                                pattern: ^\d+(?:\.\d{2})$
                                type: string
                          reconciliation:
                            type: object
                            required:
                              - matched
                              - actionRequired
                            properties:
                              matched:
                                minimum: 0
                                type: integer
                              actionRequired:
                                minimum: 0
                                type: integer
                          source:
                            type: string
                            enum:
                              - RUNTIME_DATABASE
                      transactions:
                        maxItems: 100
                        type: array
                        items:
                          type: object
                          required:
                            - id
                            - customer
                            - customerEmail
                            - product
                            - type
                            - provider
                            - status
                            - amount
                            - currency
                            - paidAt
                            - createdAt
                            - fiscalStatus
                            - invoiceNumber
                            - reconciliationStatus
                          properties:
                            id:
                              format: uuid
                              type: string
                            customer:
                              type: string
                            customerEmail:
                              anyOf:
                                - maxLength: 254
                                  type: string
                                - type: "null"
                            product:
                              type: string
                            type:
                              anyOf:
                                - type: string
                                  enum:
                                    - SUBSCRIPTION
                                - type: string
                                  enum:
                                    - CREDIT_PURCHASE
                            provider:
                              type: string
                            status:
                              type: string
                            amount:
                              pattern: ^\d+(?:\.\d{2})$
                              type: string
                            currency:
                              minLength: 3
                              maxLength: 3
                              type: string
                            paidAt:
                              anyOf:
                                - format: date-time
                                  type: string
                                - type: "null"
                            createdAt:
                              format: date-time
                              type: string
                            fiscalStatus:
                              anyOf:
                                - type: string
                                - type: "null"
                            invoiceNumber:
                              anyOf:
                                - type: string
                                - type: "null"
                            reconciliationStatus:
                              anyOf:
                                - type: string
                                - type: "null"
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting/integration:
    put:
      summary: Configura provider e fallbacks sem retornar segredo.
      tags:
        - Accounting
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - providerKey
                - enabled
                - deliveryChannel
                - fallbackPolicy
                - publicConfig
              properties:
                providerKey:
                  type: string
                enabled:
                  type: boolean
                deliveryChannel:
                  type: string
                fallbackPolicy:
                  type: array
                  items:
                    type: string
                publicConfig:
                  type: object
                  additionalProperties: {}
                secretReference:
                  anyOf:
                    - type: string
                    - type: "null"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting/mappings:
    post:
      summary: Cria mapping draft com allowlist e transformações fechadas.
      tags:
        - Accounting
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - mapping
              properties:
                name:
                  type: string
                mapping: {}
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting/mappings/{id}/publish:
    post:
      summary: Publica versão imutável de mapping.
      tags:
        - Accounting
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting/packages:
    post:
      summary: Solicita snapshot contábil imutável por intervalo [from,to).
      tags:
        - Accounting
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
              properties:
                from:
                  format: date-time
                  type: string
                to:
                  format: date-time
                  type: string
                timezone:
                  type: string
                filters:
                  type: object
                  additionalProperties:
                    type: string
      parameters:
        - schema:
            minLength: 8
            maxLength: 128
            type: string
          in: header
          name: idempotency-key
          required: true
      security:
        - bearerAuth: []
      responses:
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "422":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
    get:
      summary: Lista pacotes e estados de conciliação/entrega.
      tags:
        - Accounting
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting/packages/{id}/deliver:
    post:
      summary: Enfileira entrega idempotente do pacote pronto.
      tags:
        - Accounting
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - queued
                    properties:
                      queued:
                        type: boolean
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/admin/accounting/packages/{id}/download:
    get:
      summary: Cria URL assinada curta para download manual seguro.
      tags:
        - Accounting
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - url
                      - expiresInSeconds
                    properties:
                      url:
                        format: uri
                        type: string
                      expiresInSeconds:
                        type: integer
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "409":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/rntrc/transporters/{rntrc}:
    get:
      summary: Consulta transportador e situação cadastral por RNTRC oficial.
      tags:
        - RNTRC Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      parameters:
        - in: path
          name: rntrc
          required: true
          schema:
            minLength: 5
            maxLength: 12
            type: string
          example: "12345678"
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "404":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/rntrc/transporters/lookup:
    post:
      summary: Consulta transportador por documento ou RNTRC via POST seguro.
      tags:
        - RNTRC Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              properties:
                rntrc:
                  minLength: 5
                  maxLength: 12
                  type: string
                document:
                  minLength: 11
                  maxLength: 18
                  type: string
            example:
              rntrc: "12345678"
      parameters: []
  /api/v1/rntrc/validate:
    post:
      summary: Validação de compliance e aptidão regulatória do transportador.
      tags:
        - RNTRC Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - rntrc
                - document
              properties:
                rntrc:
                  minLength: 5
                  maxLength: 12
                  type: string
                document:
                  minLength: 11
                  maxLength: 18
                  type: string
                requestedAxles:
                  minimum: 2
                  maximum: 10
                  type: integer
            example:
              rntrc: "12345678"
              document: "00000000000191"
              requestedAxles: 6
      parameters: []
  /api/v1/rntrc/transporters/{rntrc}/fleet:
    get:
      summary: Consulta frota agregada oficial cadastrada na ANTT.
      tags:
        - RNTRC Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      parameters:
        - in: path
          name: rntrc
          required: true
          schema:
            minLength: 5
            maxLength: 12
            type: string
          example: "12345678"
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/rntrc/transporters/{rntrc}/history:
    get:
      summary: Histórico de versões e alterações cadastrais do transportador.
      tags:
        - RNTRC Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      parameters:
        - in: path
          name: rntrc
          required: true
          schema:
            minLength: 5
            maxLength: 12
            type: string
          example: "12345678"
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/compliance/road-freight/precheck:
    post:
      summary: Pré-checagem integrada da operação rodoviária (Rota + Piso ANTT + RNTRC).
      tags:
        - Composite Precheck
      description: Dados ausentes ou verificações inconclusivas retornam PARTIAL, sem
        aprovação geral. comparisonStatus distingue comparação conforme, não
        conforme, não executada ou em revisão; compliant só é true com
        comparação confirmada.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - route
                      - freightFloor
                      - compliance
                      - overall
                      - summary
                    properties:
                      route:
                        type: object
                        required:
                          - distanceKm
                          - tollCostCents
                          - tollCount
                          - tollStatus
                        properties:
                          distanceKm:
                            type: number
                          tollCostCents:
                            anyOf:
                              - type: number
                              - type: "null"
                          tollCount:
                            anyOf:
                              - type: number
                              - type: "null"
                          tollStatus:
                            type: string
                      freightFloor:
                        type: object
                        required:
                          - minimumFreightAmount
                          - agreedFreightCents
                          - compliant
                          - comparisonStatus
                          - formula
                        properties:
                          minimumFreightAmount:
                            type: string
                          agreedFreightCents:
                            anyOf:
                              - type: number
                              - type: "null"
                          compliant:
                            description: "True somente se a comparação foi concluída e conforme. False não
                              implica irregularidade: consulte
                              comparisonStatus."
                            type: boolean
                          comparisonStatus:
                            anyOf:
                              - const: COMPLIANT
                                type: string
                              - const: NON_COMPLIANT
                                type: string
                              - const: NOT_CHECKED
                                type: string
                              - const: REVIEW_REQUIRED
                                type: string
                          formula:
                            type: string
                      compliance:
                        type: object
                        required:
                          - rntrcStatus
                          - eligibility
                          - identifierMatch
                          - fleetStatus
                          - reasonCodes
                          - componentStatus
                        properties:
                          rntrcStatus:
                            type: string
                          eligibility:
                            type: string
                          identifierMatch:
                            type: boolean
                          fleetStatus:
                            type: string
                          reasonCodes:
                            type: array
                            items:
                              type: string
                          componentStatus:
                            type: string
                      overall:
                        anyOf:
                          - const: PASS
                            type: string
                          - const: PASS_WITH_WARNINGS
                            type: string
                          - const: PARTIAL
                            type: string
                          - const: FAIL
                            type: string
                      summary:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
      x-module-id: composite-precheck
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - origin
                - destination
                - loadType
                - cargoType
                - axles
              properties:
                origin:
                  minLength: 2
                  type: string
                destination:
                  minLength: 2
                  type: string
                loadType:
                  anyOf:
                    - const: LOTACAO
                      type: string
                    - const: FRACIONADA
                      type: string
                cargoType:
                  minLength: 1
                  type: string
                axles:
                  minimum: 2
                  maximum: 10
                  type: integer
                agreedFreightValueCents:
                  minimum: 0
                  type: integer
                hasReturnLoad:
                  type: boolean
                isHighPerformance:
                  type: boolean
                transporterRntrc:
                  minLength: 5
                  maxLength: 12
                  type: string
                transporterDocument:
                  minLength: 11
                  maxLength: 18
                  type: string
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              loadType: LOTACAO
              cargoType: CARGA_GERAL
              axles: 6
              hasReturnLoad: true
      parameters: []
  /api/v1/fuel/prices/latest:
    get:
      summary: Consulta o preço oficial mais recente da ANP com fallback geográfico
      tags:
        - Fuel Prices
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: product
          required: true
          schema:
            anyOf:
              - const: DIESEL_S10
                type: string
              - const: DIESEL_S500
                type: string
              - const: GASOLINA_COMUM
                type: string
              - const: GASOLINA_ADITIVADA
                type: string
              - const: ETANOL
                type: string
              - const: GNV
                type: string
          example: DIESEL_S10
        - in: query
          name: granularity
          required: false
          schema:
            anyOf:
              - const: BRASIL
                type: string
              - const: REGIAO
                type: string
              - const: UF
                type: string
              - const: MUNICIPIO
                type: string
        - in: query
          name: geographicKey
          required: false
          schema:
            minLength: 1
            maxLength: 80
            type: string
        - in: query
          name: state
          required: false
          schema:
            minLength: 2
            maxLength: 2
            type: string
        - in: query
          name: municipality
          required: false
          schema:
            minLength: 2
            maxLength: 100
            type: string
  /api/v1/fuel/route-cost:
    post:
      summary: Calcula a estimativa auditável de consumo em litros e custo financeiro
        de combustível por rota
      tags:
        - Fuel Route Cost
      description: Estratégias por UF ignoram referências municipais. Município é
        normalizado apenas quando identificável em Município, UF (ou /UF e -
        UF). Referências mais amplas são explicitadas em fallbackApplied,
        resolvedGeographicKey e warnings. Preços ANP são estimativas de
        referência, não cotações ao vivo.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - origin
                - destination
                - product
                - consumption
              properties:
                origin:
                  minLength: 3
                  maxLength: 120
                  description: Origem da rota. Para referência municipal, use Município, UF.
                    Endereços não resolvidos usam fallback geográfico explícito.
                  type: string
                destination:
                  minLength: 3
                  maxLength: 120
                  description: Destino da rota. Aceita Município, UF, Município/UF ou Município -
                    UF.
                  type: string
                product:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
                    - const: GASOLINA_COMUM
                      type: string
                    - const: GASOLINA_ADITIVADA
                      type: string
                    - const: ETANOL
                      type: string
                    - const: GNV
                      type: string
                consumption:
                  type: object
                  properties:
                    kmPerLiter:
                      minimum: 0.1
                      maximum: 50
                      type: number
                    litersPer100Km:
                      minimum: 1
                      maximum: 200
                      type: number
                strategy:
                  anyOf:
                    - const: ORIGIN_MUNICIPALITY_LATEST
                      type: string
                    - const: DESTINATION_MUNICIPALITY_LATEST
                      type: string
                    - const: ORIGIN_UF_LATEST
                      type: string
                    - const: DESTINATION_UF_LATEST
                      type: string
                    - const: STATE_AVERAGE
                      type: string
                    - const: NATIONAL_AVERAGE
                      type: string
                distanceKm:
                  minimum: 0.1
                  type: number
                customerProvidedPrice:
                  minimum: 0.01
                  maximum: 100
                  type: number
                environment:
                  anyOf:
                    - const: PRODUCTION
                      type: string
                    - const: SANDBOX
                      type: string
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              product: DIESEL_S10
              consumption:
                kmPerLiter: 2.8
              strategy: ORIGIN_UF_LATEST
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: true
                    type: object
                    required:
                      - distanceKm
                      - product
                      - unit
                      - estimatedLiters
                      - referencePricePerUnit
                      - estimatedTotalCostCents
                      - estimatedTotalCostFormatted
                      - isEstimate
                      - strategy
                      - resolvedGranularity
                      - sourcePeriod
                      - freshness
                      - isOfficialReference
                      - priceOrigin
                      - formula
                      - warnings
                    properties:
                      distanceKm:
                        type: number
                      product:
                        type: string
                      unit:
                        anyOf:
                          - type: string
                            enum:
                              - BRL_PER_LITER
                          - type: string
                            enum:
                              - BRL_PER_M3
                      estimatedLiters:
                        type: number
                      referencePricePerUnit:
                        type: number
                      estimatedTotalCostCents:
                        type: number
                      estimatedTotalCostFormatted:
                        type: string
                      isEstimate:
                        type: boolean
                        enum:
                          - true
                      strategy:
                        type: string
                      resolvedGranularity:
                        anyOf:
                          - type: string
                            enum:
                              - BRASIL
                          - type: string
                            enum:
                              - REGIAO
                          - type: string
                            enum:
                              - UF
                          - type: string
                            enum:
                              - MUNICIPIO
                      sourcePeriod:
                        type: string
                      freshness:
                        anyOf:
                          - type: string
                            enum:
                              - FRESH
                          - type: string
                            enum:
                              - STALE
                          - type: string
                            enum:
                              - UNKNOWN
                      isOfficialReference:
                        type: boolean
                      priceOrigin:
                        type: string
                      formula:
                        type: string
                      warnings:
                        type: array
                        items:
                          type: string
                      fallbackApplied:
                        description: Indica substituição da granularidade solicitada; preço do cliente e
                          média nacional solicitada não são fallback.
                        type: boolean
                      resolvedGeographicKey:
                        description: Chave efetiva da referência de preço; em preço próprio mantém o
                          identificador informado pelo cliente.
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/fuel/stations/{cnpj}:
    get:
      summary: Consulta o cadastro oficial de revendedor varejista de combustível na
        ANP por CNPJ
      tags:
        - Fuel Stations
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      parameters:
        - in: path
          name: cnpj
          required: true
          schema:
            minLength: 14
            maxLength: 18
            type: string
          example: "00000000000191"
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
  /api/v1/fuel/route-stations:
    post:
      summary: Localiza postos autorizados no corredor geográfico de uma rota rodoviária
      tags:
        - Fuel Stations
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                origin:
                  minLength: 3
                  maxLength: 120
                  type: string
                destination:
                  minLength: 3
                  maxLength: 120
                  type: string
                polyline:
                  minLength: 5
                  type: string
                corridorMeters:
                  minimum: 500
                  maximum: 20000
                  type: integer
                product:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
                    - const: GASOLINA_COMUM
                      type: string
                    - const: GASOLINA_ADITIVADA
                      type: string
                    - const: ETANOL
                      type: string
                    - const: GNV
                      type: string
                limit:
                  minimum: 1
                  maximum: 100
                  type: integer
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              product: DIESEL_S10
              corridorMeters: 5000
      parameters: []
  /api/v1/fuel/watch:
    get:
      summary: Lista alvos de monitoramento de preços de combustível do tenant
      tags:
        - Fuel Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
    post:
      summary: Adiciona produto e região para monitoramento contínuo de variações de
        preço
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - product
                - granularity
                - geographicKey
              properties:
                product:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
                    - const: GASOLINA_COMUM
                      type: string
                    - const: GASOLINA_ADITIVADA
                      type: string
                    - const: ETANOL
                      type: string
                    - const: GNV
                      type: string
                granularity:
                  anyOf:
                    - const: BRASIL
                      type: string
                    - const: REGIAO
                      type: string
                    - const: UF
                      type: string
                    - const: MUNICIPIO
                      type: string
                geographicKey:
                  minLength: 1
                  maxLength: 80
                  type: string
                thresholdPrice:
                  minimum: 0.01
                  type: number
                label:
                  maxLength: 100
                  type: string
            example:
              product: DIESEL_S10
              granularity: UF
              geographicKey: SP
              label: Diesel em SP
      parameters: []
  /api/v1/emissions/fuel:
    post:
      summary: Calcula emissões de GEE com base no volume e tipo de combustível
        consumido (Método Fuel-Based)
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fuelType
                - liters
              properties:
                fuelType:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
                    - const: GASOLINA_COMUM
                      type: string
                    - const: GASOLINA_ADITIVADA
                      type: string
                    - const: ETANOL_HIDRATADO
                      type: string
                    - const: GNV
                      type: string
                    - const: BIODIESEL_B100
                      type: string
                liters:
                  minimum: 0.1
                  type: number
                periodDate:
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  type: string
                factorSetId:
                  type: string
                gwpVersion:
                  anyOf:
                    - const: IPCC_AR5_100
                      type: string
                    - const: IPCC_AR6_100
                      type: string
                    - const: IPCC_SAR_100
                      type: string
                    - const: IPCC_AR4_100
                      type: string
                vehicleClass:
                  anyOf:
                    - const: HEAVY_TRUCK
                      type: string
                    - const: MEDIUM_TRUCK
                      type: string
                    - const: LIGHT_COMMERCIAL
                      type: string
                    - const: PASSENGER_CAR
                      type: string
                    - const: UNKNOWN
                      type: string
                accountingContext:
                  type: object
                  properties:
                    vehicleOwnership:
                      anyOf:
                        - const: OWNED
                          type: string
                        - const: LEASED_FINANCIAL
                          type: string
                        - const: OPERATIONAL_LEASE
                          type: string
                        - const: THIRD_PARTY
                          type: string
                        - const: SUBCONTRACTED
                          type: string
                    reporterRole:
                      anyOf:
                        - const: CARRIER
                          type: string
                        - const: SHIPPER
                          type: string
                        - const: BUYER
                          type: string
                        - const: LOGISTICS_OPERATOR
                          type: string
                    transportationPurchasedByReporter:
                      type: boolean
                    soldGoodsDistribution:
                      type: boolean
                    isDirectOperationalControl:
                      type: boolean
                    requestedScope:
                      type: string
                measured:
                  type: boolean
            example:
              fuelType: DIESEL_S10
              liters: 100
              vehicleClass: HEAVY_TRUCK
      parameters: []
  /api/v1/emissions/route:
    post:
      summary: Calcula pegada de carbono da viagem combinando rota real e consumo por
        km (Método Route-Based)
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                origin:
                  minLength: 2
                  type: string
                destination:
                  minLength: 2
                  type: string
                polyline:
                  type: string
                fuelType:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
                    - const: GASOLINA_COMUM
                      type: string
                    - const: GASOLINA_ADITIVADA
                      type: string
                    - const: ETANOL_HIDRATADO
                      type: string
                    - const: GNV
                      type: string
                    - const: BIODIESEL_B100
                      type: string
                consumptionKmPerLiter:
                  minimum: 0.5
                  maximum: 50
                  type: number
                cargoWeightKg:
                  minimum: 0
                  type: number
                vehicleClass:
                  anyOf:
                    - const: HEAVY_TRUCK
                      type: string
                    - const: MEDIUM_TRUCK
                      type: string
                    - const: LIGHT_COMMERCIAL
                      type: string
                    - const: PASSENGER_CAR
                      type: string
                    - const: UNKNOWN
                      type: string
                factorSetId:
                  type: string
                gwpVersion:
                  anyOf:
                    - const: IPCC_AR5_100
                      type: string
                    - const: IPCC_AR6_100
                      type: string
                    - const: IPCC_SAR_100
                      type: string
                    - const: IPCC_AR4_100
                      type: string
                accountingContext:
                  type: object
                  properties:
                    vehicleOwnership:
                      anyOf:
                        - const: OWNED
                          type: string
                        - const: LEASED_FINANCIAL
                          type: string
                        - const: OPERATIONAL_LEASE
                          type: string
                        - const: THIRD_PARTY
                          type: string
                        - const: SUBCONTRACTED
                          type: string
                    reporterRole:
                      anyOf:
                        - const: CARRIER
                          type: string
                        - const: SHIPPER
                          type: string
                        - const: BUYER
                          type: string
                        - const: LOGISTICS_OPERATOR
                          type: string
                    transportationPurchasedByReporter:
                      type: boolean
                    soldGoodsDistribution:
                      type: boolean
                    isDirectOperationalControl:
                      type: boolean
                    requestedScope:
                      type: string
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              fuelType: DIESEL_S10
              consumptionKmPerLiter: 2.8
              cargoWeightKg: 25000
              vehicleClass: HEAVY_TRUCK
      parameters: []
  /api/v1/emissions/activity:
    post:
      summary: Calcula emissões por intensidade de atividade logística (t.km) para
        inventários Scope 3
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - distanceKm
                - cargoWeightKg
              properties:
                distanceKm:
                  minimum: 1
                  type: number
                cargoWeightKg:
                  minimum: 1
                  type: number
                vehicleClass:
                  anyOf:
                    - const: HEAVY_TRUCK
                      type: string
                    - const: MEDIUM_TRUCK
                      type: string
                    - const: LIGHT_COMMERCIAL
                      type: string
                    - const: PASSENGER_CAR
                      type: string
                    - const: UNKNOWN
                      type: string
                factorSetId:
                  type: string
                gwpVersion:
                  anyOf:
                    - const: IPCC_AR5_100
                      type: string
                    - const: IPCC_AR6_100
                      type: string
                    - const: IPCC_SAR_100
                      type: string
                    - const: IPCC_AR4_100
                      type: string
                accountingContext:
                  type: object
                  properties:
                    vehicleOwnership:
                      anyOf:
                        - const: OWNED
                          type: string
                        - const: LEASED_FINANCIAL
                          type: string
                        - const: OPERATIONAL_LEASE
                          type: string
                        - const: THIRD_PARTY
                          type: string
                        - const: SUBCONTRACTED
                          type: string
                    reporterRole:
                      anyOf:
                        - const: CARRIER
                          type: string
                        - const: SHIPPER
                          type: string
                        - const: BUYER
                          type: string
                        - const: LOGISTICS_OPERATOR
                          type: string
                    transportationPurchasedByReporter:
                      type: boolean
                    soldGoodsDistribution:
                      type: boolean
                    isDirectOperationalControl:
                      type: boolean
                    requestedScope:
                      type: string
            example:
              distanceKm: 400
              cargoWeightKg: 25000
              vehicleClass: HEAVY_TRUCK
      parameters: []
  /api/v1/emissions/compare:
    post:
      summary: Compara a pegada de carbono entre dois cenários operacionais de
        transporte
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - scenarioA
                - scenarioB
              properties:
                scenarioA:
                  type: object
                  required:
                    - type
                  properties:
                    label:
                      type: string
                    type:
                      anyOf:
                        - const: FUEL
                          type: string
                        - const: ROUTE
                          type: string
                    fuelInput:
                      type: object
                      required:
                        - fuelType
                        - liters
                      properties:
                        fuelType:
                          anyOf:
                            - const: DIESEL_S10
                              type: string
                            - const: DIESEL_S500
                              type: string
                            - const: GASOLINA_COMUM
                              type: string
                            - const: GASOLINA_ADITIVADA
                              type: string
                            - const: ETANOL_HIDRATADO
                              type: string
                            - const: GNV
                              type: string
                            - const: BIODIESEL_B100
                              type: string
                        liters:
                          minimum: 0.1
                          type: number
                        periodDate:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        factorSetId:
                          type: string
                        gwpVersion:
                          anyOf:
                            - const: IPCC_AR5_100
                              type: string
                            - const: IPCC_AR6_100
                              type: string
                            - const: IPCC_SAR_100
                              type: string
                            - const: IPCC_AR4_100
                              type: string
                        vehicleClass:
                          anyOf:
                            - const: HEAVY_TRUCK
                              type: string
                            - const: MEDIUM_TRUCK
                              type: string
                            - const: LIGHT_COMMERCIAL
                              type: string
                            - const: PASSENGER_CAR
                              type: string
                            - const: UNKNOWN
                              type: string
                        accountingContext:
                          type: object
                          properties:
                            vehicleOwnership:
                              anyOf:
                                - const: OWNED
                                  type: string
                                - const: LEASED_FINANCIAL
                                  type: string
                                - const: OPERATIONAL_LEASE
                                  type: string
                                - const: THIRD_PARTY
                                  type: string
                                - const: SUBCONTRACTED
                                  type: string
                            reporterRole:
                              anyOf:
                                - const: CARRIER
                                  type: string
                                - const: SHIPPER
                                  type: string
                                - const: BUYER
                                  type: string
                                - const: LOGISTICS_OPERATOR
                                  type: string
                            transportationPurchasedByReporter:
                              type: boolean
                            soldGoodsDistribution:
                              type: boolean
                            isDirectOperationalControl:
                              type: boolean
                            requestedScope:
                              type: string
                        measured:
                          type: boolean
                    routeInput:
                      type: object
                      properties:
                        origin:
                          minLength: 2
                          type: string
                        destination:
                          minLength: 2
                          type: string
                        polyline:
                          type: string
                        fuelType:
                          anyOf:
                            - const: DIESEL_S10
                              type: string
                            - const: DIESEL_S500
                              type: string
                            - const: GASOLINA_COMUM
                              type: string
                            - const: GASOLINA_ADITIVADA
                              type: string
                            - const: ETANOL_HIDRATADO
                              type: string
                            - const: GNV
                              type: string
                            - const: BIODIESEL_B100
                              type: string
                        consumptionKmPerLiter:
                          minimum: 0.5
                          maximum: 50
                          type: number
                        cargoWeightKg:
                          minimum: 0
                          type: number
                        vehicleClass:
                          anyOf:
                            - const: HEAVY_TRUCK
                              type: string
                            - const: MEDIUM_TRUCK
                              type: string
                            - const: LIGHT_COMMERCIAL
                              type: string
                            - const: PASSENGER_CAR
                              type: string
                            - const: UNKNOWN
                              type: string
                        factorSetId:
                          type: string
                        gwpVersion:
                          anyOf:
                            - const: IPCC_AR5_100
                              type: string
                            - const: IPCC_AR6_100
                              type: string
                            - const: IPCC_SAR_100
                              type: string
                            - const: IPCC_AR4_100
                              type: string
                        accountingContext:
                          type: object
                          properties:
                            vehicleOwnership:
                              anyOf:
                                - const: OWNED
                                  type: string
                                - const: LEASED_FINANCIAL
                                  type: string
                                - const: OPERATIONAL_LEASE
                                  type: string
                                - const: THIRD_PARTY
                                  type: string
                                - const: SUBCONTRACTED
                                  type: string
                            reporterRole:
                              anyOf:
                                - const: CARRIER
                                  type: string
                                - const: SHIPPER
                                  type: string
                                - const: BUYER
                                  type: string
                                - const: LOGISTICS_OPERATOR
                                  type: string
                            transportationPurchasedByReporter:
                              type: boolean
                            soldGoodsDistribution:
                              type: boolean
                            isDirectOperationalControl:
                              type: boolean
                            requestedScope:
                              type: string
                scenarioB:
                  type: object
                  required:
                    - type
                  properties:
                    label:
                      type: string
                    type:
                      anyOf:
                        - const: FUEL
                          type: string
                        - const: ROUTE
                          type: string
                    fuelInput:
                      type: object
                      required:
                        - fuelType
                        - liters
                      properties:
                        fuelType:
                          anyOf:
                            - const: DIESEL_S10
                              type: string
                            - const: DIESEL_S500
                              type: string
                            - const: GASOLINA_COMUM
                              type: string
                            - const: GASOLINA_ADITIVADA
                              type: string
                            - const: ETANOL_HIDRATADO
                              type: string
                            - const: GNV
                              type: string
                            - const: BIODIESEL_B100
                              type: string
                        liters:
                          minimum: 0.1
                          type: number
                        periodDate:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        factorSetId:
                          type: string
                        gwpVersion:
                          anyOf:
                            - const: IPCC_AR5_100
                              type: string
                            - const: IPCC_AR6_100
                              type: string
                            - const: IPCC_SAR_100
                              type: string
                            - const: IPCC_AR4_100
                              type: string
                        vehicleClass:
                          anyOf:
                            - const: HEAVY_TRUCK
                              type: string
                            - const: MEDIUM_TRUCK
                              type: string
                            - const: LIGHT_COMMERCIAL
                              type: string
                            - const: PASSENGER_CAR
                              type: string
                            - const: UNKNOWN
                              type: string
                        accountingContext:
                          type: object
                          properties:
                            vehicleOwnership:
                              anyOf:
                                - const: OWNED
                                  type: string
                                - const: LEASED_FINANCIAL
                                  type: string
                                - const: OPERATIONAL_LEASE
                                  type: string
                                - const: THIRD_PARTY
                                  type: string
                                - const: SUBCONTRACTED
                                  type: string
                            reporterRole:
                              anyOf:
                                - const: CARRIER
                                  type: string
                                - const: SHIPPER
                                  type: string
                                - const: BUYER
                                  type: string
                                - const: LOGISTICS_OPERATOR
                                  type: string
                            transportationPurchasedByReporter:
                              type: boolean
                            soldGoodsDistribution:
                              type: boolean
                            isDirectOperationalControl:
                              type: boolean
                            requestedScope:
                              type: string
                        measured:
                          type: boolean
                    routeInput:
                      type: object
                      properties:
                        origin:
                          minLength: 2
                          type: string
                        destination:
                          minLength: 2
                          type: string
                        polyline:
                          type: string
                        fuelType:
                          anyOf:
                            - const: DIESEL_S10
                              type: string
                            - const: DIESEL_S500
                              type: string
                            - const: GASOLINA_COMUM
                              type: string
                            - const: GASOLINA_ADITIVADA
                              type: string
                            - const: ETANOL_HIDRATADO
                              type: string
                            - const: GNV
                              type: string
                            - const: BIODIESEL_B100
                              type: string
                        consumptionKmPerLiter:
                          minimum: 0.5
                          maximum: 50
                          type: number
                        cargoWeightKg:
                          minimum: 0
                          type: number
                        vehicleClass:
                          anyOf:
                            - const: HEAVY_TRUCK
                              type: string
                            - const: MEDIUM_TRUCK
                              type: string
                            - const: LIGHT_COMMERCIAL
                              type: string
                            - const: PASSENGER_CAR
                              type: string
                            - const: UNKNOWN
                              type: string
                        factorSetId:
                          type: string
                        gwpVersion:
                          anyOf:
                            - const: IPCC_AR5_100
                              type: string
                            - const: IPCC_AR6_100
                              type: string
                            - const: IPCC_SAR_100
                              type: string
                            - const: IPCC_AR4_100
                              type: string
                        accountingContext:
                          type: object
                          properties:
                            vehicleOwnership:
                              anyOf:
                                - const: OWNED
                                  type: string
                                - const: LEASED_FINANCIAL
                                  type: string
                                - const: OPERATIONAL_LEASE
                                  type: string
                                - const: THIRD_PARTY
                                  type: string
                                - const: SUBCONTRACTED
                                  type: string
                            reporterRole:
                              anyOf:
                                - const: CARRIER
                                  type: string
                                - const: SHIPPER
                                  type: string
                                - const: BUYER
                                  type: string
                                - const: LOGISTICS_OPERATOR
                                  type: string
                            transportationPurchasedByReporter:
                              type: boolean
                            soldGoodsDistribution:
                              type: boolean
                            isDirectOperationalControl:
                              type: boolean
                            requestedScope:
                              type: string
            example:
              scenarioA:
                type: FUEL
                fuelInput:
                  fuelType: DIESEL_S10
                  liters: 100
              scenarioB:
                type: FUEL
                fuelInput:
                  fuelType: DIESEL_S10
                  liters: 90
      parameters: []
  /api/v1/emissions/factors:
    get:
      summary: Lista fatores de emissão ativos e permitidos por licença no registry
        oficial
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/emissions/history:
    get:
      summary: Recupera o histórico auditável de cálculos de emissões do tenant
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/vehicle-compliance/validate:
    post:
      summary: Validação completa de peso bruto, dimensões, eixos, propulsão e
        restrições da composição
      tags:
        - Vehicle & Load Compliance
      description: Peso, eixos, dimensões e indicação de AET são avaliações separadas.
        NOT_INDICATED não comprova conformidade dos limites nem autoriza
        circulação; consulte status, memorial e warnings.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - vehicle
              properties:
                vehicle:
                  type: object
                  required:
                    - configurationCode
                    - dimensions
                    - grossWeightKg
                    - propulsion
                    - axles
                  properties:
                    configurationCode:
                      anyOf:
                        - const: RIGID_2_AXLES
                          type: string
                        - const: RIGID_3_AXLES
                          type: string
                        - const: RIGID_4_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_4_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_5_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_6_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_7_AXLES
                          type: string
                        - const: ROAD_TRAIN_BITREM_7_AXLES
                          type: string
                        - const: ROAD_TRAIN_BITREM_9_AXLES
                          type: string
                        - const: ROAD_TRAIN_RODOTREM_9_AXLES
                          type: string
                        - const: ROAD_TRAIN_TRITREM
                          type: string
                        - const: CUSTOM
                          type: string
                    dimensions:
                      type: object
                      required:
                        - lengthM
                        - widthM
                        - heightM
                      properties:
                        lengthM:
                          minimum: 1
                          maximum: 50
                          type: number
                        widthM:
                          minimum: 1
                          maximum: 10
                          type: number
                        heightM:
                          minimum: 1
                          maximum: 10
                          type: number
                        frontOverhangM:
                          minimum: 0
                          type: number
                        rearOverhangM:
                          minimum: 0
                          type: number
                    grossWeightKg:
                      minimum: 500
                      maximum: 200000
                      type: number
                    tareWeightKg:
                      minimum: 0
                      type: number
                    cmtKg:
                      minimum: 0
                      type: number
                    propulsion:
                      anyOf:
                        - const: DIESEL
                          type: string
                        - const: ELECTRIC
                          type: string
                        - const: HYBRID
                          type: string
                        - const: GAS_NATURAL_COMPRESSED_CNG
                          type: string
                        - const: GAS_NATURAL_LIQUEFIED_LNG
                          type: string
                        - const: BIOMETHANE
                          type: string
                        - const: HYDROGEN_FUEL_CELL
                          type: string
                    axles:
                      type: array
                      items:
                        type: object
                        required:
                          - position
                          - groupType
                          - tireConfiguration
                        properties:
                          position:
                            minimum: 1
                            type: integer
                          groupType:
                            anyOf:
                              - const: SINGLE_STEERING
                                type: string
                              - const: SINGLE_DRIVE
                                type: string
                              - const: TANDEM_DOUBLE
                                type: string
                              - const: TANDEM_TRIPLE
                                type: string
                              - const: TANDEM_QUAD
                                type: string
                              - const: NON_TANDEM_DOUBLE
                                type: string
                              - const: NON_TANDEM_TRIPLE
                                type: string
                              - const: DIRECTIONAL_DOUBLE
                                type: string
                              - const: OTHER
                                type: string
                          tireConfiguration:
                            anyOf:
                              - const: SINGLE_TIRE
                                type: string
                              - const: DUAL_TIRE
                                type: string
                              - const: SUPER_SINGLE_WIDE
                                type: string
                          measuredWeightKg:
                            minimum: 0
                            type: number
                          suspensionType:
                            anyOf:
                              - const: MECHANICAL
                                type: string
                              - const: PNEUMATIC
                                type: string
                              - const: HYDRO_PNEUMATIC
                                type: string
                              - const: UNKNOWN
                                type: string
                          distanceToNextAxleM:
                            minimum: 0
                            type: number
                    plate:
                      type: string
                    stateRegistration:
                      type: string
                cargo:
                  type: object
                  required:
                    - type
                    - weightKg
                    - indivisible
                  properties:
                    type:
                      anyOf:
                        - const: GENERAL_DRY_CARGO
                          type: string
                        - const: BULK_SOLID
                          type: string
                        - const: BULK_LIQUID
                          type: string
                        - const: REFRIGERATED
                          type: string
                        - const: CONTAINER
                          type: string
                        - const: INDIVISIBLE_ABNORMAL
                          type: string
                        - const: VEHICLE_CARRIER_CEGONHA
                          type: string
                        - const: FORESTRY
                          type: string
                        - const: SUGARCANE
                          type: string
                        - const: DANGEROUS_GOODS
                          type: string
                    weightKg:
                      minimum: 0
                      type: number
                    indivisible:
                      type: boolean
                    description:
                      type: string
                    overhangFrontM:
                      minimum: 0
                      type: number
                    overhangRearM:
                      minimum: 0
                      type: number
                    overhangSidesM:
                      minimum: 0
                      type: number
                context:
                  type: object
                  properties:
                    operationDateTime:
                      type: string
                    originState:
                      minLength: 2
                      maxLength: 2
                      type: string
                    destinationState:
                      minLength: 2
                      maxLength: 2
                      type: string
                    routeRoads:
                      type: array
                      items:
                        type: string
                    isSingleLaneRoad:
                      type: boolean
            example:
              vehicle: &a5
                configurationCode: RIGID_2_AXLES
                dimensions: &a4
                  lengthM: 8
                  widthM: 2.6
                  heightM: 4
                grossWeightKg: 15000
                propulsion: DIESEL
                axles: &a3
                  - position: 1
                    groupType: SINGLE_STEERING
                    tireConfiguration: SINGLE_TIRE
                    measuredWeightKg: 6000
                  - position: 2
                    groupType: SINGLE_DRIVE
                    tireConfiguration: DUAL_TIRE
                    measuredWeightKg: 9000
      parameters: []
  /api/v1/vehicle-compliance/axles/validate:
    post:
      summary: Valida distribuição de peso por eixo e tolerâncias regulamentares em
        balança
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - axles
              properties:
                axles:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    required:
                      - position
                      - groupType
                      - tireConfiguration
                    properties:
                      position:
                        minimum: 1
                        type: integer
                      groupType:
                        anyOf:
                          - const: SINGLE_STEERING
                            type: string
                          - const: SINGLE_DRIVE
                            type: string
                          - const: TANDEM_DOUBLE
                            type: string
                          - const: TANDEM_TRIPLE
                            type: string
                          - const: TANDEM_QUAD
                            type: string
                          - const: NON_TANDEM_DOUBLE
                            type: string
                          - const: NON_TANDEM_TRIPLE
                            type: string
                          - const: DIRECTIONAL_DOUBLE
                            type: string
                          - const: OTHER
                            type: string
                      tireConfiguration:
                        anyOf:
                          - const: SINGLE_TIRE
                            type: string
                          - const: DUAL_TIRE
                            type: string
                          - const: SUPER_SINGLE_WIDE
                            type: string
                      measuredWeightKg:
                        minimum: 0
                        type: number
                      suspensionType:
                        anyOf:
                          - const: MECHANICAL
                            type: string
                          - const: PNEUMATIC
                            type: string
                          - const: HYDRO_PNEUMATIC
                            type: string
                          - const: UNKNOWN
                            type: string
                      distanceToNextAxleM:
                        minimum: 0
                        type: number
            example:
              axles: *a3
      parameters: []
  /api/v1/vehicle-compliance/dimensions/validate:
    post:
      summary: Valida limites máximos de comprimento, largura e altura conforme
        tipologia do veículo
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - configurationCode
                - dimensions
              properties:
                configurationCode:
                  anyOf:
                    - const: RIGID_2_AXLES
                      type: string
                    - const: RIGID_3_AXLES
                      type: string
                    - const: RIGID_4_AXLES
                      type: string
                    - const: ARTICULATED_SEMITRAILER_4_AXLES
                      type: string
                    - const: ARTICULATED_SEMITRAILER_5_AXLES
                      type: string
                    - const: ARTICULATED_SEMITRAILER_6_AXLES
                      type: string
                    - const: ARTICULATED_SEMITRAILER_7_AXLES
                      type: string
                    - const: ROAD_TRAIN_BITREM_7_AXLES
                      type: string
                    - const: ROAD_TRAIN_BITREM_9_AXLES
                      type: string
                    - const: ROAD_TRAIN_RODOTREM_9_AXLES
                      type: string
                    - const: ROAD_TRAIN_TRITREM
                      type: string
                    - const: CUSTOM
                      type: string
                dimensions:
                  type: object
                  required:
                    - lengthM
                    - widthM
                    - heightM
                  properties:
                    lengthM:
                      minimum: 1
                      maximum: 50
                      type: number
                    widthM:
                      minimum: 1
                      maximum: 10
                      type: number
                    heightM:
                      minimum: 1
                      maximum: 10
                      type: number
                    frontOverhangM:
                      minimum: 0
                      type: number
                    rearOverhangM:
                      minimum: 0
                      type: number
                cargo:
                  type: object
                  required:
                    - type
                    - weightKg
                    - indivisible
                  properties:
                    type:
                      anyOf:
                        - const: GENERAL_DRY_CARGO
                          type: string
                        - const: BULK_SOLID
                          type: string
                        - const: BULK_LIQUID
                          type: string
                        - const: REFRIGERATED
                          type: string
                        - const: CONTAINER
                          type: string
                        - const: INDIVISIBLE_ABNORMAL
                          type: string
                        - const: VEHICLE_CARRIER_CEGONHA
                          type: string
                        - const: FORESTRY
                          type: string
                        - const: SUGARCANE
                          type: string
                        - const: DANGEROUS_GOODS
                          type: string
                    weightKg:
                      minimum: 0
                      type: number
                    indivisible:
                      type: boolean
                    description:
                      type: string
                    overhangFrontM:
                      minimum: 0
                      type: number
                    overhangRearM:
                      minimum: 0
                      type: number
                    overhangSidesM:
                      minimum: 0
                      type: number
            example:
              configurationCode: RIGID_2_AXLES
              dimensions: *a4
      parameters: []
  /api/v1/vehicle-compliance/aet/precheck:
    post:
      summary: Diagnóstico regulatório preventivo de necessidade de AET perante DNIT/DER
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - vehicle
              properties:
                vehicle:
                  type: object
                  required:
                    - configurationCode
                    - dimensions
                    - grossWeightKg
                    - propulsion
                    - axles
                  properties:
                    configurationCode:
                      anyOf:
                        - const: RIGID_2_AXLES
                          type: string
                        - const: RIGID_3_AXLES
                          type: string
                        - const: RIGID_4_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_4_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_5_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_6_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_7_AXLES
                          type: string
                        - const: ROAD_TRAIN_BITREM_7_AXLES
                          type: string
                        - const: ROAD_TRAIN_BITREM_9_AXLES
                          type: string
                        - const: ROAD_TRAIN_RODOTREM_9_AXLES
                          type: string
                        - const: ROAD_TRAIN_TRITREM
                          type: string
                        - const: CUSTOM
                          type: string
                    dimensions:
                      type: object
                      required:
                        - lengthM
                        - widthM
                        - heightM
                      properties:
                        lengthM:
                          minimum: 1
                          maximum: 50
                          type: number
                        widthM:
                          minimum: 1
                          maximum: 10
                          type: number
                        heightM:
                          minimum: 1
                          maximum: 10
                          type: number
                        frontOverhangM:
                          minimum: 0
                          type: number
                        rearOverhangM:
                          minimum: 0
                          type: number
                    grossWeightKg:
                      minimum: 500
                      maximum: 200000
                      type: number
                    tareWeightKg:
                      minimum: 0
                      type: number
                    cmtKg:
                      minimum: 0
                      type: number
                    propulsion:
                      anyOf:
                        - const: DIESEL
                          type: string
                        - const: ELECTRIC
                          type: string
                        - const: HYBRID
                          type: string
                        - const: GAS_NATURAL_COMPRESSED_CNG
                          type: string
                        - const: GAS_NATURAL_LIQUEFIED_LNG
                          type: string
                        - const: BIOMETHANE
                          type: string
                        - const: HYDROGEN_FUEL_CELL
                          type: string
                    axles:
                      type: array
                      items:
                        type: object
                        required:
                          - position
                          - groupType
                          - tireConfiguration
                        properties:
                          position:
                            minimum: 1
                            type: integer
                          groupType:
                            anyOf:
                              - const: SINGLE_STEERING
                                type: string
                              - const: SINGLE_DRIVE
                                type: string
                              - const: TANDEM_DOUBLE
                                type: string
                              - const: TANDEM_TRIPLE
                                type: string
                              - const: TANDEM_QUAD
                                type: string
                              - const: NON_TANDEM_DOUBLE
                                type: string
                              - const: NON_TANDEM_TRIPLE
                                type: string
                              - const: DIRECTIONAL_DOUBLE
                                type: string
                              - const: OTHER
                                type: string
                          tireConfiguration:
                            anyOf:
                              - const: SINGLE_TIRE
                                type: string
                              - const: DUAL_TIRE
                                type: string
                              - const: SUPER_SINGLE_WIDE
                                type: string
                          measuredWeightKg:
                            minimum: 0
                            type: number
                          suspensionType:
                            anyOf:
                              - const: MECHANICAL
                                type: string
                              - const: PNEUMATIC
                                type: string
                              - const: HYDRO_PNEUMATIC
                                type: string
                              - const: UNKNOWN
                                type: string
                          distanceToNextAxleM:
                            minimum: 0
                            type: number
                    plate:
                      type: string
                    stateRegistration:
                      type: string
                cargo:
                  type: object
                  required:
                    - type
                    - weightKg
                    - indivisible
                  properties:
                    type:
                      anyOf:
                        - const: GENERAL_DRY_CARGO
                          type: string
                        - const: BULK_SOLID
                          type: string
                        - const: BULK_LIQUID
                          type: string
                        - const: REFRIGERATED
                          type: string
                        - const: CONTAINER
                          type: string
                        - const: INDIVISIBLE_ABNORMAL
                          type: string
                        - const: VEHICLE_CARRIER_CEGONHA
                          type: string
                        - const: FORESTRY
                          type: string
                        - const: SUGARCANE
                          type: string
                        - const: DANGEROUS_GOODS
                          type: string
                    weightKg:
                      minimum: 0
                      type: number
                    indivisible:
                      type: boolean
                    description:
                      type: string
                    overhangFrontM:
                      minimum: 0
                      type: number
                    overhangRearM:
                      minimum: 0
                      type: number
                    overhangSidesM:
                      minimum: 0
                      type: number
                context:
                  type: object
                  properties:
                    operationDateTime:
                      type: string
                    originState:
                      minLength: 2
                      maxLength: 2
                      type: string
                    destinationState:
                      minLength: 2
                      maxLength: 2
                      type: string
                    routeRoads:
                      type: array
                      items:
                        type: string
                    isSingleLaneRoad:
                      type: boolean
            example:
              vehicle: *a5
      parameters: []
  /api/v1/vehicle-compliance/aet/validate:
    post:
      summary: Consulta e validação de autenticidade de AET (SIAET / DNIT)
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - aetNumber
                - issuerAuthority
              properties:
                aetNumber:
                  minLength: 3
                  type: string
                issuerAuthority:
                  minLength: 2
                  type: string
                vehiclePlate:
                  type: string
            example:
              aetNumber: EXEMPLO-AET-001
              issuerAuthority: DNIT
      parameters: []
  /api/v1/vehicle-compliance/route/precheck:
    post:
      summary: Avalia conformidade veicular na rota e restrições de calendário da PRF
        em pista simples
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - origin
                - destination
                - vehicle
              properties:
                origin:
                  minLength: 2
                  type: string
                destination:
                  minLength: 2
                  type: string
                vehicle:
                  type: object
                  required:
                    - configurationCode
                    - dimensions
                    - grossWeightKg
                    - propulsion
                    - axles
                  properties:
                    configurationCode:
                      anyOf:
                        - const: RIGID_2_AXLES
                          type: string
                        - const: RIGID_3_AXLES
                          type: string
                        - const: RIGID_4_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_4_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_5_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_6_AXLES
                          type: string
                        - const: ARTICULATED_SEMITRAILER_7_AXLES
                          type: string
                        - const: ROAD_TRAIN_BITREM_7_AXLES
                          type: string
                        - const: ROAD_TRAIN_BITREM_9_AXLES
                          type: string
                        - const: ROAD_TRAIN_RODOTREM_9_AXLES
                          type: string
                        - const: ROAD_TRAIN_TRITREM
                          type: string
                        - const: CUSTOM
                          type: string
                    dimensions:
                      type: object
                      required:
                        - lengthM
                        - widthM
                        - heightM
                      properties:
                        lengthM:
                          minimum: 1
                          maximum: 50
                          type: number
                        widthM:
                          minimum: 1
                          maximum: 10
                          type: number
                        heightM:
                          minimum: 1
                          maximum: 10
                          type: number
                        frontOverhangM:
                          minimum: 0
                          type: number
                        rearOverhangM:
                          minimum: 0
                          type: number
                    grossWeightKg:
                      minimum: 500
                      maximum: 200000
                      type: number
                    tareWeightKg:
                      minimum: 0
                      type: number
                    cmtKg:
                      minimum: 0
                      type: number
                    propulsion:
                      anyOf:
                        - const: DIESEL
                          type: string
                        - const: ELECTRIC
                          type: string
                        - const: HYBRID
                          type: string
                        - const: GAS_NATURAL_COMPRESSED_CNG
                          type: string
                        - const: GAS_NATURAL_LIQUEFIED_LNG
                          type: string
                        - const: BIOMETHANE
                          type: string
                        - const: HYDROGEN_FUEL_CELL
                          type: string
                    axles:
                      type: array
                      items:
                        type: object
                        required:
                          - position
                          - groupType
                          - tireConfiguration
                        properties:
                          position:
                            minimum: 1
                            type: integer
                          groupType:
                            anyOf:
                              - const: SINGLE_STEERING
                                type: string
                              - const: SINGLE_DRIVE
                                type: string
                              - const: TANDEM_DOUBLE
                                type: string
                              - const: TANDEM_TRIPLE
                                type: string
                              - const: TANDEM_QUAD
                                type: string
                              - const: NON_TANDEM_DOUBLE
                                type: string
                              - const: NON_TANDEM_TRIPLE
                                type: string
                              - const: DIRECTIONAL_DOUBLE
                                type: string
                              - const: OTHER
                                type: string
                          tireConfiguration:
                            anyOf:
                              - const: SINGLE_TIRE
                                type: string
                              - const: DUAL_TIRE
                                type: string
                              - const: SUPER_SINGLE_WIDE
                                type: string
                          measuredWeightKg:
                            minimum: 0
                            type: number
                          suspensionType:
                            anyOf:
                              - const: MECHANICAL
                                type: string
                              - const: PNEUMATIC
                                type: string
                              - const: HYDRO_PNEUMATIC
                                type: string
                              - const: UNKNOWN
                                type: string
                          distanceToNextAxleM:
                            minimum: 0
                            type: number
                    plate:
                      type: string
                    stateRegistration:
                      type: string
                cargo:
                  type: object
                  required:
                    - type
                    - weightKg
                    - indivisible
                  properties:
                    type:
                      anyOf:
                        - const: GENERAL_DRY_CARGO
                          type: string
                        - const: BULK_SOLID
                          type: string
                        - const: BULK_LIQUID
                          type: string
                        - const: REFRIGERATED
                          type: string
                        - const: CONTAINER
                          type: string
                        - const: INDIVISIBLE_ABNORMAL
                          type: string
                        - const: VEHICLE_CARRIER_CEGONHA
                          type: string
                        - const: FORESTRY
                          type: string
                        - const: SUGARCANE
                          type: string
                        - const: DANGEROUS_GOODS
                          type: string
                    weightKg:
                      minimum: 0
                      type: number
                    indivisible:
                      type: boolean
                    description:
                      type: string
                    overhangFrontM:
                      minimum: 0
                      type: number
                    overhangRearM:
                      minimum: 0
                      type: number
                    overhangSidesM:
                      minimum: 0
                      type: number
                context:
                  type: object
                  properties:
                    operationDateTime:
                      type: string
                    originState:
                      minLength: 2
                      maxLength: 2
                      type: string
                    destinationState:
                      minLength: 2
                      maxLength: 2
                      type: string
                    routeRoads:
                      type: array
                      items:
                        type: string
                    isSingleLaneRoad:
                      type: boolean
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              vehicle: *a5
      parameters: []
  /api/v1/vehicle-compliance/traffic-restrictions:
    get:
      summary: Lista restrições sazonais e de feriados da PRF para veículos com AET e
        CVCs
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
        - in: query
          name: toDate
          required: false
          schema:
            type: string
        - in: query
          name: state
          required: false
          schema:
            type: string
  /api/v1/vehicle-compliance/rules:
    get:
      summary: Lista base regulatória ativa (CONTRAN 882, CONTRAN 1015, DNIT 11/2022,
        DNIT 01/2026)
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/vehicle-compliance/history:
    get:
      summary: Histórico auditável de conformidade veicular do tenant
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/dfe/validate:
    post:
      summary: Validação técnica, integridade XML, schema, chave e assinatura de
        documento DFe
      tags:
        - DFe Transport Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - xmlString
              properties:
                xmlString:
                  minLength: 10
                  type: string
                storagePath:
                  type: string
            example:
              xmlString: <CTe xmlns="http://www.portalfiscal.inf.br/cte"><infCte versao="4.00"
                Id="CTe00000000000000000000000000000000000000000000"><ide><mod>57</mod><tpAmb>2</tpAmb></ide></infCte></CTe>
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/dfe/cte/validate:
    post:
      summary: Validação e extração canônica estruturada de Conhecimento de Transporte
        (CT-e 4.00)
      tags:
        - DFe Transport Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - xmlString
              properties:
                xmlString:
                  minLength: 10
                  type: string
            example:
              xmlString: <CTe xmlns="http://www.portalfiscal.inf.br/cte"><infCte versao="4.00"
                Id="CTe00000000000000000000000000000000000000000000"><ide><mod>57</mod><tpAmb>2</tpAmb></ide></infCte></CTe>
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/dfe/mdfe/validate:
    post:
      summary: Validação e extração canônica de Manifesto Eletrônico de Documentos
        Fiscais (MDF-e 3.00b)
      tags:
        - DFe Transport Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - xmlString
              properties:
                xmlString:
                  minLength: 10
                  type: string
            example:
              xmlString: <MDFe xmlns="http://www.portalfiscal.inf.br/mdfe"><infMDFe
                versao="3.00"
                Id="MDFe00000000000000000000000000000000000000000000"><ide><mod>58</mod><tpAmb>2</tpAmb></ide></infMDFe></MDFe>
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/dfe/reconcile:
    post:
      summary: Reconciliação documental CT-e/MDF-e; verificações regulatórias externas
        não executadas
      tags:
        - DFe Transport Compliance
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cteXml
                - mdfeXml
              properties:
                cteXml:
                  minLength: 10
                  type: string
                mdfeXml:
                  minLength: 10
                  type: string
                operationId:
                  type: string
            example:
              cteXml: <CTe xmlns="http://www.portalfiscal.inf.br/cte"><infCte versao="4.00"
                Id="CTe00000000000000000000000000000000000000000000"><ide><mod>57</mod><tpAmb>2</tpAmb></ide></infCte></CTe>
              mdfeXml: <MDFe xmlns="http://www.portalfiscal.inf.br/mdfe"><infMDFe
                versao="3.00"
                Id="MDFe00000000000000000000000000000000000000000000"><ide><mod>58</mod><tpAmb>2</tpAmb></ide></infMDFe></MDFe>
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - cteCount
                      - mdfeCount
                      - status
                      - relationships
                      - crossChecks
                      - warnings
                      - memorial
                    properties:
                      operationId:
                        type: string
                      cteCount:
                        type: integer
                      mdfeCount:
                        type: integer
                      status:
                        description: Resultado documental apenas; MATCHED não aprova verificações
                          regulatórias externas.
                        anyOf:
                          - const: MATCHED
                            type: string
                          - const: DISCREPANCIES_FOUND
                            type: string
                          - const: INCOMPLETE_DATA
                            type: string
                      relationships:
                        type: array
                        items:
                          type: object
                          required:
                            - mdfeKey
                            - cteKey
                            - isReferencedInMdfe
                            - emitenteMatch
                            - weightConsistent
                            - routeConsistent
                            - routeCheckStatus
                            - issues
                          properties:
                            mdfeKey:
                              type: string
                            cteKey:
                              type: string
                            isReferencedInMdfe:
                              type: boolean
                            emitenteMatch:
                              type: boolean
                            weightConsistent:
                              type: boolean
                            routeConsistent:
                              description: False enquanto a rota não foi verificada; consultar
                                routeCheckStatus.
                              type: boolean
                            routeCheckStatus:
                              anyOf:
                                - const: VALID
                                  type: string
                                - const: INVALID
                                  type: string
                                - const: WARNING
                                  type: string
                                - const: NOT_APPLICABLE
                                  type: string
                                - const: NOT_VERIFIED
                                  type: string
                            issues:
                              type: array
                              items:
                                type: string
                      crossChecks:
                        type: object
                        required:
                          - rntrcStatus
                          - freightFloorStatus
                          - tollVpoStatus
                          - routeFeasibilityStatus
                          - vehicleAetStatus
                        properties:
                          rntrcStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          freightFloorStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          tollVpoStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          routeFeasibilityStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          vehicleAetStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                      warnings:
                        type: array
                        items:
                          type: string
                      memorial:
                        type: array
                        items:
                          type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/dfe/status:
    post:
      summary: Consulta de status de autorização na SEFAZ (retorna padrão seguro
        UNAVAILABLE)
      tags:
        - DFe Transport Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - accessKey
              properties:
                accessKey:
                  minLength: 44
                  maxLength: 44
                  type: string
            example:
              accessKey: "00000000000000000000000000000000000000000000"
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/dfe/schemas:
    get:
      summary: Lista pacotes de schemas e versões oficiais suportadas (CT-e 4.00,
        MDF-e 3.00b)
      tags:
        - DFe Transport Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/dfe/history:
    get:
      summary: Histórico auditável de documentos fiscais processados pelo tenant
      tags:
        - DFe Transport Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/tric/precheck:
    post:
      summary: Avaliação de conformidade para transporte internacional rodoviário
        (ATIT / Mercosul)
      tags:
        - TRIC International Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - destinationCountry
                - carrierCountry
                - hasOriginLicense
                - hasComplementaryLicense
                - hasRcTricInsurance
                - hasMercosulTechnicalInspection
                - isDriverEarValid
              properties:
                destinationCountry:
                  anyOf:
                    - const: AR
                      type: string
                    - const: BO
                      type: string
                    - const: CL
                      type: string
                    - const: PY
                      type: string
                    - const: PE
                      type: string
                    - const: UY
                      type: string
                carrierCountry:
                  anyOf:
                    - const: BR
                      type: string
                    - anyOf:
                        - const: AR
                          type: string
                        - const: BO
                          type: string
                        - const: CL
                          type: string
                        - const: PY
                          type: string
                        - const: PE
                          type: string
                        - const: UY
                          type: string
                carrierRntrc:
                  type: string
                hasOriginLicense:
                  type: boolean
                hasComplementaryLicense:
                  type: boolean
                hasRcTricInsurance:
                  type: boolean
                hasMercosulTechnicalInspection:
                  type: boolean
                isDriverEarValid:
                  type: boolean
                isDangerousGoods:
                  type: boolean
                operationType:
                  anyOf:
                    - const: LICENCA_ORIGINARIA
                      type: string
                    - const: LICENCA_COMPLEMENTAR
                      type: string
                    - const: AUTORIZACAO_TRANSITO
                      type: string
                    - const: VIAGEM_OCASIONAL
                      type: string
                    - const: CARGA_PROPRIA_INTERNACIONAL
                      type: string
            example:
              destinationCountry: AR
              carrierCountry: BR
              hasOriginLicense: false
              hasComplementaryLicense: false
              hasRcTricInsurance: false
              hasMercosulTechnicalInspection: false
              isDriverEarValid: false
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: tric-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/tric/border-posts:
    get:
      summary: Lista pontos de fronteira, postos aduaneiros e permissões de carga
        perigosa
      tags:
        - TRIC International Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: tric-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: country
          required: false
          schema:
            anyOf:
              - const: AR
                type: string
              - const: BO
                type: string
              - const: CL
                type: string
              - const: PY
                type: string
              - const: PE
                type: string
              - const: UY
                type: string
  /api/v1/tric/country-rules:
    get:
      summary: Consulta acordos bilaterais e requisitos aduaneiros por país do Mercosul
      tags:
        - TRIC International Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: tric-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: country
          required: true
          schema:
            anyOf:
              - const: AR
                type: string
              - const: BO
                type: string
              - const: CL
                type: string
              - const: PY
                type: string
              - const: PE
                type: string
              - const: UY
                type: string
          example: AR
  /api/v1/tric/history:
    get:
      summary: Histórico auditável de pré-checagens de transporte internacional do
        tenant
      tags:
        - TRIC International Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data: {}
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
      x-module-id: tric-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /:
    get:
      summary: Apresenta a API e seus caminhos públicos básicos.
      tags:
        - Health
      description: Endpoint público, sem autenticação, para descoberta da API Geodagio.
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - name
                      - status
                      - apiBasePath
                      - health
                    properties:
                      name:
                        type: string
                        enum:
                          - Geodagio API
                      status:
                        type: string
                        enum:
                          - ok
                      apiBasePath:
                        type: string
                        enum:
                          - /api/v1
                      health:
                        additionalProperties: false
                        type: object
                        required:
                          - liveness
                          - readiness
                        properties:
                          liveness:
                            type: string
                            enum:
                              - /health/live
                          readiness:
                            type: string
                            enum:
                              - /health/ready
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
              example:
                data:
                  name: Geodagio API
                  status: ok
                  apiBasePath: /api/v1
                  health:
                    liveness: /health/live
                    readiness: /health/ready
                meta:
                  requestId: req_12345678
                  apiVersion: v1
  /health/live:
    get:
      summary: Liveness do processo.
      tags:
        - Health
      responses:
        "200":
          description: Default Response
  /health/ready:
    get:
      summary: Readiness de banco e infraestrutura crítica.
      tags:
        - Health
      responses:
        "200":
          description: Default Response
  /api/v1/public/apis/summary:
    get:
      summary: Resumo público do catálogo, com contagem de módulos e de APIs
        contratáveis.
      tags:
        - Health
      description: Use activeProductCount em textos comerciais; activeCount inclui
        orquestração. systemStatus deriva de verificações reais de dependências
        essenciais, não da contagem de APIs pausadas. health explicita escopo,
        horário, ausência de medição e restrições. Não comprova execução
        individual de cada API nem SLA histórico.
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-98"
  /api/v1/public/status:
    get:
      summary: Estado observado das dependências essenciais e catálogo ativo.
      tags:
        - Health
      description: "Compartilha a avaliação do resumo público. Pausas administrativas
        não representam incidente. Métricas históricas e latência individual sem
        medição são null; módulos sem sondagem individual ficam UNKNOWN.
        Consumidores devem tratar null como ausência de evidência, nunca zero ou
        100%. health.scope delimita o alcance: configuração presente de provider
        não comprova transação real. Não informa SLA ou histórico fabricado."
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-99"
  /api/v1/public/auth-providers:
    get:
      summary: Lista os provedores de login social habilitados.
      tags:
        - Authentication
      description: "Resposta sem cache (Cache-Control: no-store). Sem configuração
        válida, ambos ficam desativados. Clientes devem ocultar os botões até
        receber true explícito."
      security: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - google
                      - microsoft
                    properties:
                      google:
                        description: Exibir Google somente quando true; padrão false sem configuração
                          válida
                        default: false
                        type: boolean
                      microsoft:
                        description: Exibir Microsoft somente quando true; padrão false sem configuração
                          válida
                        default: false
                        type: boolean
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
  /api/v1/admin/auth/providers:
    get:
      summary: Consulta a configuração de login social.
      tags:
        - Authentication Admin
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - google
                      - microsoft
                      - updatedAt
                      - updatedBy
                    properties:
                      google:
                        description: Login com Google ativo/inativo
                        type: boolean
                      microsoft:
                        description: Login com Microsoft ativo/inativo
                        type: boolean
                      updatedAt:
                        description: Data/hora ISO da ultima atualizacao
                        type: string
                      updatedBy:
                        description: Identificador do usuario administrador que atualizou
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
    put:
      summary: Habilita ou desabilita Google e Microsoft independentemente.
      tags:
        - Authentication Admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - google
                - microsoft
              properties:
                google:
                  description: Habilitar ou desabilitar login com Google
                  type: boolean
                microsoft:
                  description: Habilitar ou desabilitar login com Microsoft
                  type: boolean
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - google
                      - microsoft
                      - updatedAt
                      - updatedBy
                    properties:
                      google:
                        description: Login com Google ativo/inativo
                        type: boolean
                      microsoft:
                        description: Login com Microsoft ativo/inativo
                        type: boolean
                      updatedAt:
                        description: Data/hora ISO da ultima atualizacao
                        type: string
                      updatedBy:
                        description: Identificador do usuario administrador que atualizou
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        type: string
                        enum:
                          - v1
        "400":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "401":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
        "403":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-2"
  /api/v1/public/trip-cost/estimate:
    post:
      summary: Simulação pública de custo total de viagem rodoviária (Pedágios
        oficiais + Diesel ANP)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - route
                      - tolls
                      - fuel
                      - summary
                    properties:
                      route:
                        type: object
                        required:
                          - origin
                          - destination
                          - distanceKm
                          - durationHours
                          - durationFormatted
                        properties:
                          origin:
                            type: string
                          destination:
                            type: string
                          distanceKm:
                            type: number
                          durationHours:
                            type: number
                          durationFormatted:
                            type: string
                      tolls:
                        type: object
                        required:
                          - total
                          - formattedTotal
                          - plazaCount
                          - freeFlowCount
                          - coverageStatus
                          - hasAuxiliaryEstimate
                        properties:
                          total:
                            anyOf:
                              - type: string
                              - type: "null"
                          formattedTotal:
                            type: string
                          plazaCount:
                            minimum: 0
                            type: integer
                          freeFlowCount:
                            minimum: 0
                            type: integer
                          coverageStatus:
                            type: string
                          hasAuxiliaryEstimate:
                            type: boolean
                      fuel:
                        type: object
                        required:
                          - product
                          - averagePricePerLiter
                          - formattedAveragePrice
                          - estimatedLiters
                          - totalCost
                          - formattedTotalCost
                          - competence
                        properties:
                          product:
                            type: string
                          averagePricePerLiter:
                            type: string
                          formattedAveragePrice:
                            type: string
                          estimatedLiters:
                            type: number
                          totalCost:
                            type: string
                          formattedTotalCost:
                            type: string
                          competence:
                            type: string
                      summary:
                        type: object
                        required:
                          - totalTripCost
                          - formattedTotalTripCost
                          - costPerKm
                          - formattedCostPerKm
                        properties:
                          totalTripCost:
                            type: string
                          formattedTotalTripCost:
                            type: string
                          costPerKm:
                            type: string
                          formattedCostPerKm:
                            type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "429":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Public Tools & Simulators
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - origin
                - destination
                - axles
                - consumptionKmPerLiter
              properties:
                origin:
                  minLength: 2
                  maxLength: 200
                  type: string
                destination:
                  minLength: 2
                  maxLength: 200
                  type: string
                axles:
                  minimum: 2
                  maximum: 9
                  type: integer
                consumptionKmPerLiter:
                  minimum: 0.5
                  maximum: 20
                  type: number
                fuelType:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              axles: 2
              consumptionKmPerLiter: 0.5
      parameters: []
      description: "Respostas sem cache compartilhado (Cache-Control: private,
        no-store, max-age=0), inclusive erros. Limite diário gratuito por
        ferramenta e IP; HTTP 429 ao esgotar. O armazenamento da quota é local
        ao processo, não uma garantia global entre réplicas ou reinícios."
  /api/v1/public/freight-floor/calculate:
    post:
      summary: Calculadora pública e gratuita de piso mínimo de frete ANTT (Sem
        necessidade de autenticação)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - status
                  - currency
                  - floorPrice
                  - floorPriceFormatted
                  - costPerKm
                  - distanceKm
                  - cargoType
                  - cargoTypeLabel
                  - axleCount
                  - coefficients
                  - legalNotice
                  - meta
                properties:
                  status:
                    const: OK
                    type: string
                  currency:
                    const: BRL
                    type: string
                  floorPrice:
                    type: string
                  floorPriceFormatted:
                    type: string
                  costPerKm:
                    type: string
                  distanceKm:
                    type: number
                  cargoType:
                    type: string
                  cargoTypeLabel:
                    type: string
                  axleCount:
                    type: integer
                  coefficients:
                    type: object
                    required:
                      - ccd
                      - cc
                      - tableCode
                      - tableTitle
                      - resolution
                    properties:
                      ccd:
                        description: Coeficiente oficial vigente obtido da base homologada. Sem base
                          válida, a resposta é 503 ANTT_BASE_UNAVAILABLE.
                        type: string
                      cc:
                        description: Custo de carga e descarga da mesma base homologada; não há
                          coeficiente substituto estimado.
                        type: string
                      tableCode:
                        type: string
                      tableTitle:
                        type: string
                      resolution:
                        type: string
                  legalNotice:
                    type: object
                    required:
                      - law
                      - ciotRequired
                      - penaltyNotice
                    properties:
                      law:
                        type: string
                      ciotRequired:
                        type: boolean
                      penaltyNotice:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "429":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "503":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Piso Mínimo ANTT
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - cargoType
                - axleCount
                - distanceKm
              properties:
                cargoType:
                  anyOf:
                    - const: GRANEL_SOLIDO
                      type: string
                    - const: GRANEL_LIQUIDO
                      type: string
                    - const: FRIGORIFICADA_OU_AQUECIDA
                      type: string
                    - const: CONTEINERIZADA
                      type: string
                    - const: CARGA_GERAL
                      type: string
                    - const: NEOGRANEL
                      type: string
                    - const: PERIGOSA_GRANEL_SOLIDO
                      type: string
                    - const: PERIGOSA_GRANEL_LIQUIDO
                      type: string
                    - const: PERIGOSA_FRIGORIFICADA_AQUECIDA
                      type: string
                    - const: PERIGOSA_CONTEINERIZADA
                      type: string
                    - const: PERIGOSA_CARGA_GERAL
                      type: string
                    - const: GRANEL_PRESSURIZADA
                      type: string
                axleCount:
                  minimum: 2
                  maximum: 9
                  type: integer
                distanceKm:
                  minimum: 1
                  maximum: 20000
                  type: number
                hasReturnLoad:
                  type: boolean
            example:
              cargoType: GRANEL_SOLIDO
              axleCount: 2
              distanceKm: 1
      parameters: []
      description: "Respostas sem cache compartilhado (Cache-Control: private,
        no-store, max-age=0), inclusive erros. Limite diário gratuito por
        ferramenta e IP; HTTP 429 ao esgotar. O armazenamento da quota é local
        ao processo, não uma garantia global entre réplicas ou reinícios."
  /api/v1/imports/{id}/cancel:
    post:
      summary: POST /api/v1/imports/{id}/cancel
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - jobType
                      - status
                      - totalRows
                      - processedRows
                      - okRows
                      - reviewRows
                      - failedRows
                      - startedAt
                      - finishedAt
                      - errorCode
                      - attemptCount
                    properties:
                      id:
                        format: uuid
                        type: string
                      jobType:
                        anyOf:
                          - const: ROUTE_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_CALCULATION
                            type: string
                          - const: FREIGHT_FLOOR_PRECIOT_VALIDATION
                            type: string
                      status:
                        anyOf:
                          - const: UPLOADED
                            type: string
                          - const: VALIDATING
                            type: string
                          - const: QUEUED
                            type: string
                          - const: PROCESSING
                            type: string
                          - const: COMPLETED
                            type: string
                          - const: COMPLETED_WITH_REVIEW
                            type: string
                          - const: REJECTED
                            type: string
                          - const: FAILED
                            type: string
                      totalRows:
                        minimum: 0
                        type: integer
                      processedRows:
                        minimum: 0
                        type: integer
                      okRows:
                        minimum: 0
                        type: integer
                      reviewRows:
                        minimum: 0
                        type: integer
                      failedRows:
                        minimum: 0
                        type: integer
                      startedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      finishedAt:
                        anyOf:
                          - format: date-time
                            type: string
                          - type: "null"
                      errorCode:
                        anyOf:
                          - minLength: 1
                            maxLength: 80
                            type: string
                          - type: "null"
                      attemptCount:
                        minimum: 0
                        type: integer
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      reused:
                        type: boolean
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "409":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/public/rntrc/lookup:
    get:
      summary: Consulta pública e gratuita de RNTRC na base da ANTT (Limite de 5
        consultas diárias por IP)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - transporter
                      - remainingDailyQueries
                      - dailyLimit
                    properties:
                      transporter:
                        type: object
                        required:
                          - rntrc
                          - legalName
                          - category
                          - categoryLabel
                          - status
                          - statusLabel
                          - isValid
                          - maskedDocument
                          - city
                          - state
                          - firstRegistrationDate
                          - statusDate
                          - isEquiparado
                          - asOfDate
                        properties:
                          rntrc:
                            type: string
                          legalName:
                            type: string
                          category:
                            type: string
                          categoryLabel:
                            type: string
                          status:
                            type: string
                          statusLabel:
                            type: string
                          isValid:
                            type: boolean
                          maskedDocument:
                            type: string
                          city:
                            anyOf:
                              - type: string
                              - type: "null"
                          state:
                            anyOf:
                              - type: string
                              - type: "null"
                          firstRegistrationDate:
                            anyOf:
                              - type: string
                              - type: "null"
                          statusDate:
                            anyOf:
                              - type: string
                              - type: "null"
                          isEquiparado:
                            type: boolean
                          asOfDate:
                            type: string
                      remainingDailyQueries:
                        minimum: 0
                        type: integer
                      dailyLimit:
                        minimum: 1
                        type: integer
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 400
                    type: number
                  detail:
                    type: string
                  code:
                    const: INVALID_INPUT
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 404
                    type: number
                  detail:
                    type: string
                  code:
                    const: RNTRC_NOT_FOUND
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "422":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 422
                    type: number
                  detail:
                    type: string
                  code:
                    const: INVALID_DOCUMENT
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "429":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 429
                    type: number
                  detail:
                    type: string
                  code:
                    const: DAILY_LIMIT_EXCEEDED
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "503":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 503
                    type: number
                  detail:
                    type: string
                  code:
                    const: RNTRC_BASE_UNAVAILABLE
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
      tags:
        - RNTRC & Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: query
          name: rntrc
          required: false
          schema:
            minLength: 5
            maxLength: 12
            type: string
        - in: query
          name: document
          required: false
          schema:
            minLength: 11
            maxLength: 18
            type: string
      description: "Respostas sem cache compartilhado (Cache-Control: private,
        no-store, max-age=0), inclusive erros. Limite diário gratuito por
        ferramenta e IP; HTTP 429 ao esgotar. O armazenamento da quota é local
        ao processo, não uma garantia global entre réplicas ou reinícios."
  /api/v1/rntrc/transporters/batch:
    post:
      summary: POST /api/v1/rntrc/transporters/batch
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - items
              properties:
                items:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    properties:
                      rntrc:
                        minLength: 5
                        maxLength: 12
                        type: string
                      document:
                        minLength: 11
                        maxLength: 18
                        type: string
            example:
              items:
                - rntrc: "12345678"
      parameters: []
  /api/v1/rntrc/watch:
    get:
      summary: GET /api/v1/rntrc/watch
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
    post:
      summary: POST /api/v1/rntrc/watch
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - rntrc
              properties:
                rntrc:
                  minLength: 5
                  maxLength: 12
                  type: string
                label:
                  maxLength: 100
                  type: string
            example:
              rntrc: "12345678"
      parameters: []
  /api/v1/rntrc/watch/{id}:
    delete:
      summary: DELETE /api/v1/rntrc/watch/{id}
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/rntrc/watch/events:
    get:
      summary: GET /api/v1/rntrc/watch/events
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: rntrc-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/rntrc/sources:
    get:
      summary: GET /api/v1/admin/rntrc/sources
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/rntrc/publish/{id}:
    post:
      summary: POST /api/v1/admin/rntrc/publish/{id}
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/fuel/prices/lookup:
    post:
      summary: Consulta estruturada de preços ANP com suporte a filtros de município/UF
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Prices
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - product
              properties:
                product:
                  anyOf:
                    - const: DIESEL_S10
                      type: string
                    - const: DIESEL_S500
                      type: string
                    - const: GASOLINA_COMUM
                      type: string
                    - const: GASOLINA_ADITIVADA
                      type: string
                    - const: ETANOL
                      type: string
                    - const: GNV
                      type: string
                granularity:
                  anyOf:
                    - const: BRASIL
                      type: string
                    - const: REGIAO
                      type: string
                    - const: UF
                      type: string
                    - const: MUNICIPIO
                      type: string
                geographicKey:
                  minLength: 1
                  maxLength: 80
                  type: string
                state:
                  minLength: 2
                  maxLength: 2
                  type: string
                municipality:
                  minLength: 2
                  maxLength: 100
                  type: string
            example:
              product: DIESEL_S10
              granularity: UF
              geographicKey: SP
      parameters: []
  /api/v1/fuel/prices/history:
    get:
      summary: Consulta a série histórica agregada da ANP por geografia
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Prices
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: product
          required: true
          schema:
            anyOf:
              - const: DIESEL_S10
                type: string
              - const: DIESEL_S500
                type: string
              - const: GASOLINA_COMUM
                type: string
              - const: GASOLINA_ADITIVADA
                type: string
              - const: ETANOL
                type: string
              - const: GNV
                type: string
          example: DIESEL_S10
        - in: query
          name: granularity
          required: true
          schema:
            anyOf:
              - const: BRASIL
                type: string
              - const: REGIAO
                type: string
              - const: UF
                type: string
              - const: MUNICIPIO
                type: string
          example: UF
        - in: query
          name: geographicKey
          required: true
          schema:
            minLength: 1
            maxLength: 80
            type: string
          example: SP
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: integer
  /api/v1/fuel/stations:
    get:
      summary: Busca postos revendedores autorizados por UF, município ou CNPJ
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Stations
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: cnpj
          required: false
          schema:
            minLength: 14
            maxLength: 18
            type: string
        - in: query
          name: state
          required: false
          schema:
            minLength: 2
            maxLength: 2
            type: string
        - in: query
          name: municipality
          required: false
          schema:
            minLength: 2
            maxLength: 100
            type: string
        - in: query
          name: product
          required: false
          schema:
            anyOf:
              - const: DIESEL_S10
                type: string
              - const: DIESEL_S500
                type: string
              - const: GASOLINA_COMUM
                type: string
              - const: GASOLINA_ADITIVADA
                type: string
              - const: ETANOL
                type: string
              - const: GNV
                type: string
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: integer
  /api/v1/fuel/batch:
    post:
      summary: Cálculo de estimativa de combustível em lote (máximo 100 itens)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Route Cost
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    type: object
                    required:
                      - origin
                      - destination
                      - product
                    properties:
                      origin:
                        minLength: 3
                        maxLength: 120
                        type: string
                      destination:
                        minLength: 3
                        maxLength: 120
                        type: string
                      product:
                        anyOf:
                          - const: DIESEL_S10
                            type: string
                          - const: DIESEL_S500
                            type: string
                          - const: GASOLINA_COMUM
                            type: string
                          - const: GASOLINA_ADITIVADA
                            type: string
                          - const: ETANOL
                            type: string
                          - const: GNV
                            type: string
                      kmPerLiter:
                        minimum: 0.1
                        maximum: 50
                        type: number
            example:
              items:
                - origin: São Paulo, SP
                  destination: Curitiba, PR
                  product: DIESEL_S10
                  kmPerLiter: 2.8
      parameters: []
  /api/v1/fuel/watch/{id}:
    delete:
      summary: Remove um alvo do monitoramento de combustível
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/fuel/watch/events:
    get:
      summary: Lista eventos e notificações de alteração de preços do tenant
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: fuel-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/fuel/sources:
    get:
      summary: Lista versões de datasets da ANP em staging e produção (Exclusivo
        Plataforma)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/fuel/publish/{id}:
    post:
      summary: Homologa e publica um dataset ANP de staging para produção (Exclusivo
        Plataforma)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Fuel Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/admin/stops/sources:
    get:
      summary: Lista fontes e versões dos datasets oficiais de PPD para platform admin
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Stops Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/stops/publish/{id}:
    post:
      summary: Publica e promove versão de dataset oficial de PPD após homologação
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Stops Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/emissions/methodologies:
    get:
      summary: Lista metodologias suportadas (PBGHG, IPCC 2006, GHG Protocol Scope 3)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
  /api/v1/emissions/batch:
    post:
      summary: Processa lote síncrono de abastecimentos para cálculo de emissões (máx
        50)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Emissions & Carbon
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: emissions-intelligence
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    required:
                      - rowNumber
                      - fuelType
                      - liters
                    properties:
                      rowNumber:
                        minimum: 1
                        type: integer
                      fuelType:
                        type: string
                      liters:
                        minimum: 0.1
                        type: number
                      periodDate:
                        type: string
            example:
              items:
                - rowNumber: 1
                  fuelType: DIESEL_S10
                  liters: 100
      parameters: []
  /api/v1/admin/emissions/factor-sets:
    get:
      summary: Lista todos os factor sets cadastrados no banco para platform admin
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Emissions Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/emissions/factor-sets/{id}/publish:
    post:
      summary: Publica e promove factor set de emissões após homologação
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Emissions Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/vehicle-compliance/batch:
    post:
      summary: Processa lote de validações de veículos (máx 50 itens)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Vehicle & Load Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    required:
                      - rowNumber
                      - configurationCode
                      - grossWeightKg
                      - lengthM
                      - widthM
                      - heightM
                    properties:
                      rowNumber:
                        minimum: 1
                        type: integer
                      configurationCode:
                        type: string
                      grossWeightKg:
                        minimum: 500
                        type: number
                      lengthM:
                        minimum: 1
                        type: number
                      widthM:
                        minimum: 1
                        type: number
                      heightM:
                        minimum: 1
                        type: number
                      propulsion:
                        type: string
            example:
              items:
                - rowNumber: 1
                  configurationCode: RIGID_2_AXLES
                  grossWeightKg: 15000
                  lengthM: 8
                  widthM: 2.6
                  heightM: 4
                  propulsion: DIESEL
      parameters: []
  /api/v1/vehicle-compliance/watch:
    get:
      summary: Lista alvos de monitoramento de resoluções e restrições do tenant
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Vehicle Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
    post:
      summary: Adiciona novo alvo de monitoramento regulatório
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Vehicle Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: vehicle-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - regulationType
                - authority
                - label
              properties:
                regulationType:
                  type: string
                authority:
                  type: string
                label:
                  type: string
            example:
              regulationType: DIMENSIONS
              authority: CONTRAN
              label: Limites dimensionais
      parameters: []
  /api/v1/admin/vehicle-compliance/rules:
    get:
      summary: Lista todas as versões de resoluções cadastradas na plataforma
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Vehicle Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/dfe/relationships/validate:
    post:
      summary: Valida se CT-e está corretamente vinculado e listado na carga do MDF-e
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - cteCount
                      - mdfeCount
                      - status
                      - relationships
                      - crossChecks
                      - warnings
                      - memorial
                    properties:
                      operationId:
                        type: string
                      cteCount:
                        type: integer
                      mdfeCount:
                        type: integer
                      status:
                        description: Resultado documental apenas; MATCHED não aprova verificações
                          regulatórias externas.
                        anyOf:
                          - const: MATCHED
                            type: string
                          - const: DISCREPANCIES_FOUND
                            type: string
                          - const: INCOMPLETE_DATA
                            type: string
                      relationships:
                        type: array
                        items:
                          type: object
                          required:
                            - mdfeKey
                            - cteKey
                            - isReferencedInMdfe
                            - emitenteMatch
                            - weightConsistent
                            - routeConsistent
                            - routeCheckStatus
                            - issues
                          properties:
                            mdfeKey:
                              type: string
                            cteKey:
                              type: string
                            isReferencedInMdfe:
                              type: boolean
                            emitenteMatch:
                              type: boolean
                            weightConsistent:
                              type: boolean
                            routeConsistent:
                              description: False enquanto a rota não foi verificada; consultar
                                routeCheckStatus.
                              type: boolean
                            routeCheckStatus:
                              anyOf:
                                - const: VALID
                                  type: string
                                - const: INVALID
                                  type: string
                                - const: WARNING
                                  type: string
                                - const: NOT_APPLICABLE
                                  type: string
                                - const: NOT_VERIFIED
                                  type: string
                            issues:
                              type: array
                              items:
                                type: string
                      crossChecks:
                        type: object
                        required:
                          - rntrcStatus
                          - freightFloorStatus
                          - tollVpoStatus
                          - routeFeasibilityStatus
                          - vehicleAetStatus
                        properties:
                          rntrcStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          freightFloorStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          tollVpoStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          routeFeasibilityStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                          vehicleAetStatus:
                            anyOf:
                              - const: VALID
                                type: string
                              - const: INVALID
                                type: string
                              - const: WARNING
                                type: string
                              - const: NOT_APPLICABLE
                                type: string
                              - const: NOT_VERIFIED
                                type: string
                      warnings:
                        type: array
                        items:
                          type: string
                      memorial:
                        type: array
                        items:
                          type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        type: string
      tags:
        - DFe Transport Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cteXml
                - mdfeXml
              properties:
                cteXml:
                  minLength: 10
                  type: string
                mdfeXml:
                  minLength: 10
                  type: string
            example:
              cteXml: <CTe xmlns="http://www.portalfiscal.inf.br/cte"><infCte versao="4.00"
                Id="CTe00000000000000000000000000000000000000000000"><ide><mod>57</mod><tpAmb>2</tpAmb></ide></infCte></CTe>
              mdfeXml: <MDFe xmlns="http://www.portalfiscal.inf.br/mdfe"><infMDFe
                versao="3.00"
                Id="MDFe00000000000000000000000000000000000000000000"><ide><mod>58</mod><tpAmb>2</tpAmb></ide></infMDFe></MDFe>
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/dfe/batch:
    post:
      summary: Validação em lote de múltiplos arquivos XML (máx 50 itens)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - DFe Transport Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - xmlString
                    properties:
                      id:
                        minLength: 1
                        type: string
                      xmlString:
                        minLength: 10
                        type: string
            example:
              items:
                - id: EXEMPLO
                  xmlString: <CTe xmlns="http://www.portalfiscal.inf.br/cte"><infCte versao="4.00"
                    Id="CTe00000000000000000000000000000000000000000000"><ide><mod>57</mod><tpAmb>2</tpAmb></ide></infCte></CTe>
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/dfe/documents/{id}:
    get:
      summary: Consulta detalhe de documento e payload canônico persistido
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - DFe Transport Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/dfe/watch:
    get:
      summary: Lista alvos de monitoramento de schemas e notas técnicas do tenant
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - DFe Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters: []
    post:
      summary: Adiciona novo alvo de monitoramento DFe
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - DFe Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: dfe-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - documentType
                - authority
                - label
              properties:
                documentType:
                  type: string
                authority:
                  type: string
                label:
                  type: string
            example:
              documentType: CTE
              authority: SEFAZ
              label: Schemas CT-e
      parameters: []
      description: Exemplo XML sintético para validação estrutural local. Não é
        documento fiscal autorizado; pode retornar inconsistências e status de
        revisão. Substitua por XML próprio para a operação real.
  /api/v1/admin/dfe/schemas:
    get:
      summary: Lista todas as versões de schemas e notas técnicas cadastradas na
        plataforma
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - DFe Admin
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/public/ciot/status:
    get:
      summary: Sondagem pública de alcance do endpoint monitorado da ANTT relacionado
        ao CIOT
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - currentStatus
                      - statusLabel
                      - hasMeasurement
                      - probeScope
                      - lastCheckedAt
                      - responseTimeMs
                      - responseTimeSeconds
                      - incident
                      - metrics
                      - history
                    properties:
                      currentStatus:
                        anyOf:
                          - const: OPERATIONAL
                            type: string
                          - const: DEGRADED
                            type: string
                          - const: OUTAGE
                            type: string
                      statusLabel:
                        type: string
                      hasMeasurement:
                        type: boolean
                      probeScope:
                        const: ANTT_ENDPOINT_REACHABILITY
                        type: string
                      lastCheckedAt:
                        type: string
                      responseTimeMs:
                        type: number
                      responseTimeSeconds:
                        type: number
                      incident:
                        anyOf:
                          - type: "null"
                          - type: object
                            required:
                              - active
                              - title
                              - description
                              - contingencyRecommended
                              - startedAt
                            properties:
                              active:
                                type: boolean
                              title:
                                type: string
                              description:
                                type: string
                              contingencyRecommended:
                                type: boolean
                              startedAt:
                                anyOf:
                                  - type: string
                                  - type: "null"
                      metrics:
                        type: object
                        required:
                          - last24Hours
                          - last30Days
                        properties:
                          last24Hours:
                            type: object
                            required:
                              - uptimePercentage
                              - totalChecks
                              - successfulChecks
                              - averageLatencySeconds
                            properties:
                              uptimePercentage:
                                type: number
                              totalChecks:
                                type: number
                              successfulChecks:
                                type: number
                              averageLatencySeconds:
                                type: number
                          last30Days:
                            type: object
                            required:
                              - uptimePercentage
                              - totalChecks
                              - successfulChecks
                              - averageLatencySeconds
                            properties:
                              uptimePercentage:
                                type: number
                              totalChecks:
                                type: number
                              successfulChecks:
                                type: number
                              averageLatencySeconds:
                                type: number
                      history:
                        type: array
                        items:
                          type: object
                          required:
                            - timestamp
                            - status
                            - responseTimeMs
                            - responseTimeSeconds
                            - message
                          properties:
                            timestamp:
                              type: string
                            status:
                              anyOf:
                                - const: OPERATIONAL
                                  type: string
                                - const: DEGRADED
                                  type: string
                                - const: OUTAGE
                                  type: string
                            responseTimeMs:
                              type: number
                            responseTimeSeconds:
                              type: number
                            message:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
      tags:
        - CIOT Intelligence & Integration
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/tric/occasional/precheck:
    post:
      summary: Avaliação regulatória para viagem ocasional internacional
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - TRIC International Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: tric-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - destinationCountry
                - carrierCountry
                - hasOriginLicense
                - hasComplementaryLicense
                - hasRcTricInsurance
                - hasMercosulTechnicalInspection
                - isDriverEarValid
              properties:
                destinationCountry:
                  anyOf:
                    - const: AR
                      type: string
                    - const: BO
                      type: string
                    - const: CL
                      type: string
                    - const: PY
                      type: string
                    - const: PE
                      type: string
                    - const: UY
                      type: string
                carrierCountry:
                  anyOf:
                    - const: BR
                      type: string
                    - anyOf:
                        - const: AR
                          type: string
                        - const: BO
                          type: string
                        - const: CL
                          type: string
                        - const: PY
                          type: string
                        - const: PE
                          type: string
                        - const: UY
                          type: string
                carrierRntrc:
                  type: string
                hasOriginLicense:
                  type: boolean
                hasComplementaryLicense:
                  type: boolean
                hasRcTricInsurance:
                  type: boolean
                hasMercosulTechnicalInspection:
                  type: boolean
                isDriverEarValid:
                  type: boolean
                isDangerousGoods:
                  type: boolean
                operationType:
                  anyOf:
                    - const: LICENCA_ORIGINARIA
                      type: string
                    - const: LICENCA_COMPLEMENTAR
                      type: string
                    - const: AUTORIZACAO_TRANSITO
                      type: string
                    - const: VIAGEM_OCASIONAL
                      type: string
                    - const: CARGA_PROPRIA_INTERNACIONAL
                      type: string
            example:
              destinationCountry: AR
              carrierCountry: BR
              hasOriginLicense: false
              hasComplementaryLicense: false
              hasRcTricInsurance: false
              hasMercosulTechnicalInspection: false
              isDriverEarValid: false
      parameters: []
  /api/v1/tric/own-cargo/precheck:
    post:
      summary: Avaliação regulatória para transporte internacional de carga própria
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - TRIC International Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: tric-compliance
      x-module-status: ACTIVE
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - destinationCountry
                - carrierCountry
                - hasOriginLicense
                - hasComplementaryLicense
                - hasRcTricInsurance
                - hasMercosulTechnicalInspection
                - isDriverEarValid
              properties:
                destinationCountry:
                  anyOf:
                    - const: AR
                      type: string
                    - const: BO
                      type: string
                    - const: CL
                      type: string
                    - const: PY
                      type: string
                    - const: PE
                      type: string
                    - const: UY
                      type: string
                carrierCountry:
                  anyOf:
                    - const: BR
                      type: string
                    - anyOf:
                        - const: AR
                          type: string
                        - const: BO
                          type: string
                        - const: CL
                          type: string
                        - const: PY
                          type: string
                        - const: PE
                          type: string
                        - const: UY
                          type: string
                carrierRntrc:
                  type: string
                hasOriginLicense:
                  type: boolean
                hasComplementaryLicense:
                  type: boolean
                hasRcTricInsurance:
                  type: boolean
                hasMercosulTechnicalInspection:
                  type: boolean
                isDriverEarValid:
                  type: boolean
                isDangerousGoods:
                  type: boolean
                operationType:
                  anyOf:
                    - const: LICENCA_ORIGINARIA
                      type: string
                    - const: LICENCA_COMPLEMENTAR
                      type: string
                    - const: AUTORIZACAO_TRANSITO
                      type: string
                    - const: VIAGEM_OCASIONAL
                      type: string
                    - const: CARGA_PROPRIA_INTERNACIONAL
                      type: string
            example:
              destinationCountry: AR
              carrierCountry: BR
              hasOriginLicense: false
              hasComplementaryLicense: false
              hasRcTricInsurance: false
              hasMercosulTechnicalInspection: false
              isDriverEarValid: false
      parameters: []
  /api/v1/public/cnpj/lookup:
    get:
      summary: Consulta cadastral pública e gratuita de CNPJ (Limite de 5 consultas
        diárias por IP)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - company
                      - remainingDailyQueries
                      - dailyLimit
                    properties:
                      company:
                        type: object
                        required:
                          - cnpj
                          - formattedCnpj
                          - corporateName
                          - tradeName
                          - status
                          - statusDate
                          - openingDate
                          - legalNature
                          - companySize
                          - shareCapital
                          - isSimpleOptant
                          - isMeiOptant
                          - mainCnae
                          - secondaryCnaes
                          - address
                          - qsa
                          - source
                          - queriedAt
                        properties:
                          cnpj:
                            type: string
                          formattedCnpj:
                            type: string
                          corporateName:
                            type: string
                          tradeName:
                            anyOf:
                              - type: string
                              - type: "null"
                          status:
                            anyOf:
                              - const: ATIVA
                                type: string
                              - const: BAIXADA
                                type: string
                              - const: SUSPENSA
                                type: string
                              - const: INAPTA
                                type: string
                              - const: NULA
                                type: string
                          statusDate:
                            anyOf:
                              - type: string
                              - type: "null"
                          statusReason:
                            anyOf:
                              - type: string
                              - type: "null"
                          openingDate:
                            anyOf:
                              - type: string
                              - type: "null"
                          legalNature:
                            type: string
                          legalNatureCode:
                            anyOf:
                              - type: string
                              - type: "null"
                          companySize:
                            type: string
                          shareCapital:
                            anyOf:
                              - type: number
                              - type: "null"
                          isSimpleOptant:
                            anyOf:
                              - type: boolean
                              - type: "null"
                          simpleOptantSince:
                            anyOf:
                              - type: string
                              - type: "null"
                          isMeiOptant:
                            anyOf:
                              - type: boolean
                              - type: "null"
                          mainCnae:
                            type: object
                            required:
                              - code
                              - description
                            properties:
                              code:
                                type: string
                              description:
                                type: string
                          secondaryCnaes:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - description
                              properties:
                                code:
                                  type: string
                                description:
                                  type: string
                          address:
                            type: object
                            required:
                              - street
                              - number
                              - neighborhood
                              - zipCode
                              - city
                              - state
                            properties:
                              street:
                                type: string
                              number:
                                type: string
                              complement:
                                anyOf:
                                  - type: string
                                  - type: "null"
                              neighborhood:
                                type: string
                              zipCode:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                              ibgeCityCode:
                                anyOf:
                                  - type: string
                                  - type: "null"
                          phone:
                            anyOf:
                              - type: string
                              - type: "null"
                          email:
                            anyOf:
                              - type: string
                              - type: "null"
                          qsa:
                            type: array
                            items:
                              type: object
                              required:
                                - name
                                - role
                              properties:
                                name:
                                  type: string
                                role:
                                  type: string
                                legalRepresentativeName:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                legalRepresentativeRole:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                country:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                entryDate:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                ageRange:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                          source:
                            anyOf:
                              - const: APIBRASIL
                                type: string
                              - const: RECEITA_FEDERAL
                                type: string
                              - const: CACHE
                                type: string
                          queriedAt:
                            type: string
                      remainingDailyQueries:
                        minimum: 0
                        maximum: 5
                        type: integer
                      dailyLimit:
                        const: 5
                        type: number
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 404
                    type: number
                  detail:
                    type: string
                  code:
                    const: CNPJ_NOT_FOUND
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "422":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 422
                    type: number
                  detail:
                    type: string
                  code:
                    const: INVALID_CNPJ
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "429":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 429
                    type: number
                  detail:
                    type: string
                  code:
                    const: DAILY_LIMIT_EXCEEDED
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "503":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 503
                    type: number
                  detail:
                    type: string
                  code:
                    const: CNPJ_SERVICE_UNAVAILABLE
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
      tags:
        - CNPJ & Compliance Cadastral
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: cnpj-lookup
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: query
          name: cnpj
          required: true
          schema:
            minLength: 11
            maxLength: 20
            type: string
          example: "00000000000191"
      description: "Respostas sem cache compartilhado (Cache-Control: private,
        no-store, max-age=0), inclusive erros. Limite diário gratuito por
        ferramenta e IP; HTTP 429 ao esgotar. O armazenamento da quota é local
        ao processo, não uma garantia global entre réplicas ou reinícios."
  /api/v1/cnpj/{cnpj}:
    get:
      summary: Consulta cadastral e quadro societário (QSA) via API para clientes
        autenticados
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - company
                    properties:
                      company:
                        type: object
                        required:
                          - cnpj
                          - formattedCnpj
                          - corporateName
                          - tradeName
                          - status
                          - statusDate
                          - openingDate
                          - legalNature
                          - companySize
                          - shareCapital
                          - isSimpleOptant
                          - isMeiOptant
                          - mainCnae
                          - secondaryCnaes
                          - address
                          - qsa
                          - source
                          - queriedAt
                        properties:
                          cnpj:
                            type: string
                          formattedCnpj:
                            type: string
                          corporateName:
                            type: string
                          tradeName:
                            anyOf:
                              - type: string
                              - type: "null"
                          status:
                            anyOf:
                              - const: ATIVA
                                type: string
                              - const: BAIXADA
                                type: string
                              - const: SUSPENSA
                                type: string
                              - const: INAPTA
                                type: string
                              - const: NULA
                                type: string
                          statusDate:
                            anyOf:
                              - type: string
                              - type: "null"
                          statusReason:
                            anyOf:
                              - type: string
                              - type: "null"
                          openingDate:
                            anyOf:
                              - type: string
                              - type: "null"
                          legalNature:
                            type: string
                          legalNatureCode:
                            anyOf:
                              - type: string
                              - type: "null"
                          companySize:
                            type: string
                          shareCapital:
                            anyOf:
                              - type: number
                              - type: "null"
                          isSimpleOptant:
                            anyOf:
                              - type: boolean
                              - type: "null"
                          simpleOptantSince:
                            anyOf:
                              - type: string
                              - type: "null"
                          isMeiOptant:
                            anyOf:
                              - type: boolean
                              - type: "null"
                          mainCnae:
                            type: object
                            required:
                              - code
                              - description
                            properties:
                              code:
                                type: string
                              description:
                                type: string
                          secondaryCnaes:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - description
                              properties:
                                code:
                                  type: string
                                description:
                                  type: string
                          address:
                            type: object
                            required:
                              - street
                              - number
                              - neighborhood
                              - zipCode
                              - city
                              - state
                            properties:
                              street:
                                type: string
                              number:
                                type: string
                              complement:
                                anyOf:
                                  - type: string
                                  - type: "null"
                              neighborhood:
                                type: string
                              zipCode:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                              ibgeCityCode:
                                anyOf:
                                  - type: string
                                  - type: "null"
                          phone:
                            anyOf:
                              - type: string
                              - type: "null"
                          email:
                            anyOf:
                              - type: string
                              - type: "null"
                          qsa:
                            type: array
                            items:
                              type: object
                              required:
                                - name
                                - role
                              properties:
                                name:
                                  type: string
                                role:
                                  type: string
                                legalRepresentativeName:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                legalRepresentativeRole:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                country:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                entryDate:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                                ageRange:
                                  anyOf:
                                    - type: string
                                    - type: "null"
                          source:
                            anyOf:
                              - const: APIBRASIL
                                type: string
                              - const: RECEITA_FEDERAL
                                type: string
                              - const: CACHE
                                type: string
                          queriedAt:
                            type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 404
                    type: number
                  detail:
                    type: string
                  code:
                    const: CNPJ_NOT_FOUND
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "422":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - type
                  - title
                  - status
                  - detail
                  - code
                  - meta
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    const: 422
                    type: number
                  detail:
                    type: string
                  code:
                    const: INVALID_CNPJ
                    type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
      tags:
        - CNPJ & Compliance Cadastral
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: cnpj-lookup
      x-module-status: ACTIVE
      x-runtime-contract: true
      parameters:
        - in: path
          name: cnpj
          required: true
          schema:
            minLength: 11
            maxLength: 20
            type: string
          example: "00000000000191"
  /api/v1/auth/provision-tenant:
    post:
      summary: Provisiona uma nova organização ou associa usuário a um convite pendente
      responses:
        "201":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - tenantId
                      - name
                      - slug
                      - role
                      - planCode
                      - trialCredits
                      - onboardingStep
                      - isNewTenant
                    properties:
                      tenantId:
                        format: uuid
                        type: string
                      name:
                        type: string
                      slug:
                        type: string
                      role:
                        type: string
                      planCode:
                        type: string
                      trialCredits:
                        type: number
                      onboardingStep:
                        type: string
                      isNewTenant:
                        type: boolean
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Identidade & Organizações
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - companyName
                - termsAccepted
                - privacyAccepted
              properties:
                companyName:
                  minLength: 2
                  maxLength: 100
                  type: string
                termsAccepted:
                  type: boolean
                privacyAccepted:
                  type: boolean
                termsVersion:
                  const: 2026-08-v1
                  type: string
                privacyVersion:
                  const: 2026-08-v1
                  type: string
                inviteToken:
                  minLength: 1
                  maxLength: 256
                  type: string
            example:
              companyName: EXEMPLO
              termsAccepted: false
              privacyAccepted: false
      parameters: []
  /api/v1/organizations:
    get:
      summary: Lista todas as organizações às quais o usuário autenticado pertence
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - name
                        - slug
                        - role
                        - status
                        - createdAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        name:
                          type: string
                        slug:
                          type: string
                        role:
                          type: string
                        status:
                          type: string
                        createdAt:
                          type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Identidade & Organizações
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/session/active-organization:
    post:
      summary: Define e valida a organização ativa para a sessão atual
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - activeTenantId
                      - role
                    properties:
                      activeTenantId:
                        format: uuid
                        type: string
                      role:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Identidade & Organizações
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - tenantId
              properties:
                tenantId:
                  format: uuid
                  type: string
            example:
              tenantId: 00000000-0000-4000-8000-000000000001
      parameters: []
  /api/v1/account/export-data:
    get:
      summary: Exporta os dados cadastrais, chaves de API e histórico da conta (LGPD
        Art. 18, V)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - protocol
                      - exportedAt
                      - user
                      - organization
                      - apiKeys
                      - creditAccount
                      - legalAcceptances
                    properties:
                      protocol:
                        format: uuid
                        type: string
                      exportedAt:
                        type: string
                      user:
                        type: object
                        required:
                          - id
                          - email
                          - role
                        properties:
                          id:
                            format: uuid
                            type: string
                          email:
                            type: string
                          role:
                            type: string
                      organization:
                        type: object
                        required:
                          - id
                          - name
                          - slug
                          - status
                          - createdAt
                        properties:
                          id:
                            format: uuid
                            type: string
                          name:
                            type: string
                          slug:
                            type: string
                          status:
                            type: string
                          createdAt:
                            type: string
                      apiKeys:
                        type: array
                        items:
                          type: object
                          required:
                            - name
                            - prefix
                            - scopes
                            - status
                            - createdAt
                            - lastUsedAt
                          properties:
                            name:
                              type: string
                            prefix:
                              type: string
                            scopes:
                              type: array
                              items:
                                type: string
                            status:
                              type: string
                            createdAt:
                              type: string
                            lastUsedAt:
                              anyOf:
                                - type: string
                                - type: "null"
                      creditAccount:
                        type: object
                        required:
                          - balance
                          - planBalance
                          - lifetimeGranted
                        properties:
                          balance:
                            type: number
                          planBalance:
                            type: number
                          lifetimeGranted:
                            type: number
                      legalAcceptances:
                        type: array
                        items:
                          type: object
                          required:
                            - documentType
                            - version
                            - acceptedAt
                          properties:
                            documentType:
                              type: string
                            version:
                              type: string
                            acceptedAt:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Privacidade & Conta
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/account/delete-permanently:
    post:
      summary: Exclui permanentemente a conta, chaves de API e vínculos (LGPD Art. 18,
        VI)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - protocol
                      - action
                      - deletedAt
                      - retainedForLegalObligations
                      - message
                    properties:
                      protocol:
                        format: uuid
                        type: string
                      action:
                        type: string
                      deletedAt:
                        type: string
                      retainedForLegalObligations:
                        type: object
                        required:
                          - fiscalRecordsRetainedYears
                          - connectionLogsRetainedMonths
                          - legalBases
                        properties:
                          fiscalRecordsRetainedYears:
                            type: number
                          connectionLogsRetainedMonths:
                            type: number
                          legalBases:
                            type: array
                            items:
                              type: string
                      message:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Privacidade & Conta
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - confirmationText
              properties:
                confirmationText:
                  minLength: 2
                  maxLength: 200
                  type: string
                password:
                  minLength: 1
                  type: string
                reason:
                  maxLength: 500
                  type: string
            example:
              confirmationText: EXEMPLO
      parameters: []
  /api/v1/team:
    get:
      summary: Lista todos os membros e permissões da organização
      responses:
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/team/invitations:
    post:
      summary: Cria convite e link de acesso; nao implica entrega de e-mail
      responses:
        "201":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - tenantId
                      - email
                      - role
                      - status
                      - invitedAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      userId:
                        format: uuid
                        type: string
                      email:
                        type: string
                      role:
                        anyOf:
                          - const: OWNER
                            type: string
                          - const: ADMIN
                            type: string
                          - const: DEVELOPER
                            type: string
                          - const: OPERATIONS
                            type: string
                          - const: FINANCE
                            type: string
                          - const: VIEWER
                            type: string
                      status:
                        anyOf:
                          - const: ACTIVE
                            type: string
                          - const: INVITED
                            type: string
                          - const: SUSPENDED
                            type: string
                      invitedAt:
                        type: string
                      joinedAt:
                        anyOf:
                          - type: string
                          - type: "null"
                  invitation:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - tenantId
                      - email
                      - role
                      - status
                      - expiresAt
                      - createdAt
                      - updatedAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      email:
                        format: email
                        type: string
                      role:
                        anyOf:
                          - const: OWNER
                            type: string
                          - const: ADMIN
                            type: string
                          - const: DEVELOPER
                            type: string
                          - const: OPERATIONS
                            type: string
                          - const: FINANCE
                            type: string
                          - const: VIEWER
                            type: string
                      invitedBy:
                        type: string
                      status:
                        anyOf:
                          - const: PENDING
                            type: string
                          - const: ACCEPTED
                            type: string
                          - const: EXPIRED
                            type: string
                          - const: REVOKED
                            type: string
                      expiresAt:
                        type: string
                      acceptedAt:
                        anyOf:
                          - type: string
                          - type: "null"
                      acceptedByUserId:
                        anyOf:
                          - type: string
                          - type: "null"
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                  rawToken:
                    type: string
                  inviteUrl:
                    type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - role
              properties:
                email:
                  format: email
                  type: string
                role:
                  anyOf:
                    - const: OWNER
                      type: string
                    - const: ADMIN
                      type: string
                    - const: DEVELOPER
                      type: string
                    - const: OPERATIONS
                      type: string
                    - const: FINANCE
                      type: string
                    - const: VIEWER
                      type: string
            example:
              email: exemplo@example.com
              role: OWNER
      parameters: []
    get:
      summary: Lista todos os convites pendentes e expirados da organização
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - tenantId
                        - email
                        - role
                        - status
                        - expiresAt
                        - createdAt
                        - updatedAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        tenantId:
                          format: uuid
                          type: string
                        email:
                          format: email
                          type: string
                        role:
                          anyOf:
                            - const: OWNER
                              type: string
                            - const: ADMIN
                              type: string
                            - const: DEVELOPER
                              type: string
                            - const: OPERATIONS
                              type: string
                            - const: FINANCE
                              type: string
                            - const: VIEWER
                              type: string
                        invitedBy:
                          type: string
                        status:
                          anyOf:
                            - const: PENDING
                              type: string
                            - const: ACCEPTED
                              type: string
                            - const: EXPIRED
                              type: string
                            - const: REVOKED
                              type: string
                        expiresAt:
                          type: string
                        acceptedAt:
                          anyOf:
                            - type: string
                            - type: "null"
                        acceptedByUserId:
                          anyOf:
                            - type: string
                            - type: "null"
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/team/invitations/accept:
    post:
      summary: Aceita um convite de equipe associando a conta do usuário autenticado
      responses:
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
              properties:
                token:
                  minLength: 32
                  type: string
            example:
              token: "00000000000000000000000000000000"
      parameters: []
  /api/v1/team/invitations/{id}/resend:
    post:
      summary: Renova a expiração e gera novo token de acesso para convite existente
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - newRawToken
                  - inviteUrl
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - tenantId
                      - email
                      - role
                      - status
                      - expiresAt
                      - createdAt
                      - updatedAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      email:
                        format: email
                        type: string
                      role:
                        anyOf:
                          - const: OWNER
                            type: string
                          - const: ADMIN
                            type: string
                          - const: DEVELOPER
                            type: string
                          - const: OPERATIONS
                            type: string
                          - const: FINANCE
                            type: string
                          - const: VIEWER
                            type: string
                      invitedBy:
                        type: string
                      status:
                        anyOf:
                          - const: PENDING
                            type: string
                          - const: ACCEPTED
                            type: string
                          - const: EXPIRED
                            type: string
                          - const: REVOKED
                            type: string
                      expiresAt:
                        type: string
                      acceptedAt:
                        anyOf:
                          - type: string
                          - type: "null"
                      acceptedByUserId:
                        anyOf:
                          - type: string
                          - type: "null"
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                  newRawToken:
                    type: string
                  inviteUrl:
                    type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/team/invitations/{id}:
    delete:
      summary: Cancela e invalida permanentemente um convite pendente
      responses:
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/team/members/{id}:
    patch:
      summary: Altera o papel de acesso (Role) de um membro da equipe
      responses:
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - role
              properties:
                role:
                  anyOf:
                    - const: OWNER
                      type: string
                    - const: ADMIN
                      type: string
                    - const: DEVELOPER
                      type: string
                    - const: OPERATIONS
                      type: string
                    - const: FINANCE
                      type: string
                    - const: VIEWER
                      type: string
            example:
              role: OWNER
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
    delete:
      summary: Remove um membro da organização e revoga seu acesso imediatamente
      responses:
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/team/transfer-ownership:
    post:
      summary: Transfere a posse (titularidade OWNER) da organização para outro membro
        ativo
      responses:
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Team & RBAC
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - targetMemberId
              properties:
                targetMemberId:
                  format: uuid
                  type: string
            example:
              targetMemberId: 00000000-0000-4000-8000-000000000001
      parameters: []
  /api/v1/webhooks:
    post:
      summary: Cadastra um novo endpoint HTTPS para recebimento de eventos assinados
        via HMAC
      responses:
        "201":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - endpoint
                      - secret
                      - warning
                    properties:
                      endpoint:
                        additionalProperties: false
                        type: object
                        required:
                          - id
                          - tenantId
                          - url
                          - secretPrefix
                          - events
                          - status
                          - createdAt
                          - updatedAt
                        properties:
                          id:
                            format: uuid
                            type: string
                          tenantId:
                            format: uuid
                            type: string
                          url:
                            type: string
                          description:
                            type: string
                          secretPrefix:
                            type: string
                          events:
                            type: array
                            items:
                              const: ping
                              type: string
                          status:
                            anyOf:
                              - const: ACTIVE
                                type: string
                              - const: PAUSED
                                type: string
                              - const: DISABLED
                                type: string
                          lastDeliveryAt:
                            anyOf:
                              - type: string
                              - type: "null"
                          lastStatusCode:
                            anyOf:
                              - type: number
                              - type: "null"
                          createdAt:
                            type: string
                          updatedAt:
                            type: string
                      secret:
                        type: string
                      warning:
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "503":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - url
                - events
              properties:
                url:
                  format: uri
                  maxLength: 2048
                  type: string
                description:
                  maxLength: 200
                  type: string
                events:
                  minItems: 1
                  maxItems: 1
                  uniqueItems: true
                  type: array
                  items:
                    const: ping
                    type: string
            example:
              url: https://webhook.example.com/events
              events:
                - ping
              description: Endpoint sintetico
      parameters: []
    get:
      summary: Lista todos os endpoints de webhook cadastrados para a conta
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - tenantId
                        - url
                        - secretPrefix
                        - events
                        - status
                        - createdAt
                        - updatedAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        tenantId:
                          format: uuid
                          type: string
                        url:
                          type: string
                        description:
                          type: string
                        secretPrefix:
                          type: string
                        events:
                          type: array
                          items:
                            const: ping
                            type: string
                        status:
                          anyOf:
                            - const: ACTIVE
                              type: string
                            - const: PAUSED
                              type: string
                            - const: DISABLED
                              type: string
                        lastDeliveryAt:
                          anyOf:
                            - type: string
                            - type: "null"
                        lastStatusCode:
                          anyOf:
                            - type: number
                            - type: "null"
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/webhooks/{id}:
    delete:
      summary: Remove um endpoint de webhook
      responses:
        "202":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - outboxId
                      - endpointId
                      - eventId
                      - eventType
                      - status
                    properties:
                      outboxId:
                        format: uuid
                        type: string
                      endpointId:
                        format: uuid
                        type: string
                      eventId:
                        type: string
                      eventType:
                        const: ping
                        type: string
                      status:
                        const: PENDING
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/webhooks/{id}/rotate-secret:
    post:
      summary: Gera e ativa um novo segredo HMAC-SHA256 para o webhook
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - endpoint
                      - newSecret
                      - warning
                    properties:
                      endpoint:
                        additionalProperties: false
                        type: object
                        required:
                          - id
                          - tenantId
                          - url
                          - secretPrefix
                          - events
                          - status
                          - createdAt
                          - updatedAt
                        properties:
                          id:
                            format: uuid
                            type: string
                          tenantId:
                            format: uuid
                            type: string
                          url:
                            type: string
                          description:
                            type: string
                          secretPrefix:
                            type: string
                          events:
                            type: array
                            items:
                              const: ping
                              type: string
                          status:
                            anyOf:
                              - const: ACTIVE
                                type: string
                              - const: PAUSED
                                type: string
                              - const: DISABLED
                                type: string
                          lastDeliveryAt:
                            anyOf:
                              - type: string
                              - type: "null"
                          lastStatusCode:
                            anyOf:
                              - type: number
                              - type: "null"
                          createdAt:
                            type: string
                          updatedAt:
                            type: string
                      newSecret:
                        type: string
                      warning:
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "503":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/webhooks/{id}/test-ping:
    post:
      summary: Dispara um ping de teste assinado via HTTPS para verificar a
        conectividade do webhook
      responses:
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/webhooks/{id}/deliveries:
    get:
      summary: Lista o histórico auditável de disparos e respostas HTTP do webhook com
        payload redigido
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - endpointId
                        - tenantId
                        - eventType
                        - eventId
                        - payload
                        - attemptNumber
                        - maxAttempts
                        - status
                        - createdAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        endpointId:
                          format: uuid
                          type: string
                        tenantId:
                          format: uuid
                          type: string
                        eventType:
                          const: ping
                          type: string
                        eventId:
                          type: string
                        payload:
                          type: object
                          patternProperties:
                            ^(.*)$: {}
                        statusCode:
                          anyOf:
                            - type: number
                            - type: "null"
                        durationMs:
                          anyOf:
                            - type: number
                            - type: "null"
                        responseBody:
                          anyOf:
                            - type: string
                            - type: "null"
                        error:
                          anyOf:
                            - type: string
                            - type: "null"
                        attemptNumber:
                          type: number
                        maxAttempts:
                          type: number
                        status:
                          anyOf:
                            - const: PENDING
                              type: string
                            - const: PROCESSING
                              type: string
                            - const: RETRY_SCHEDULED
                              type: string
                            - const: SUCCESS
                              type: string
                            - const: FAILED_FINAL
                              type: string
                            - const: FAILED
                              type: string
                            - const: RETRYING
                              type: string
                        nextRetryAt:
                          anyOf:
                            - type: string
                            - type: "null"
                        createdAt:
                          type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: integer
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/webhooks/deliveries/{id}/replay:
    post:
      summary: Reenvia um payload de webhook anteriormente registrado
      responses:
        "202":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - outboxId
                      - endpointId
                      - eventId
                      - eventType
                      - status
                    properties:
                      outboxId:
                        format: uuid
                        type: string
                      endpointId:
                        format: uuid
                        type: string
                      eventId:
                        type: string
                      eventType:
                        const: ping
                        type: string
                      status:
                        const: PENDING
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Developer Webhooks
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - endpointId
              properties:
                endpointId:
                  format: uuid
                  type: string
            example:
              endpointId: 00000000-0000-4000-8000-000000000001
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/policies:
    post:
      summary: Cadastra uma nova política interna corporativa para o tenant
      responses:
        "201":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - tenantId
                      - name
                      - category
                      - createdAt
                      - updatedAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      name:
                        minLength: 1
                        maxLength: 120
                        type: string
                      description:
                        maxLength: 500
                        type: string
                      category:
                        anyOf:
                          - const: FREIGHT
                            type: string
                          - const: SAFETY
                            type: string
                          - const: COMPLIANCE
                            type: string
                          - const: ENVIRONMENTAL
                            type: string
                          - const: FINANCIAL
                            type: string
                          - const: FLEET
                            type: string
                          - const: CUSTOM
                            type: string
                      activeVersionId:
                        anyOf:
                          - format: uuid
                            type: string
                          - type: "null"
                      activeVersionNumber:
                        anyOf:
                          - type: number
                          - type: "null"
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - name
                - category
              properties:
                name:
                  minLength: 1
                  maxLength: 120
                  type: string
                description:
                  maxLength: 500
                  type: string
                category:
                  anyOf:
                    - const: FREIGHT
                      type: string
                    - const: SAFETY
                      type: string
                    - const: COMPLIANCE
                      type: string
                    - const: ENVIRONMENTAL
                      type: string
                    - const: FINANCIAL
                      type: string
                    - const: FLEET
                      type: string
                    - const: CUSTOM
                      type: string
            example:
              name: Exemplo sintético
              category: FREIGHT
      parameters: []
    get:
      summary: Lista as políticas corporativas configuradas para a organização
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      additionalProperties: false
                      type: object
                      required:
                        - id
                        - tenantId
                        - name
                        - category
                        - createdAt
                        - updatedAt
                      properties:
                        id:
                          format: uuid
                          type: string
                        tenantId:
                          format: uuid
                          type: string
                        name:
                          minLength: 1
                          maxLength: 120
                          type: string
                        description:
                          maxLength: 500
                          type: string
                        category:
                          anyOf:
                            - const: FREIGHT
                              type: string
                            - const: SAFETY
                              type: string
                            - const: COMPLIANCE
                              type: string
                            - const: ENVIRONMENTAL
                              type: string
                            - const: FINANCIAL
                              type: string
                            - const: FLEET
                              type: string
                            - const: CUSTOM
                              type: string
                        activeVersionId:
                          anyOf:
                            - format: uuid
                              type: string
                            - type: "null"
                        activeVersionNumber:
                          anyOf:
                            - type: number
                            - type: "null"
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/policies/{id}:
    get:
      summary: Obtém detalhes da política corporativa e seu histórico imutável de
        versões
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - policy
                      - versions
                    properties:
                      policy:
                        additionalProperties: false
                        type: object
                        required:
                          - id
                          - tenantId
                          - name
                          - category
                          - createdAt
                          - updatedAt
                        properties:
                          id:
                            format: uuid
                            type: string
                          tenantId:
                            format: uuid
                            type: string
                          name:
                            minLength: 1
                            maxLength: 120
                            type: string
                          description:
                            maxLength: 500
                            type: string
                          category:
                            anyOf:
                              - const: FREIGHT
                                type: string
                              - const: SAFETY
                                type: string
                              - const: COMPLIANCE
                                type: string
                              - const: ENVIRONMENTAL
                                type: string
                              - const: FINANCIAL
                                type: string
                              - const: FLEET
                                type: string
                              - const: CUSTOM
                                type: string
                          activeVersionId:
                            anyOf:
                              - format: uuid
                                type: string
                              - type: "null"
                          activeVersionNumber:
                            anyOf:
                              - type: number
                              - type: "null"
                          createdAt:
                            type: string
                          updatedAt:
                            type: string
                      activeVersion:
                        anyOf:
                          - additionalProperties: false
                            type: object
                            required:
                              - id
                              - policyId
                              - tenantId
                              - version
                              - status
                              - dsl
                              - authoredBy
                              - changeReason
                              - checksum
                              - createdAt
                            properties:
                              id:
                                format: uuid
                                type: string
                              policyId:
                                format: uuid
                                type: string
                              tenantId:
                                format: uuid
                                type: string
                              version:
                                type: number
                              status:
                                anyOf:
                                  - const: DRAFT
                                    type: string
                                  - const: PUBLISHED
                                    type: string
                                  - const: RETIRED
                                    type: string
                              effectiveFrom:
                                anyOf:
                                  - type: string
                                  - type: "null"
                              effectiveUntil:
                                anyOf:
                                  - type: string
                                  - type: "null"
                              dsl:
                                additionalProperties: false
                                type: object
                                required:
                                  - schemaVersion
                                  - rules
                                properties:
                                  schemaVersion:
                                    const: "1.0"
                                    type: string
                                  rules:
                                    minItems: 1
                                    maxItems: 100
                                    type: array
                                    items:
                                      additionalProperties: false
                                      type: object
                                      required:
                                        - id
                                        - name
                                        - severity
                                        - reasonCode
                                        - message
                                      properties:
                                        id:
                                          minLength: 1
                                          maxLength: 80
                                          type: string
                                        name:
                                          minLength: 1
                                          maxLength: 120
                                          type: string
                                        severity:
                                          anyOf:
                                            - const: FAIL
                                              type: string
                                            - const: WARN
                                              type: string
                                        reasonCode:
                                          minLength: 1
                                          maxLength: 80
                                          type: string
                                        message:
                                          minLength: 1
                                          maxLength: 300
                                          type: string
                                        all:
                                          type: array
                                          items:
                                            additionalProperties: false
                                            type: object
                                            required:
                                              - field
                                              - operator
                                            properties:
                                              field:
                                                minLength: 1
                                                maxLength: 200
                                                type: string
                                              operator:
                                                anyOf:
                                                  - const: EQUALS
                                                    type: string
                                                  - const: NOT_EQUALS
                                                    type: string
                                                  - const: GREATER_THAN
                                                    type: string
                                                  - const: GREATER_THAN_OR_EQUAL
                                                    type: string
                                                  - const: LESS_THAN
                                                    type: string
                                                  - const: LESS_THAN_OR_EQUAL
                                                    type: string
                                                  - const: IN
                                                    type: string
                                                  - const: NOT_IN
                                                    type: string
                                                  - const: CONTAINS
                                                    type: string
                                                  - const: EXISTS
                                                    type: string
                                                  - const: NOT_EXISTS
                                                    type: string
                                              value: {}
                                        any:
                                          type: array
                                          items:
                                            additionalProperties: false
                                            type: object
                                            required:
                                              - field
                                              - operator
                                            properties:
                                              field:
                                                minLength: 1
                                                maxLength: 200
                                                type: string
                                              operator:
                                                anyOf:
                                                  - const: EQUALS
                                                    type: string
                                                  - const: NOT_EQUALS
                                                    type: string
                                                  - const: GREATER_THAN
                                                    type: string
                                                  - const: GREATER_THAN_OR_EQUAL
                                                    type: string
                                                  - const: LESS_THAN
                                                    type: string
                                                  - const: LESS_THAN_OR_EQUAL
                                                    type: string
                                                  - const: IN
                                                    type: string
                                                  - const: NOT_IN
                                                    type: string
                                                  - const: CONTAINS
                                                    type: string
                                                  - const: EXISTS
                                                    type: string
                                                  - const: NOT_EXISTS
                                                    type: string
                                              value: {}
                              authoredBy:
                                type: string
                              changeReason:
                                minLength: 1
                                maxLength: 500
                                type: string
                              checksum:
                                type: string
                              createdAt:
                                type: string
                              publishedAt:
                                anyOf:
                                  - type: string
                                  - type: "null"
                              retiredAt:
                                anyOf:
                                  - type: string
                                  - type: "null"
                          - type: "null"
                      versions:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - id
                            - policyId
                            - tenantId
                            - version
                            - status
                            - dsl
                            - authoredBy
                            - changeReason
                            - checksum
                            - createdAt
                          properties:
                            id:
                              format: uuid
                              type: string
                            policyId:
                              format: uuid
                              type: string
                            tenantId:
                              format: uuid
                              type: string
                            version:
                              type: number
                            status:
                              anyOf:
                                - const: DRAFT
                                  type: string
                                - const: PUBLISHED
                                  type: string
                                - const: RETIRED
                                  type: string
                            effectiveFrom:
                              anyOf:
                                - type: string
                                - type: "null"
                            effectiveUntil:
                              anyOf:
                                - type: string
                                - type: "null"
                            dsl:
                              additionalProperties: false
                              type: object
                              required:
                                - schemaVersion
                                - rules
                              properties:
                                schemaVersion:
                                  const: "1.0"
                                  type: string
                                rules:
                                  minItems: 1
                                  maxItems: 100
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - id
                                      - name
                                      - severity
                                      - reasonCode
                                      - message
                                    properties:
                                      id:
                                        minLength: 1
                                        maxLength: 80
                                        type: string
                                      name:
                                        minLength: 1
                                        maxLength: 120
                                        type: string
                                      severity:
                                        anyOf:
                                          - const: FAIL
                                            type: string
                                          - const: WARN
                                            type: string
                                      reasonCode:
                                        minLength: 1
                                        maxLength: 80
                                        type: string
                                      message:
                                        minLength: 1
                                        maxLength: 300
                                        type: string
                                      all:
                                        type: array
                                        items:
                                          additionalProperties: false
                                          type: object
                                          required:
                                            - field
                                            - operator
                                          properties:
                                            field:
                                              minLength: 1
                                              maxLength: 200
                                              type: string
                                            operator:
                                              anyOf:
                                                - const: EQUALS
                                                  type: string
                                                - const: NOT_EQUALS
                                                  type: string
                                                - const: GREATER_THAN
                                                  type: string
                                                - const: GREATER_THAN_OR_EQUAL
                                                  type: string
                                                - const: LESS_THAN
                                                  type: string
                                                - const: LESS_THAN_OR_EQUAL
                                                  type: string
                                                - const: IN
                                                  type: string
                                                - const: NOT_IN
                                                  type: string
                                                - const: CONTAINS
                                                  type: string
                                                - const: EXISTS
                                                  type: string
                                                - const: NOT_EXISTS
                                                  type: string
                                            value: {}
                                      any:
                                        type: array
                                        items:
                                          additionalProperties: false
                                          type: object
                                          required:
                                            - field
                                            - operator
                                          properties:
                                            field:
                                              minLength: 1
                                              maxLength: 200
                                              type: string
                                            operator:
                                              anyOf:
                                                - const: EQUALS
                                                  type: string
                                                - const: NOT_EQUALS
                                                  type: string
                                                - const: GREATER_THAN
                                                  type: string
                                                - const: GREATER_THAN_OR_EQUAL
                                                  type: string
                                                - const: LESS_THAN
                                                  type: string
                                                - const: LESS_THAN_OR_EQUAL
                                                  type: string
                                                - const: IN
                                                  type: string
                                                - const: NOT_IN
                                                  type: string
                                                - const: CONTAINS
                                                  type: string
                                                - const: EXISTS
                                                  type: string
                                                - const: NOT_EXISTS
                                                  type: string
                                            value: {}
                            authoredBy:
                              type: string
                            changeReason:
                              minLength: 1
                              maxLength: 500
                              type: string
                            checksum:
                              type: string
                            createdAt:
                              type: string
                            publishedAt:
                              anyOf:
                                - type: string
                                - type: "null"
                            retiredAt:
                              anyOf:
                                - type: string
                                - type: "null"
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "404":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/policies/{id}/versions:
    post:
      summary: Cria uma nova versão em rascunho com regras declarativas JSON seguras
      responses:
        "201":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - policyId
                      - tenantId
                      - version
                      - status
                      - dsl
                      - authoredBy
                      - changeReason
                      - checksum
                      - createdAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      policyId:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      version:
                        type: number
                      status:
                        anyOf:
                          - const: DRAFT
                            type: string
                          - const: PUBLISHED
                            type: string
                          - const: RETIRED
                            type: string
                      effectiveFrom:
                        anyOf:
                          - type: string
                          - type: "null"
                      effectiveUntil:
                        anyOf:
                          - type: string
                          - type: "null"
                      dsl:
                        additionalProperties: false
                        type: object
                        required:
                          - schemaVersion
                          - rules
                        properties:
                          schemaVersion:
                            const: "1.0"
                            type: string
                          rules:
                            minItems: 1
                            maxItems: 100
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - id
                                - name
                                - severity
                                - reasonCode
                                - message
                              properties:
                                id:
                                  minLength: 1
                                  maxLength: 80
                                  type: string
                                name:
                                  minLength: 1
                                  maxLength: 120
                                  type: string
                                severity:
                                  anyOf:
                                    - const: FAIL
                                      type: string
                                    - const: WARN
                                      type: string
                                reasonCode:
                                  minLength: 1
                                  maxLength: 80
                                  type: string
                                message:
                                  minLength: 1
                                  maxLength: 300
                                  type: string
                                all:
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - field
                                      - operator
                                    properties:
                                      field:
                                        minLength: 1
                                        maxLength: 200
                                        type: string
                                      operator:
                                        anyOf:
                                          - const: EQUALS
                                            type: string
                                          - const: NOT_EQUALS
                                            type: string
                                          - const: GREATER_THAN
                                            type: string
                                          - const: GREATER_THAN_OR_EQUAL
                                            type: string
                                          - const: LESS_THAN
                                            type: string
                                          - const: LESS_THAN_OR_EQUAL
                                            type: string
                                          - const: IN
                                            type: string
                                          - const: NOT_IN
                                            type: string
                                          - const: CONTAINS
                                            type: string
                                          - const: EXISTS
                                            type: string
                                          - const: NOT_EXISTS
                                            type: string
                                      value: {}
                                any:
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - field
                                      - operator
                                    properties:
                                      field:
                                        minLength: 1
                                        maxLength: 200
                                        type: string
                                      operator:
                                        anyOf:
                                          - const: EQUALS
                                            type: string
                                          - const: NOT_EQUALS
                                            type: string
                                          - const: GREATER_THAN
                                            type: string
                                          - const: GREATER_THAN_OR_EQUAL
                                            type: string
                                          - const: LESS_THAN
                                            type: string
                                          - const: LESS_THAN_OR_EQUAL
                                            type: string
                                          - const: IN
                                            type: string
                                          - const: NOT_IN
                                            type: string
                                          - const: CONTAINS
                                            type: string
                                          - const: EXISTS
                                            type: string
                                          - const: NOT_EXISTS
                                            type: string
                                      value: {}
                      authoredBy:
                        type: string
                      changeReason:
                        minLength: 1
                        maxLength: 500
                        type: string
                      checksum:
                        type: string
                      createdAt:
                        type: string
                      publishedAt:
                        anyOf:
                          - type: string
                          - type: "null"
                      retiredAt:
                        anyOf:
                          - type: string
                          - type: "null"
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - dsl
                - changeReason
              properties:
                dsl:
                  additionalProperties: false
                  type: object
                  required:
                    - schemaVersion
                    - rules
                  properties:
                    schemaVersion:
                      const: "1.0"
                      type: string
                    rules:
                      minItems: 1
                      maxItems: 100
                      type: array
                      items:
                        additionalProperties: false
                        type: object
                        required:
                          - id
                          - name
                          - severity
                          - reasonCode
                          - message
                        properties:
                          id:
                            minLength: 1
                            maxLength: 80
                            type: string
                          name:
                            minLength: 1
                            maxLength: 120
                            type: string
                          severity:
                            anyOf:
                              - const: FAIL
                                type: string
                              - const: WARN
                                type: string
                          reasonCode:
                            minLength: 1
                            maxLength: 80
                            type: string
                          message:
                            minLength: 1
                            maxLength: 300
                            type: string
                          all:
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - field
                                - operator
                              properties:
                                field:
                                  minLength: 1
                                  maxLength: 200
                                  type: string
                                operator:
                                  anyOf:
                                    - const: EQUALS
                                      type: string
                                    - const: NOT_EQUALS
                                      type: string
                                    - const: GREATER_THAN
                                      type: string
                                    - const: GREATER_THAN_OR_EQUAL
                                      type: string
                                    - const: LESS_THAN
                                      type: string
                                    - const: LESS_THAN_OR_EQUAL
                                      type: string
                                    - const: IN
                                      type: string
                                    - const: NOT_IN
                                      type: string
                                    - const: CONTAINS
                                      type: string
                                    - const: EXISTS
                                      type: string
                                    - const: NOT_EXISTS
                                      type: string
                                value: {}
                          any:
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - field
                                - operator
                              properties:
                                field:
                                  minLength: 1
                                  maxLength: 200
                                  type: string
                                operator:
                                  anyOf:
                                    - const: EQUALS
                                      type: string
                                    - const: NOT_EQUALS
                                      type: string
                                    - const: GREATER_THAN
                                      type: string
                                    - const: GREATER_THAN_OR_EQUAL
                                      type: string
                                    - const: LESS_THAN
                                      type: string
                                    - const: LESS_THAN_OR_EQUAL
                                      type: string
                                    - const: IN
                                      type: string
                                    - const: NOT_IN
                                      type: string
                                    - const: CONTAINS
                                      type: string
                                    - const: EXISTS
                                      type: string
                                    - const: NOT_EXISTS
                                      type: string
                                value: {}
                changeReason:
                  minLength: 1
                  maxLength: 500
                  type: string
                effectiveFrom:
                  type: string
                effectiveUntil:
                  type: string
            example:
              dsl:
                schemaVersion: "1.0"
                rules:
                  - id: EXEMPLO
                    name: Exemplo sintético
                    severity: FAIL
                    reasonCode: EXEMPLO
                    message: EXEMPLO
              changeReason: EXEMPLO
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/policies/{id}/versions/{versionId}/publish:
    post:
      summary: Publica e ativa uma versão da política, aposentando a versão vigente
        anterior
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - policyId
                      - tenantId
                      - version
                      - status
                      - dsl
                      - authoredBy
                      - changeReason
                      - checksum
                      - createdAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      policyId:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      version:
                        type: number
                      status:
                        anyOf:
                          - const: DRAFT
                            type: string
                          - const: PUBLISHED
                            type: string
                          - const: RETIRED
                            type: string
                      effectiveFrom:
                        anyOf:
                          - type: string
                          - type: "null"
                      effectiveUntil:
                        anyOf:
                          - type: string
                          - type: "null"
                      dsl:
                        additionalProperties: false
                        type: object
                        required:
                          - schemaVersion
                          - rules
                        properties:
                          schemaVersion:
                            const: "1.0"
                            type: string
                          rules:
                            minItems: 1
                            maxItems: 100
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - id
                                - name
                                - severity
                                - reasonCode
                                - message
                              properties:
                                id:
                                  minLength: 1
                                  maxLength: 80
                                  type: string
                                name:
                                  minLength: 1
                                  maxLength: 120
                                  type: string
                                severity:
                                  anyOf:
                                    - const: FAIL
                                      type: string
                                    - const: WARN
                                      type: string
                                reasonCode:
                                  minLength: 1
                                  maxLength: 80
                                  type: string
                                message:
                                  minLength: 1
                                  maxLength: 300
                                  type: string
                                all:
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - field
                                      - operator
                                    properties:
                                      field:
                                        minLength: 1
                                        maxLength: 200
                                        type: string
                                      operator:
                                        anyOf:
                                          - const: EQUALS
                                            type: string
                                          - const: NOT_EQUALS
                                            type: string
                                          - const: GREATER_THAN
                                            type: string
                                          - const: GREATER_THAN_OR_EQUAL
                                            type: string
                                          - const: LESS_THAN
                                            type: string
                                          - const: LESS_THAN_OR_EQUAL
                                            type: string
                                          - const: IN
                                            type: string
                                          - const: NOT_IN
                                            type: string
                                          - const: CONTAINS
                                            type: string
                                          - const: EXISTS
                                            type: string
                                          - const: NOT_EXISTS
                                            type: string
                                      value: {}
                                any:
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - field
                                      - operator
                                    properties:
                                      field:
                                        minLength: 1
                                        maxLength: 200
                                        type: string
                                      operator:
                                        anyOf:
                                          - const: EQUALS
                                            type: string
                                          - const: NOT_EQUALS
                                            type: string
                                          - const: GREATER_THAN
                                            type: string
                                          - const: GREATER_THAN_OR_EQUAL
                                            type: string
                                          - const: LESS_THAN
                                            type: string
                                          - const: LESS_THAN_OR_EQUAL
                                            type: string
                                          - const: IN
                                            type: string
                                          - const: NOT_IN
                                            type: string
                                          - const: CONTAINS
                                            type: string
                                          - const: EXISTS
                                            type: string
                                          - const: NOT_EXISTS
                                            type: string
                                      value: {}
                      authoredBy:
                        type: string
                      changeReason:
                        minLength: 1
                        maxLength: 500
                        type: string
                      checksum:
                        type: string
                      createdAt:
                        type: string
                      publishedAt:
                        anyOf:
                          - type: string
                          - type: "null"
                      retiredAt:
                        anyOf:
                          - type: string
                          - type: "null"
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
        - in: path
          name: versionId
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/policies/{id}/versions/{versionId}/retire:
    post:
      summary: Aposenta uma versão de política ativa ou em rascunho
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - policyId
                      - tenantId
                      - version
                      - status
                      - dsl
                      - authoredBy
                      - changeReason
                      - checksum
                      - createdAt
                    properties:
                      id:
                        format: uuid
                        type: string
                      policyId:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      version:
                        type: number
                      status:
                        anyOf:
                          - const: DRAFT
                            type: string
                          - const: PUBLISHED
                            type: string
                          - const: RETIRED
                            type: string
                      effectiveFrom:
                        anyOf:
                          - type: string
                          - type: "null"
                      effectiveUntil:
                        anyOf:
                          - type: string
                          - type: "null"
                      dsl:
                        additionalProperties: false
                        type: object
                        required:
                          - schemaVersion
                          - rules
                        properties:
                          schemaVersion:
                            const: "1.0"
                            type: string
                          rules:
                            minItems: 1
                            maxItems: 100
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - id
                                - name
                                - severity
                                - reasonCode
                                - message
                              properties:
                                id:
                                  minLength: 1
                                  maxLength: 80
                                  type: string
                                name:
                                  minLength: 1
                                  maxLength: 120
                                  type: string
                                severity:
                                  anyOf:
                                    - const: FAIL
                                      type: string
                                    - const: WARN
                                      type: string
                                reasonCode:
                                  minLength: 1
                                  maxLength: 80
                                  type: string
                                message:
                                  minLength: 1
                                  maxLength: 300
                                  type: string
                                all:
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - field
                                      - operator
                                    properties:
                                      field:
                                        minLength: 1
                                        maxLength: 200
                                        type: string
                                      operator:
                                        anyOf:
                                          - const: EQUALS
                                            type: string
                                          - const: NOT_EQUALS
                                            type: string
                                          - const: GREATER_THAN
                                            type: string
                                          - const: GREATER_THAN_OR_EQUAL
                                            type: string
                                          - const: LESS_THAN
                                            type: string
                                          - const: LESS_THAN_OR_EQUAL
                                            type: string
                                          - const: IN
                                            type: string
                                          - const: NOT_IN
                                            type: string
                                          - const: CONTAINS
                                            type: string
                                          - const: EXISTS
                                            type: string
                                          - const: NOT_EXISTS
                                            type: string
                                      value: {}
                                any:
                                  type: array
                                  items:
                                    additionalProperties: false
                                    type: object
                                    required:
                                      - field
                                      - operator
                                    properties:
                                      field:
                                        minLength: 1
                                        maxLength: 200
                                        type: string
                                      operator:
                                        anyOf:
                                          - const: EQUALS
                                            type: string
                                          - const: NOT_EQUALS
                                            type: string
                                          - const: GREATER_THAN
                                            type: string
                                          - const: GREATER_THAN_OR_EQUAL
                                            type: string
                                          - const: LESS_THAN
                                            type: string
                                          - const: LESS_THAN_OR_EQUAL
                                            type: string
                                          - const: IN
                                            type: string
                                          - const: NOT_IN
                                            type: string
                                          - const: CONTAINS
                                            type: string
                                          - const: EXISTS
                                            type: string
                                          - const: NOT_EXISTS
                                            type: string
                                      value: {}
                      authoredBy:
                        type: string
                      changeReason:
                        minLength: 1
                        maxLength: 500
                        type: string
                      checksum:
                        type: string
                      createdAt:
                        type: string
                      publishedAt:
                        anyOf:
                          - type: string
                          - type: "null"
                      retiredAt:
                        anyOf:
                          - type: string
                          - type: "null"
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
        - in: path
          name: versionId
          required: true
          schema:
            format: uuid
            type: string
          example: 00000000-0000-4000-8000-000000000001
  /api/v1/policies/evaluate:
    post:
      summary: Avalia deterministamente políticas ativas ou uma DSL inline de teste
        contra os fatos da operação
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - policyId
                      - policyVersion
                      - versionChecksum
                      - status
                      - violations
                      - reasonCodes
                      - warnings
                      - evidenceRefs
                      - evaluatedAt
                    properties:
                      policyId:
                        type: string
                      policyName:
                        type: string
                      policyVersion:
                        type: number
                      versionChecksum:
                        type: string
                      status:
                        anyOf:
                          - const: PASS
                            type: string
                          - const: WARN
                            type: string
                          - const: FAIL
                            type: string
                          - const: INDETERMINATE
                            type: string
                      violations:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - ruleId
                            - ruleName
                            - severity
                            - reasonCode
                            - message
                          properties:
                            ruleId:
                              type: string
                            ruleName:
                              type: string
                            severity:
                              anyOf:
                                - const: FAIL
                                  type: string
                                - const: WARN
                                  type: string
                            reasonCode:
                              type: string
                            message:
                              type: string
                            failedCondition:
                              additionalProperties: false
                              type: object
                              required:
                                - field
                                - operator
                              properties:
                                field:
                                  type: string
                                operator:
                                  anyOf:
                                    - const: EQUALS
                                      type: string
                                    - const: NOT_EQUALS
                                      type: string
                                    - const: GREATER_THAN
                                      type: string
                                    - const: GREATER_THAN_OR_EQUAL
                                      type: string
                                    - const: LESS_THAN
                                      type: string
                                    - const: LESS_THAN_OR_EQUAL
                                      type: string
                                    - const: IN
                                      type: string
                                    - const: NOT_IN
                                      type: string
                                    - const: CONTAINS
                                      type: string
                                    - const: EXISTS
                                      type: string
                                    - const: NOT_EXISTS
                                      type: string
                                expectedValue: {}
                                actualValue: {}
                      reasonCodes:
                        type: array
                        items:
                          type: string
                      warnings:
                        type: array
                        items:
                          type: string
                      evidenceRefs:
                        type: array
                        items:
                          type: string
                      evaluatedAt:
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Customer Policy Engine
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - facts
              properties:
                policyId:
                  format: uuid
                  type: string
                versionId:
                  format: uuid
                  type: string
                inlineDsl:
                  additionalProperties: false
                  type: object
                  required:
                    - schemaVersion
                    - rules
                  properties:
                    schemaVersion:
                      const: "1.0"
                      type: string
                    rules:
                      minItems: 1
                      maxItems: 100
                      type: array
                      items:
                        additionalProperties: false
                        type: object
                        required:
                          - id
                          - name
                          - severity
                          - reasonCode
                          - message
                        properties:
                          id:
                            minLength: 1
                            maxLength: 80
                            type: string
                          name:
                            minLength: 1
                            maxLength: 120
                            type: string
                          severity:
                            anyOf:
                              - const: FAIL
                                type: string
                              - const: WARN
                                type: string
                          reasonCode:
                            minLength: 1
                            maxLength: 80
                            type: string
                          message:
                            minLength: 1
                            maxLength: 300
                            type: string
                          all:
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - field
                                - operator
                              properties:
                                field:
                                  minLength: 1
                                  maxLength: 200
                                  type: string
                                operator:
                                  anyOf:
                                    - const: EQUALS
                                      type: string
                                    - const: NOT_EQUALS
                                      type: string
                                    - const: GREATER_THAN
                                      type: string
                                    - const: GREATER_THAN_OR_EQUAL
                                      type: string
                                    - const: LESS_THAN
                                      type: string
                                    - const: LESS_THAN_OR_EQUAL
                                      type: string
                                    - const: IN
                                      type: string
                                    - const: NOT_IN
                                      type: string
                                    - const: CONTAINS
                                      type: string
                                    - const: EXISTS
                                      type: string
                                    - const: NOT_EXISTS
                                      type: string
                                value: {}
                          any:
                            type: array
                            items:
                              additionalProperties: false
                              type: object
                              required:
                                - field
                                - operator
                              properties:
                                field:
                                  minLength: 1
                                  maxLength: 200
                                  type: string
                                operator:
                                  anyOf:
                                    - const: EQUALS
                                      type: string
                                    - const: NOT_EQUALS
                                      type: string
                                    - const: GREATER_THAN
                                      type: string
                                    - const: GREATER_THAN_OR_EQUAL
                                      type: string
                                    - const: LESS_THAN
                                      type: string
                                    - const: LESS_THAN_OR_EQUAL
                                      type: string
                                    - const: IN
                                      type: string
                                    - const: NOT_IN
                                      type: string
                                    - const: CONTAINS
                                      type: string
                                    - const: EXISTS
                                      type: string
                                    - const: NOT_EXISTS
                                      type: string
                                value: {}
                facts:
                  type: object
                  patternProperties:
                    ^(.*)$: {}
                evaluatedAt:
                  type: string
            example:
              facts: {}
      parameters: []
  /api/v1/simulations/scenarios:
    post:
      summary: Executa simulação comparativa entre múltiplos cenários operacionais de
        transporte (Zero Side Effects)
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - simulationId
                      - tenantId
                      - mode
                      - scenarios
                      - diffs
                      - recommendations
                      - simulatedAt
                      - checksum
                    properties:
                      simulationId:
                        format: uuid
                        type: string
                      tenantId:
                        format: uuid
                        type: string
                      mode:
                        const: SIMULATION
                        type: string
                      scenarios:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - scenarioId
                            - scenarioName
                            - distanceKm
                            - durationSeconds
                            - tollAmountBrl
                            - minimumFloorBrl
                            - estimatedFuelLiters
                            - estimatedFuelCostBrl
                            - emissionsKgCo2e
                            - estimatedTotalCostBrl
                            - policyStatus
                            - policyViolationsCount
                            - policyViolations
                            - dataOrigin
                            - warnings
                          properties:
                            scenarioId:
                              type: string
                            scenarioName:
                              type: string
                            distanceKm:
                              anyOf:
                                - type: number
                                - type: "null"
                            durationSeconds:
                              anyOf:
                                - type: number
                                - type: "null"
                            tollAmountBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            minimumFloorBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            estimatedFuelLiters:
                              anyOf:
                                - type: number
                                - type: "null"
                            estimatedFuelCostBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            emissionsKgCo2e:
                              anyOf:
                                - type: number
                                - type: "null"
                            estimatedTotalCostBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            policyStatus:
                              anyOf:
                                - const: PASS
                                  type: string
                                - const: WARN
                                  type: string
                                - const: FAIL
                                  type: string
                                - const: INDETERMINATE
                                  type: string
                                - const: NOT_EVALUATED
                                  type: string
                            policyViolationsCount:
                              type: number
                            policyViolations:
                              type: array
                              items:
                                type: object
                                required:
                                  - policyId
                                  - ruleId
                                  - reasonCode
                                  - message
                                  - severity
                                properties:
                                  policyId:
                                    type: string
                                  ruleId:
                                    type: string
                                  reasonCode:
                                    type: string
                                  message:
                                    type: string
                                  severity:
                                    anyOf:
                                      - const: FAIL
                                        type: string
                                      - const: WARN
                                        type: string
                            dataOrigin:
                              type: string
                            warnings:
                              type: array
                              items:
                                type: string
                      diffs:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - baselineScenarioId
                            - baselineScenarioName
                            - targetScenarioId
                            - targetScenarioName
                            - deltaDistanceKm
                            - deltaTollBrl
                            - deltaFloorBrl
                            - deltaFuelLiters
                            - deltaFuelCostBrl
                            - deltaEmissionsKgCo2e
                            - deltaTotalCostBrl
                            - policyOutcomeChange
                          properties:
                            baselineScenarioId:
                              type: string
                            baselineScenarioName:
                              type: string
                            targetScenarioId:
                              type: string
                            targetScenarioName:
                              type: string
                            deltaDistanceKm:
                              anyOf:
                                - type: number
                                - type: "null"
                            deltaTollBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            deltaFloorBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            deltaFuelLiters:
                              anyOf:
                                - type: number
                                - type: "null"
                            deltaFuelCostBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            deltaEmissionsKgCo2e:
                              anyOf:
                                - type: number
                                - type: "null"
                            deltaTotalCostBrl:
                              anyOf:
                                - type: number
                                - type: "null"
                            policyOutcomeChange:
                              anyOf:
                                - const: IMPROVED
                                  type: string
                                - const: DEGRADED
                                  type: string
                                - const: UNCHANGED
                                  type: string
                      recommendations:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - criteria
                            - bestScenarioId
                            - bestScenarioName
                            - explanation
                            - semanticWarning
                          properties:
                            criteria:
                              anyOf:
                                - const: LOWEST_TOTAL_COST
                                  type: string
                                - const: LOWEST_EMISSIONS
                                  type: string
                                - const: SHORTEST_DISTANCE
                                  type: string
                                - const: HIGHEST_COMPLIANCE
                                  type: string
                            bestScenarioId:
                              type: string
                            bestScenarioName:
                              type: string
                            explanation:
                              type: string
                            semanticWarning:
                              type: string
                      simulatedAt:
                        type: string
                      checksum:
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
                      apiVersion:
                        const: v1
                        type: string
                      nextCursor:
                        anyOf:
                          - minLength: 1
                            type: string
                          - type: "null"
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Digital Twin & Simulation
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - scenarios
              properties:
                scenarios:
                  minItems: 1
                  maxItems: 10
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - id
                      - name
                      - origin
                      - destination
                    properties:
                      id:
                        minLength: 1
                        maxLength: 80
                        type: string
                      name:
                        minLength: 1
                        maxLength: 120
                        type: string
                      description:
                        maxLength: 500
                        type: string
                      origin:
                        minLength: 1
                        maxLength: 200
                        type: string
                      destination:
                        minLength: 1
                        maxLength: 200
                        type: string
                      waypoints:
                        type: array
                        items:
                          minLength: 1
                          maxLength: 200
                          type: string
                      vehicleAxles:
                        minimum: 2
                        maximum: 12
                        type: integer
                      vehiclePbtcKg:
                        minimum: 1000
                        maximum: 150000
                        type: number
                      fuelType:
                        anyOf:
                          - const: DIESEL_S10
                            type: string
                          - const: DIESEL_S500
                            type: string
                          - const: GASOLINE
                            type: string
                          - const: ETHANOL
                            type: string
                          - const: CNG
                            type: string
                          - const: ELECTRIC
                            type: string
                      fuelConsumptionKmPerLiter:
                        minimum: 0.5
                        maximum: 30
                        type: number
                      cargoType:
                        maxLength: 80
                        type: string
                      cargoWeightKg:
                        minimum: 0
                        maximum: 150000
                        type: number
                      agreedFreightBrl:
                        minimum: 0
                        type: number
                      policyIds:
                        type: array
                        items:
                          type: string
                      referenceDate:
                        type: string
                referenceDate:
                  type: string
            example:
              scenarios:
                - id: EXEMPLO
                  name: Exemplo sintético
                  origin: São Paulo, SP
                  destination: Curitiba, PR
      parameters: []
  /api/v1/admin/ebook/status:
    get:
      summary: GET /api/v1/admin/ebook/status
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - exists
                      - filename
                      - sizeBytes
                      - sizeKb
                      - sizeFormatted
                      - downloadUrl
                      - isCustomUpload
                    properties:
                      exists:
                        description: Indica se o arquivo PDF do e-book está disponível
                        type: boolean
                      filename:
                        description: Nome do arquivo PDF oficial
                        type: string
                      sizeBytes:
                        description: Tamanho do arquivo em bytes
                        type: number
                      sizeKb:
                        description: Tamanho do arquivo em kilobytes
                        type: number
                      sizeFormatted:
                        description: Tamanho formatado para exibição amigável
                        type: string
                      updatedAt:
                        description: Data/hora ISO da última modificação
                        type: string
                      downloadUrl:
                        description: URL pública relativa ou absoluta de download do e-book
                        type: string
                      isCustomUpload:
                        description: Indica se o arquivo atual foi enviado manualmente via upload
                        type: boolean
                      coverUrl:
                        description: URL pública da imagem de capa do e-book
                        type: string
                      coverSizeBytes:
                        description: Tamanho em bytes da imagem de capa
                        type: number
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/ebook/upload:
    post:
      summary: POST /api/v1/admin/ebook/upload
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - success
                      - message
                      - filename
                      - sizeBytes
                      - sizeFormatted
                      - downloadUrl
                      - updatedAt
                    properties:
                      success:
                        const: true
                        type: boolean
                      message:
                        type: string
                      filename:
                        type: string
                      sizeBytes:
                        type: number
                      sizeFormatted:
                        type: string
                      downloadUrl:
                        type: string
                      updatedAt:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/ebook/cover:
    post:
      summary: POST /api/v1/admin/ebook/cover
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - success
                      - message
                      - coverUrl
                      - sizeBytes
                      - updatedAt
                    properties:
                      success:
                        const: true
                        type: boolean
                      message:
                        type: string
                      coverUrl:
                        type: string
                      sizeBytes:
                        type: number
                      updatedAt:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/ebook:
    delete:
      summary: DELETE /api/v1/admin/ebook
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - success
                      - message
                      - restoredDefault
                    properties:
                      success:
                        const: true
                        type: boolean
                      message:
                        type: string
                      restoredDefault:
                        type: boolean
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/public/ebook-leads:
    post:
      summary: POST /api/v1/public/ebook-leads
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - success
                      - message
                      - downloadUrl
                      - leadId
                    properties:
                      success:
                        const: true
                        type: boolean
                      message:
                        type: string
                      downloadUrl:
                        type: string
                      leadId:
                        type: string
                      lead:
                        additionalProperties: false
                        type: object
                        required:
                          - id
                          - name
                          - email
                          - capturedAt
                        properties:
                          id:
                            description: Identificador único do lead
                            type: string
                          name:
                            description: Nome completo
                            type: string
                          email:
                            description: E-mail cadastrado
                            type: string
                          company:
                            description: Empresa informada (ou vazio)
                            type: string
                          capturedAt:
                            description: Data/hora ISO da captura do lead
                            type: string
                          source:
                            description: Origem da captura
                            type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - name
                - email
              properties:
                name:
                  minLength: 2
                  maxLength: 160
                  description: Nome completo do lead
                  type: string
                email:
                  format: email
                  maxLength: 255
                  description: E-mail corporativo ou pessoal
                  type: string
                company:
                  maxLength: 160
                  description: Nome da transportadora ou empresa (opcional)
                  type: string
            example:
              name: Exemplo sintético
              email: exemplo@example.com
      parameters: []
  /api/v1/admin/ebook/leads:
    get:
      summary: GET /api/v1/admin/ebook/leads
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - leads
                      - total
                      - page
                      - limit
                      - totalPages
                    properties:
                      leads:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - id
                            - name
                            - email
                            - capturedAt
                          properties:
                            id:
                              description: Identificador único do lead
                              type: string
                            name:
                              description: Nome completo
                              type: string
                            email:
                              description: E-mail cadastrado
                              type: string
                            company:
                              description: Empresa informada (ou vazio)
                              type: string
                            capturedAt:
                              description: Data/hora ISO da captura do lead
                              type: string
                            source:
                              description: Origem da captura
                              type: string
                      items:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - id
                            - name
                            - email
                            - capturedAt
                          properties:
                            id:
                              description: Identificador único do lead
                              type: string
                            name:
                              description: Nome completo
                              type: string
                            email:
                              description: E-mail cadastrado
                              type: string
                            company:
                              description: Empresa informada (ou vazio)
                              type: string
                            capturedAt:
                              description: Data/hora ISO da captura do lead
                              type: string
                            source:
                              description: Origem da captura
                              type: string
                      total:
                        description: Total de leads capturados
                        type: integer
                      today:
                        description: Leads cadastrados hoje
                        type: integer
                      page:
                        description: Página atual
                        type: integer
                      limit:
                        description: Limite de itens por página
                        type: integer
                      totalPages:
                        description: Total de páginas calculadas
                        type: integer
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters:
        - in: query
          name: search
          required: false
          schema:
            description: Termo de busca por nome, e-mail ou empresa
            type: string
        - in: query
          name: page
          required: false
          schema:
            minimum: 1
            default: 1
            description: Número da página
            type: integer
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 500
            default: 50
            description: Itens por página
            type: integer
  /api/v1/admin/ebook/leads/export:
    get:
      summary: GET /api/v1/admin/ebook/leads/export
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/ebook/email-logs:
    get:
      summary: GET /api/v1/admin/ebook/email-logs
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - logs
                      - total
                      - sent
                      - failed
                      - successRate
                    properties:
                      logs:
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - id
                            - recipientEmail
                            - recipientName
                            - status
                            - sentAt
                            - source
                          properties:
                            id:
                              description: Identificador único do log de envio
                              type: string
                            recipientEmail:
                              description: E-mail de destino
                              type: string
                            recipientName:
                              description: Nome do destinatário
                              type: string
                            company:
                              description: Empresa do destinatário (se informada)
                              type: string
                            status:
                              description: Status da entrega do e-mail
                              anyOf:
                                - const: SENT
                                  type: string
                                - const: FAILED
                                  type: string
                            messageId:
                              description: ID da mensagem retornado pelo Brevo
                              type: string
                            errorMessage:
                              description: Mensagem de erro caso o envio falhe
                              type: string
                            sentAt:
                              description: Data/hora ISO do envio
                              type: string
                            source:
                              description: Origem do disparo
                              anyOf:
                                - const: POPUP_LEAD
                                  type: string
                                - const: ADMIN_TEST
                                  type: string
                                - const: ADMIN_MANUAL
                                  type: string
                      total:
                        description: Total de e-mails disparados
                        type: integer
                      sent:
                        description: E-mails enviados com sucesso
                        type: integer
                      failed:
                        description: E-mails que falharam
                        type: integer
                      successRate:
                        description: Taxa de sucesso percentual (0 a 100)
                        type: number
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      parameters: []
  /api/v1/admin/ebook/send-test-email:
    post:
      summary: POST /api/v1/admin/ebook/send-test-email
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - success
                      - message
                      - messageId
                      - recipientEmail
                      - sentAt
                    properties:
                      success:
                        const: true
                        type: boolean
                      message:
                        type: string
                      messageId:
                        type: string
                      recipientEmail:
                        type: string
                      sentAt:
                        type: string
                  meta:
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "401":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "403":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "500":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - recipientEmail
              properties:
                recipientEmail:
                  format: email
                  description: E-mail para envio de teste do e-book
                  type: string
                recipientName:
                  maxLength: 160
                  description: Nome do destinatário no teste
                  type: string
            example:
              recipientEmail: exemplo@example.com
      parameters: []
  /api/v1/public/newsletter-subscriptions:
    post:
      summary: Registra consentimento para a newsletter técnica do Geodagio.
      responses:
        "200":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    additionalProperties: false
                    type: object
                    required:
                      - status
                      - message
                      - registeredAt
                    properties:
                      status:
                        anyOf:
                          - const: SUBSCRIBED
                            type: string
                          - const: ALREADY_SUBSCRIBED
                            type: string
                      message:
                        type: string
                      registeredAt:
                        format: date-time
                        type: string
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                      - apiVersion
                    properties:
                      requestId:
                        type: string
                      apiVersion:
                        const: v1
                        type: string
        "400":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
        "429":
          description: Resposta registrada no endpoint.
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    additionalProperties: false
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        minLength: 1
                        type: string
                      message:
                        minLength: 1
                        type: string
                      details:
                        type: object
                        patternProperties:
                          ^(.*)$: {}
                  meta:
                    additionalProperties: false
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        minLength: 8
                        maxLength: 128
                        type: string
      tags:
        - Newsletter
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - email
                - consent
                - consentVersion
                - sourcePage
              properties:
                email:
                  format: email
                  maxLength: 255
                  type: string
                consent:
                  description: Confirmação explícita para receber conteúdos e comunicações do
                    Geodagio.
                  const: true
                  type: boolean
                consentVersion:
                  const: 2026-09-26
                  type: string
                sourcePage:
                  minLength: 1
                  maxLength: 512
                  pattern: ^/
                  type: string
                website:
                  maxLength: 200
                  description: Campo invisível de proteção contra automação.
                  type: string
            example:
              email: operacoes@example.com
              consent: true
              consentVersion: 2026-09-26
              sourcePage: /blog/roteirizacao-caminhoes-menor-distancia-versus-menor-custo/
      parameters: []
servers:
  - url: /
tags:
  - name: Routes
  - name: Imports
  - name: Billing
  - name: Fiscal
  - name: Accounting
  - name: API Keys
  - name: Platform
  - name: Financial Alerts
  - name: Financial & Fiscal Center
  - name: Reference
  - name: Freight Floor
  - name: Health
