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
            - 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
            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
              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
      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
      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-24:
      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-25:
      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-26:
      additionalProperties: false
      type: object
      required:
        - from
        - to
      properties:
        from:
          format: date-time
          type: string
        to:
          format: date-time
          type: string
      title: BillingUsageQuery
    def-27:
      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-28:
      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-29:
      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-30:
      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-31:
      additionalProperties: false
      type: object
      required:
        - recipientEmail
      properties:
        recipientEmail:
          format: email
          maxLength: 254
          type: string
      title: TestEmailRequest
    def-32:
      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-33:
      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-34:
      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:
                - 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-35:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-34"
        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-36:
      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-37:
      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-38:
      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-39:
      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-40:
      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-41:
      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-42:
      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-43:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-42"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: ReferenceSummaryResponse
    def-44:
      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:
                - minLength: 1
                  type: string
                - type: "null"
      title: TollSourcesResponse
    def-45:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-40"
        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-46:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/def-41"
        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-47:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-39"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollSourceResponse
    def-48:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-40"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollPointResponse
    def-49:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-41"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollRateResponse
    def-50:
      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-51:
      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-52:
      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-53:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 200
          default: 50
          type: integer
        cursor:
          minLength: 1
          type: string
      title: TollSourcesQuery
    def-54:
      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-55:
      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-56:
      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-57:
      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-56"
        meta:
          additionalProperties: false
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              minLength: 8
              maxLength: 128
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: TollSyncResponse
    def-58:
      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-59:
      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-60:
      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-61:
      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-62:
      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-63:
      additionalProperties: false
      type: object
      required:
        - id
      properties:
        id:
          format: uuid
          type: string
      title: ImportJobParams
    def-64:
      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-65:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-64"
        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-66:
      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-67:
      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-68:
      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-69:
      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-70:
      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-67"
        emptyReturn:
          $ref: "#/components/schemas/def-68"
        options:
          additionalProperties: false
          type: object
          properties:
            includeTolls:
              type: boolean
      title: FreightFloorCalculateRequest
    def-71:
      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-67"
        emptyReturn:
          $ref: "#/components/schemas/def-68"
        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-69"
      title: FreightFloorValidateRequest
    def-72:
      additionalProperties: false
      type: object
      required:
        - calculations
      properties:
        calculations:
          minItems: 1
          maxItems: 100
          type: array
          items:
            $ref: "#/components/schemas/def-70"
      title: BatchFreightFloorRequest
    def-73:
      additionalProperties: false
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 100
          default: 25
          type: integer
        cursor:
          type: string
      title: FreightFloorListQuery
    def-74:
      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-75:
      additionalProperties: false
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: "#/components/schemas/def-74"
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: FreightFloorCalculationResponse
    def-76:
      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-74"
        meta:
          type: object
          required:
            - requestId
            - apiVersion
          properties:
            requestId:
              type: string
            apiVersion:
              type: string
              enum:
                - v1
      title: FreightFloorValidationResponse
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-75"
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-75"
        "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-76"
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-76"
        "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/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-75"
        "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-65"
        "202":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-65"
        "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
                      - 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
                      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
                        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 owner ou admin do tenant.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          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"
  /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-24"
      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-23"
        "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/portal:
    post:
      summary: Cria portal do cliente quando o gateway oferece essa capacidade.
      tags:
        - Billing
      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: Endpoint sem autenticação de usuário; exige assinatura do provider
        sobre o corpo bruto.
      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:
                  - received
                properties:
                  received:
                    type: boolean
        "400":
          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-27"
        "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-25"
        "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-28"
        "401":
          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-30"
        "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-33"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-30"
        "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-31"
      security:
        - bearerAuth: []
      responses:
        "202":
          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/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-29"
        "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-35"
        "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-36"
        "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-37"
      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-38"
        "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-44"
  /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-61"
        "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-59"
      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-62"
        "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-60"
      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-62"
        "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-45"
  /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-46"
  /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-43"
  /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-50"
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-47"
        "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-51"
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-48"
        "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-52"
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/def-49"
        "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-57"
        "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: {}
                  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:
                  type: object
                  additionalProperties: {}
                confirmChecklist:
                  type: boolean
      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:
    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: {}
                  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
      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: 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/stops/ppd:
    get:
      summary: Pesquisa Pontos de Parada e Descanso (PPD) certificados por estado,
        município ou rodovia
      tags:
        - Stops & PPD
      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: stops-intelligence
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters:
        - in: query
          name: state
          required: false
          schema:
            minLength: 2
            maxLength: 2
            type: string
        - in: query
          name: municipality
          required: false
          schema:
            minLength: 2
            type: string
        - in: query
          name: road
          required: false
          schema:
            minLength: 2
            type: string
        - in: query
          name: status
          required: false
          schema:
            type: string
        - in: query
          name: limit
          required: false
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: integer
  /api/v1/stops/ppd/{id}:
    get:
      summary: Consulta detalhes e certificação oficial de um PPD por ID
      tags:
        - Stops & PPD
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
      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: stops-intelligence
      x-module-status: PAUSED
      x-runtime-contract: true
  /api/v1/stops/route:
    post:
      summary: Localiza paradas (PPDs certificados e Postos ANP) no corredor da rota
      tags:
        - Stops & PPD
      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: stops-intelligence
      x-module-status: PAUSED
      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
                types:
                  type: array
                  items:
                    anyOf:
                      - const: CERTIFIED_PPD
                        type: string
                      - const: AUTHORIZED_FUEL_STATION
                        type: string
                      - const: OTHER_ROADSIDE_STOP
                        type: string
                      - const: UNKNOWN
                        type: string
                corridorMeters:
                  minimum: 500
                  maximum: 50000
                  default: 5000
                  type: integer
                limit:
                  minimum: 1
                  maximum: 200
                  default: 50
                  type: integer
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              types:
                - CERTIFIED_PPD
              corridorMeters: 5000
      parameters: []
  /api/v1/stops/route/coverage:
    post:
      summary: Avalia a cobertura de PPDs e identifica lacunas/gaps de paradas na viagem
      tags:
        - Stops & PPD
      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: stops-intelligence
      x-module-status: PAUSED
      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
                thresholdKm:
                  minimum: 50
                  maximum: 1000
                  default: 200
                  type: number
                corridorMeters:
                  minimum: 500
                  maximum: 50000
                  default: 5000
                  type: integer
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              thresholdKm: 200
      parameters: []
  /api/v1/stops/plan:
    post:
      summary: Gera plano operacional de paradas respeitando as restrições configuradas
      tags:
        - Stops & PPD
      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: stops-intelligence
      x-module-status: PAUSED
      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
                constraints:
                  type: object
                  properties:
                    maxLegKm:
                      minimum: 50
                      maximum: 1000
                      default: 300
                      type: number
                    maxLegMinutes:
                      minimum: 30
                      maximum: 720
                      type: integer
                    preferredStopTypes:
                      type: array
                      items:
                        anyOf:
                          - const: CERTIFIED_PPD
                            type: string
                          - const: AUTHORIZED_FUEL_STATION
                            type: string
                          - const: OTHER_ROADSIDE_STOP
                            type: string
                          - const: UNKNOWN
                            type: string
                    requiredAmenities:
                      type: array
                      items:
                        type: string
                    minParkingSpaces:
                      minimum: 1
                      type: integer
                    corridorMeters:
                      minimum: 500
                      maximum: 50000
                      default: 5000
                      type: integer
            example:
              origin: São Paulo, SP
              destination: Curitiba, PR
              constraints:
                maxLegKm: 300
                preferredStopTypes:
                  - CERTIFIED_PPD
      parameters: []
  /api/v1/stops/watch:
    get:
      summary: Lista alvos de monitoramento de PPDs e rodovias do tenant
      tags:
        - Stops 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: stops-intelligence
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
    post:
      summary: Adiciona uma rodovia ou estado ao monitoramento de novos PPDs
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Stops Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: stops-intelligence
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                road:
                  type: string
                state:
                  minLength: 2
                  maxLength: 2
                  type: string
                label:
                  maxLength: 120
                  type: string
            example:
              road: BR-116
              state: SP
              label: Paradas na BR-116
      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
      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:
                            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:
                        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:
                            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:
                            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: PAUSED
      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: PAUSED
      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: PAUSED
      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 e auditoria cruzada entre CT-e e MDF-e com checagem de
        RNTRC, piso e rota
      tags:
        - DFe Transport Compliance
      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: 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: PAUSED
      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/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: PAUSED
      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: PAUSED
      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: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/drivers/validate:
    post:
      summary: Validação de validade da CNH, EAR, toxicológico e compatibilidade de
        categoria
      tags:
        - Driver & CNH Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cpf
              properties:
                cpf:
                  minLength: 11
                  maxLength: 14
                  type: string
                profile: {}
                requiredCategory:
                  anyOf:
                    - const: B
                      type: string
                    - const: C
                      type: string
                    - const: D
                      type: string
                    - const: E
                      type: string
                isHazardousCargo:
                  type: boolean
                isOversizedCargo:
                  type: boolean
                isPassengerTransport:
                  type: boolean
                environment:
                  anyOf:
                    - const: PRODUCTION
                      type: string
                    - const: SANDBOX
                      type: string
                useSandboxMock:
                  type: boolean
            example:
              cpf: "00000000000"
      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: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/drivers/operation-precheck:
    post:
      summary: Validação cruzada de aptidão do condutor frente ao tipo de veículo e
        carga
      tags:
        - Driver & CNH Compliance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cpf
                - vehicleType
                - requiredCategory
              properties:
                cpf:
                  minLength: 11
                  maxLength: 14
                  type: string
                vehicleType:
                  minLength: 2
                  type: string
                requiredCategory:
                  anyOf:
                    - const: B
                      type: string
                    - const: C
                      type: string
                    - const: D
                      type: string
                    - const: E
                      type: string
                isHazardousCargo:
                  type: boolean
                isOversizedCargo:
                  type: boolean
                isPassengerTransport:
                  type: boolean
            example:
              cpf: "00000000000"
              vehicleType: TRUCK
              requiredCategory: C
      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: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/drivers/history:
    get:
      summary: Histórico auditável de validações de condutores do tenant
      tags:
        - Driver & CNH 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: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/ciot/prevalidate:
    post:
      summary: Pré-validação regulatória do CIOT frente ao Piso Mínimo ANTT e
        Vale-Pedágio
      tags:
        - CIOT Intelligence & Integration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contractorType
                - hiredTransporterType
                - agreedFreight
                - mandatoryMinimumFloor
                - tollValueRequired
                - tollValueProvided
              properties:
                contractorType:
                  anyOf:
                    - const: ETC
                      type: string
                    - const: CTC
                      type: string
                    - const: EMBARCADOR
                      type: string
                hiredTransporterType:
                  anyOf:
                    - const: TAC
                      type: string
                    - const: TAC_EQUIPADO
                      type: string
                    - const: ETC_EQUIPADO
                      type: string
                    - const: ETC_STANDARD
                      type: string
                agreedFreight:
                  minimum: 0
                  type: number
                mandatoryMinimumFloor:
                  minimum: 0
                  type: number
                tollValueRequired:
                  minimum: 0
                  type: number
                tollValueProvided:
                  minimum: 0
                  type: number
            example:
              contractorType: ETC
              hiredTransporterType: TAC
              agreedFreight: 0
              mandatoryMinimumFloor: 0
              tollValueRequired: 0
              tollValueProvided: 0
      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: ciot-integration
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/ciot/register:
    post:
      summary: Cadastra contrato de transporte e solicita geração do código CIOT
      tags:
        - CIOT Intelligence & Integration
      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: ciot-integration
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - operationType
                - contractor
                - hiredTransporter
                - driverCpfMasked
                - vehiclePlate
                - originCityCode
                - originUf
                - destinationCityCode
                - destinationUf
                - distanceKm
                - cargo
                - payment
                - validityStartDate
                - validityEndDate
                - issues
                - warnings
              properties:
                operationType:
                  anyOf:
                    - const: STANDARD
                      type: string
                    - const: AGGREGATED
                      type: string
                contractor:
                  type: object
                  required:
                    - document
                    - name
                    - uf
                  properties:
                    document:
                      minLength: 11
                      type: string
                    name:
                      minLength: 2
                      type: string
                    rntrc:
                      type: string
                    uf:
                      minLength: 2
                      maxLength: 2
                      type: string
                hiredTransporter:
                  type: object
                  required:
                    - document
                    - name
                    - uf
                  properties:
                    document:
                      minLength: 11
                      type: string
                    name:
                      minLength: 2
                      type: string
                    rntrc:
                      type: string
                    uf:
                      minLength: 2
                      maxLength: 2
                      type: string
                driverCpfMasked:
                  minLength: 11
                  type: string
                vehiclePlate:
                  minLength: 7
                  maxLength: 8
                  type: string
                originCityCode:
                  type: string
                originUf:
                  minLength: 2
                  maxLength: 2
                  type: string
                destinationCityCode:
                  type: string
                destinationUf:
                  minLength: 2
                  maxLength: 2
                  type: string
                distanceKm:
                  minimum: 0
                  type: number
                cargo:
                  type: object
                  required:
                    - cargoValue
                    - cargoWeightKg
                    - predominantProduct
                    - hazardous
                  properties:
                    cargoValue:
                      minimum: 0
                      type: number
                    cargoWeightKg:
                      minimum: 0
                      type: number
                    predominantProduct:
                      type: string
                    hazardous:
                      type: boolean
                payment:
                  type: object
                  required:
                    - freightValue
                    - minimumFloorValue
                    - isFloorCompliant
                    - tollValue
                    - paymentMethod
                  properties:
                    freightValue:
                      minimum: 0
                      type: number
                    minimumFloorValue:
                      minimum: 0
                      type: number
                    isFloorCompliant:
                      type: boolean
                    tollValue:
                      minimum: 0
                      type: number
                    paymentMethod:
                      anyOf:
                        - const: IPE_ELECTRONIC
                          type: string
                        - const: BANK_TRANSFER
                          type: string
                        - const: CARD
                          type: string
                validityStartDate:
                  type: string
                validityEndDate:
                  type: string
                issues:
                  type: array
                  items:
                    type: string
                warnings:
                  type: array
                  items:
                    type: string
            example:
              operationType: STANDARD
              contractor:
                document: "00000000000191"
                name: Exemplo sintético
                uf: SP
              hiredTransporter:
                document: "00000000000191"
                name: Exemplo sintético
                uf: SP
              driverCpfMasked: "00000000000"
              vehiclePlate: ABC1D23
              originCityCode: "3550308"
              originUf: SP
              destinationCityCode: "4106902"
              destinationUf: PR
              distanceKm: 0
              cargo:
                cargoValue: 0
                cargoWeightKg: 0
                predominantProduct: EXEMPLO
                hazardous: false
              payment:
                freightValue: 0
                minimumFloorValue: 0
                isFloorCompliant: false
                tollValue: 0
                paymentMethod: IPE_ELECTRONIC
              validityStartDate: 2026-09-03
              validityEndDate: 2026-09-04
              issues:
                - EXEMPLO
              warnings:
                - EXEMPLO
      parameters: []
  /api/v1/ciot/history:
    get:
      summary: Lista histórico auditável de operações de CIOT do tenant
      tags:
        - CIOT Intelligence & Integration
      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: ciot-integration
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/vpo/calculate:
    post:
      summary: Avalia obrigatoriedade, valor total previsto e pórticos Free Flow para
        Vale-Pedágio
      tags:
        - VPO Operations & Reconciliation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contractorType
                - carrierType
                - isOwnFleet
                - routeTollTotal
                - plazas
              properties:
                contractorType:
                  anyOf:
                    - const: EMBARCADOR
                      type: string
                    - const: ETC
                      type: string
                    - const: TAC
                      type: string
                carrierType:
                  anyOf:
                    - const: TAC
                      type: string
                    - const: ETC
                      type: string
                    - const: CTC
                      type: string
                isOwnFleet:
                  type: boolean
                routeTollTotal:
                  minimum: 0
                  type: number
                plazas:
                  type: array
                  items:
                    type: object
                    required:
                      - plazaId
                      - name
                      - concessionaire
                      - amount
                      - isFreeFlow
                    properties:
                      plazaId:
                        type: string
                      name:
                        type: string
                      concessionaire:
                        type: string
                      amount:
                        minimum: 0
                        type: number
                      isFreeFlow:
                        type: boolean
            example:
              contractorType: EMBARCADOR
              carrierType: TAC
              isOwnFleet: false
              routeTollTotal: 0
              plazas:
                - plazaId: EXEMPLO
                  name: Exemplo sintético
                  concessionaire: EXEMPLO
                  amount: 0
                  isFreeFlow: 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: vpo-operations
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/vpo/provision:
    post:
      summary: Provisiona antecipadamente o Vale-Pedágio junto à fornecedora
        homologada (FVPO)
      tags:
        - VPO Operations & Reconciliation
      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: vpo-operations
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contractorDocument
                - carrierDocument
                - carrierType
                - vehiclePlate
                - vehicleAxles
                - expectedTollTotal
                - plazas
              properties:
                operationId:
                  type: string
                contractorDocument:
                  minLength: 11
                  type: string
                carrierDocument:
                  minLength: 11
                  type: string
                carrierType:
                  anyOf:
                    - const: TAC
                      type: string
                    - const: ETC
                      type: string
                    - const: CTC
                      type: string
                vehiclePlate:
                  minLength: 7
                  maxLength: 8
                  type: string
                vehicleAxles:
                  minimum: 2
                  type: number
                expectedTollTotal:
                  minimum: 0
                  type: number
                plazas:
                  type: array
                  items:
                    type: object
                    required:
                      - plazaId
                      - name
                      - concessionaire
                      - amount
                      - isFreeFlow
                    properties:
                      plazaId:
                        type: string
                      name:
                        type: string
                      concessionaire:
                        type: string
                      amount:
                        minimum: 0
                        type: number
                      isFreeFlow:
                        type: boolean
                preferredFvpoId:
                  type: string
                medium:
                  anyOf:
                    - const: TAG
                      type: string
                    - const: CARD
                      type: string
                    - const: TICKET
                      type: string
            example:
              contractorDocument: "00000000000"
              carrierDocument: "00000000000"
              carrierType: TAC
              vehiclePlate: ABC1D23
              vehicleAxles: 2
              expectedTollTotal: 0
              plazas:
                - plazaId: EXEMPLO
                  name: Exemplo sintético
                  concessionaire: EXEMPLO
                  amount: 0
                  isFreeFlow: false
      parameters: []
  /api/v1/vpo/{id}/reconcile:
    post:
      summary: Reconcilia o valor provisionado no VPO contra as passagens reais em
        praças e Free Flow
      tags:
        - VPO Operations & Reconciliation
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
      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: vpo-operations
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - executedTollPlazas
              properties:
                executedTollPlazas:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                      - amount
                    properties:
                      name:
                        type: string
                      amount:
                        minimum: 0
                        type: number
            example:
              executedTollPlazas:
                - name: Exemplo sintético
                  amount: 0
  /api/v1/vpo/providers:
    get:
      summary: Lista fornecedoras de Vale-Pedágio Obrigatório (FVPO) homologadas pela
        ANTT
      tags:
        - VPO Operations & Reconciliation
      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: vpo-operations
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /api/v1/vpo/history:
    get:
      summary: Lista histórico auditável de Vale-Pedágio do tenant
      tags:
        - VPO Operations & Reconciliation
      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: vpo-operations
      x-module-status: PAUSED
      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/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/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/stops/batch:
    post:
      summary: Processa lote de rotas para análise de paradas (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:
        - Stops & PPD
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: stops-intelligence
      x-module-status: PAUSED
      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:
                      - origin
                      - destination
                    properties:
                      origin:
                        type: string
                      destination:
                        type: string
            example:
              items:
                - origin: São Paulo, SP
                  destination: Curitiba, PR
      parameters: []
  /api/v1/stops/watch/{id}:
    delete:
      summary: Remove um alvo de monitoramento do Stops Watch
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Stops Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: stops-intelligence
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/stops/watch/events:
    get:
      summary: Lista eventos e notificações de novos PPDs certificados ou mudanças de
        status
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Stops Watch
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: stops-intelligence
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
  /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 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: PAUSED
      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: PAUSED
      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: PAUSED
      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: PAUSED
      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: PAUSED
      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/drivers/lookup:
    post:
      summary: Consulta perfil canônico e dados de CNH do condutor por CPF anonimizado
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Driver & CNH Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cpf
              properties:
                cpf:
                  minLength: 11
                  maxLength: 14
                  type: string
                cnhNumber:
                  type: string
            example:
              cpf: "00000000000"
      parameters: []
  /api/v1/drivers/watch:
    get:
      summary: Lista condutores sob monitoramento contínuo de CNH e bloqueios
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Driver & CNH Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters: []
    post:
      summary: Cadastra condutor para monitoramento contínuo (Driver Watch)
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Driver & CNH Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cpf
                - cnhCategory
              properties:
                cpf:
                  minLength: 11
                  maxLength: 14
                  type: string
                driverName:
                  type: string
                cnhCategory:
                  minLength: 1
                  maxLength: 3
                  type: string
            example:
              cpf: "00000000000"
              cnhCategory: C
      parameters: []
  /api/v1/drivers/watch/{id}:
    delete:
      summary: Remove condutor do monitoramento contínuo
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - Driver & CNH Compliance
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: driver-compliance
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/ciot/{id}/close:
    post:
      summary: Encerra ciclo de vida do CIOT após conclusão da viagem e descarga
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - CIOT Intelligence & Integration
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: ciot-integration
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/ciot/{id}/cancel:
    post:
      summary: Cancela CIOT previamente gerado informando motivo 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:
        - CIOT Intelligence & Integration
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: ciot-integration
      x-module-status: PAUSED
      x-runtime-contract: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                reason:
                  minLength: 5
                  type: string
            example:
              reason: EXEMPLO
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/ciot/{id}:
    get:
      summary: Consulta detalhe de registro de CIOT
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - CIOT Intelligence & Integration
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: ciot-integration
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /api/v1/vpo/{id}/cancel:
    post:
      summary: Cancela provisionamento de Vale-Pedágio
      responses:
        "200":
          description: Resposta do endpoint. Consulte o contrato de execução; o schema de
            resposta não está declarado nesta rota.
      tags:
        - VPO Operations & Reconciliation
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-module-id: vpo-operations
      x-module-status: PAUSED
      x-runtime-contract: true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: EXEMPLO
  /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/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/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: []
servers:
  - url: /
tags:
  - name: Routes
  - name: Imports
  - name: Billing
  - name: Fiscal
  - name: Accounting
  - name: API Keys
  - name: Platform
  - name: Financial Alerts
  - name: Reference
  - name: Freight Floor
  - name: Health
