# Code generated by VDL v0.5.0-alpha.5 (commit 1aaf1f7) using varavelio/vdl-plugin-rpc-openapi@v0.1.2 (hash 29957218)
# Any changes will be overwritten the next time VDL is run. DO NOT EDIT.
# Learn more: https://github.com/varavelio/vdl

openapi: 3.0.0
info:
  title: Prisma API
  version: 1.0.0
security:
  - AuthToken: []
servers:
  - url: http://localhost:9089/rpc
tags:
  - name: AuthnRpcProcedures
    description: Authn RPC service composed from procedure groups by concern.
  - name: AuthzRpcProcedures
    description: Authz RPC service composed from procedure groups by concern.
  - name: BillingRpcProcedures
    description: Procedures for BillingRpc
  - name: FilesRpcProcedures
    description: Procedures for FilesRpc
  - name: FleetsRpcProcedures
    description: Procedures for FleetsRpc
  - name: MerchantsRpcProcedures
    description: Procedures for MerchantsRpc
  - name: NotesRpcProcedures
    description: Procedures for NotesRpc
  - name: OrdersRpcProcedures
    description: Procedures for OrdersRpc
  - name: RidersRpcProcedures
    description: Procedures for RidersRpc
  - name: TenantsRpcProcedures
    description: Tenants RPC service composed from procedure groups by concern.
  - name: UsersRpcProcedures
    description: Users RPC service composed from procedure groups by concern.
  - name: WebhooksRpcProcedures
    description: Webhooks RPC service composed from procedure groups by concern.
paths:
  /AuthnRpc/changePassword:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcChangePasswordInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcChangePasswordOutput"
      description: Changes password for the currently authenticated user.
  /AuthnRpc/confirmEmailChange:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcConfirmEmailChangeInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcConfirmEmailChangeOutput"
      description: Confirms an email-change flow for the currently authenticated user
        using both verification tokens and applies the new email.
  /AuthnRpc/createApiKey:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcCreateApiKeyInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcCreateApiKeyOutput"
      description: Creates an API key for the caller or one of their machine users.
  /AuthnRpc/createMachineUser:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcCreateMachineUserInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcCreateMachineUserOutput"
      description: Creates a machine user linked to the currently authenticated human user.
  /AuthnRpc/deleteMachineUser:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcDeleteMachineUserInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcDeleteMachineUserOutput"
      description: Deletes a machine user owned by the currently authenticated human user.
  /AuthnRpc/getCurrentUser:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcGetCurrentUserInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcGetCurrentUserOutput"
      description: Returns the currently authenticated user.
  /AuthnRpc/listApiKeys:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcListApiKeysInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcListApiKeysOutput"
      description: Lists API keys for the authenticated user or one of their machine users.
  /AuthnRpc/listMachineUsers:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcListMachineUsersInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcListMachineUsersOutput"
      description: Lists machine users owned by the currently authenticated human user.
  /AuthnRpc/listSessions:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcListSessionsInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcListSessionsOutput"
      description: Lists active sessions for the currently authenticated user.
  /AuthnRpc/login:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcLoginInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcLoginOutput"
      description: Authenticates a user with email and password and creates a new session.
  /AuthnRpc/logout:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcLogoutInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcLogoutOutput"
      description: Revokes the current session, logging the caller out of this device.
  /AuthnRpc/register:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcRegisterInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcRegisterOutput"
      description: Creates a new human user account and sends email verification
        instructions.
  /AuthnRpc/requestEmailChange:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcRequestEmailChangeInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcRequestEmailChangeOutput"
      description: Starts a secure email change flow that verifies both current and
        new addresses.
  /AuthnRpc/requestPasswordReset:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcRequestPasswordResetInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcRequestPasswordResetOutput"
      description: Starts the password reset flow for an account email.
  /AuthnRpc/resendEmailVerification:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcResendEmailVerificationInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcResendEmailVerificationOutput"
      description: Re-sends email verification instructions for the currently
        authenticated user.
  /AuthnRpc/resetPassword:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcResetPasswordInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcResetPasswordOutput"
      description: Completes the password reset flow using a valid reset token.
  /AuthnRpc/revokeApiKey:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcRevokeApiKeyInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcRevokeApiKeyOutput"
      description: Revokes an API key owned by the authenticated user or one of their
        machine users.
  /AuthnRpc/revokeOtherSessions:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcRevokeOtherSessionsInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcRevokeOtherSessionsOutput"
      description: Revokes all sessions for the currently authenticated user except
        the current one.
  /AuthnRpc/revokeSession:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcRevokeSessionInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcRevokeSessionOutput"
      description: Revokes a specific session owned by the currently authenticated user.
  /AuthnRpc/verifyEmail:
    post:
      tags:
        - AuthnRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthnRpcVerifyEmailInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthnRpcVerifyEmailOutput"
      description: Confirms a pending email verification for the currently
        authenticated user using a verification token.
  /AuthzRpc/assignMembership:
    post:
      tags:
        - AuthzRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthzRpcAssignMembershipInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthzRpcAssignMembershipOutput"
      description: >-
        Assigns a new membership to a target user identity.


        Authorization constraints:

        - `System`: only `SystemAdmin` can assign.

        - `Tenant`: `SystemAdmin` and `TenantAdmin` of the same tenant can
        assign.

        - `Merchant`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
        `MerchantManager` of the same merchant can assign.

        - `Fleet`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
        `FleetManager` of the same fleet can assign.
  /AuthzRpc/deleteMembership:
    post:
      tags:
        - AuthzRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthzRpcDeleteMembershipInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthzRpcDeleteMembershipOutput"
      description: >-
        Deletes an active authorization membership.


        This operation removes the `Identity + Context + Role` link only.

        It must never be interpreted as user deletion/ban.


        Authorization constraints:

        - `System`: only `SystemAdmin` can delete.

        - `Tenant`: `SystemAdmin` and `TenantAdmin` of the same tenant can
        delete.

        - `Merchant`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
        `MerchantManager` of the same merchant can delete.

        - `Fleet`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
        `FleetManager` of the same fleet can delete.
  /AuthzRpc/listCurrentContexts:
    post:
      tags:
        - AuthzRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthzRpcListCurrentContextsInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthzRpcListCurrentContextsOutput"
      description: Lists the contexts available to the currently authenticated
        identity with effective roles.
  /AuthzRpc/listMemberships:
    post:
      tags:
        - AuthzRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/AuthzRpcListMembershipsInput"
      responses:
        "200":
          $ref: "#/components/responses/AuthzRpcListMembershipsOutput"
      description: >-
        Lists active memberships using one generic filter shape.


        Authorization constraints:

        - `System`: only `SystemAdmin` can list.

        - `Tenant`: `SystemAdmin` and `TenantAdmin` of the same tenant can list.

        - `Merchant`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
        `MerchantManager` of the same merchant can list.

        - `Fleet`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
        `FleetManager` of the same fleet can list.
  /BillingRpc/adjustBalance:
    post:
      tags:
        - BillingRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/BillingRpcAdjustBalanceInput"
      responses:
        "200":
          $ref: "#/components/responses/BillingRpcAdjustBalanceOutput"
  /BillingRpc/configureBillingAccount:
    post:
      tags:
        - BillingRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/BillingRpcConfigureBillingAccountInput"
      responses:
        "200":
          $ref: "#/components/responses/BillingRpcConfigureBillingAccountOutput"
  /BillingRpc/getBillingAccount:
    post:
      tags:
        - BillingRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/BillingRpcGetBillingAccountInput"
      responses:
        "200":
          $ref: "#/components/responses/BillingRpcGetBillingAccountOutput"
  /BillingRpc/listTransactions:
    post:
      tags:
        - BillingRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/BillingRpcListTransactionsInput"
      responses:
        "200":
          $ref: "#/components/responses/BillingRpcListTransactionsOutput"
  /FilesRpc/generateUploadUrl:
    post:
      tags:
        - FilesRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/FilesRpcGenerateUploadUrlInput"
      responses:
        "200":
          $ref: "#/components/responses/FilesRpcGenerateUploadUrlOutput"
      description: >-
        Generates a pre-signed S3 PUT URL for direct browser-to-S3 upload.

        No database record is created — the file lands in stage/ and must be
        confirmed

        by a domain module via interop.
  /FleetsRpc/createFleet:
    post:
      tags:
        - FleetsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/FleetsRpcCreateFleetInput"
      responses:
        "200":
          $ref: "#/components/responses/FleetsRpcCreateFleetOutput"
  /FleetsRpc/getFleet:
    post:
      tags:
        - FleetsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/FleetsRpcGetFleetInput"
      responses:
        "200":
          $ref: "#/components/responses/FleetsRpcGetFleetOutput"
  /FleetsRpc/listFleets:
    post:
      tags:
        - FleetsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/FleetsRpcListFleetsInput"
      responses:
        "200":
          $ref: "#/components/responses/FleetsRpcListFleetsOutput"
  /FleetsRpc/updateFleet:
    post:
      tags:
        - FleetsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/FleetsRpcUpdateFleetInput"
      responses:
        "200":
          $ref: "#/components/responses/FleetsRpcUpdateFleetOutput"
  /MerchantsRpc/createMerchant:
    post:
      tags:
        - MerchantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/MerchantsRpcCreateMerchantInput"
      responses:
        "200":
          $ref: "#/components/responses/MerchantsRpcCreateMerchantOutput"
      description: |-
        Creates a merchant under one tenant.

        Authorization constraints:
        - `TenantAdmin` of the parent tenant.
        - `SystemAdmin` through authz global access.
  /MerchantsRpc/getMerchant:
    post:
      tags:
        - MerchantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/MerchantsRpcGetMerchantInput"
      responses:
        "200":
          $ref: "#/components/responses/MerchantsRpcGetMerchantOutput"
      description: |-
        Returns one merchant by identifier.

        Authorization constraints:
        - `MerchantManager` of the same merchant.
        - `TenantAdmin` of the parent tenant.
        - `SystemAdmin` through authz global access.
  /MerchantsRpc/listMerchants:
    post:
      tags:
        - MerchantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/MerchantsRpcListMerchantsInput"
      responses:
        "200":
          $ref: "#/components/responses/MerchantsRpcListMerchantsOutput"
      description: |-
        Lists merchants visible to the current actor.

        Authorization constraints:
        - `MerchantManager` sees only explicitly assigned merchants.
        - `TenantAdmin` sees merchants under authorized tenants.
        - `SystemAdmin` sees every merchant.
  /MerchantsRpc/updateMerchant:
    post:
      tags:
        - MerchantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/MerchantsRpcUpdateMerchantInput"
      responses:
        "200":
          $ref: "#/components/responses/MerchantsRpcUpdateMerchantOutput"
      description: |-
        Updates one merchant.

        Authorization constraints:
        - `MerchantManager` of the same merchant.
        - `TenantAdmin` of the parent tenant.
        - `SystemAdmin` through authz global access.
  /NotesRpc/createNote:
    post:
      tags:
        - NotesRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/NotesRpcCreateNoteInput"
      responses:
        "200":
          $ref: "#/components/responses/NotesRpcCreateNoteOutput"
  /NotesRpc/deleteNote:
    post:
      tags:
        - NotesRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/NotesRpcDeleteNoteInput"
      responses:
        "200":
          $ref: "#/components/responses/NotesRpcDeleteNoteOutput"
  /NotesRpc/getNote:
    post:
      tags:
        - NotesRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/NotesRpcGetNoteInput"
      responses:
        "200":
          $ref: "#/components/responses/NotesRpcGetNoteOutput"
  /NotesRpc/listNotes:
    post:
      tags:
        - NotesRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/NotesRpcListNotesInput"
      responses:
        "200":
          $ref: "#/components/responses/NotesRpcListNotesOutput"
  /NotesRpc/updateNote:
    post:
      tags:
        - NotesRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/NotesRpcUpdateNoteInput"
      responses:
        "200":
          $ref: "#/components/responses/NotesRpcUpdateNoteOutput"
  /OrdersRpc/addAttachment:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcAddAttachmentInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcAddAttachmentOutput"
  /OrdersRpc/assignOrderToRider:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcAssignOrderToRiderInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcAssignOrderToRiderOutput"
  /OrdersRpc/createOrder:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcCreateOrderInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcCreateOrderOutput"
  /OrdersRpc/getOrder:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcGetOrderInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcGetOrderOutput"
  /OrdersRpc/listAttachments:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcListAttachmentsInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcListAttachmentsOutput"
  /OrdersRpc/listOrders:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcListOrdersInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcListOrdersOutput"
  /OrdersRpc/routeOrderToFleet:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcRouteOrderToFleetInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcRouteOrderToFleetOutput"
  /OrdersRpc/updateOrderStatus:
    post:
      tags:
        - OrdersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/OrdersRpcUpdateOrderStatusInput"
      responses:
        "200":
          $ref: "#/components/responses/OrdersRpcUpdateOrderStatusOutput"
  /RidersRpc/createRider:
    post:
      tags:
        - RidersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/RidersRpcCreateRiderInput"
      responses:
        "200":
          $ref: "#/components/responses/RidersRpcCreateRiderOutput"
  /RidersRpc/getRider:
    post:
      tags:
        - RidersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/RidersRpcGetRiderInput"
      responses:
        "200":
          $ref: "#/components/responses/RidersRpcGetRiderOutput"
  /RidersRpc/listRiders:
    post:
      tags:
        - RidersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/RidersRpcListRidersInput"
      responses:
        "200":
          $ref: "#/components/responses/RidersRpcListRidersOutput"
  /RidersRpc/updateRider:
    post:
      tags:
        - RidersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/RidersRpcUpdateRiderInput"
      responses:
        "200":
          $ref: "#/components/responses/RidersRpcUpdateRiderOutput"
  /RidersRpc/updateRiderLocation:
    post:
      tags:
        - RidersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/RidersRpcUpdateRiderLocationInput"
      responses:
        "200":
          $ref: "#/components/responses/RidersRpcUpdateRiderLocationOutput"
  /RidersRpc/updateRiderStatus:
    post:
      tags:
        - RidersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/RidersRpcUpdateRiderStatusInput"
      responses:
        "200":
          $ref: "#/components/responses/RidersRpcUpdateRiderStatusOutput"
  /TenantsRpc/createTenant:
    post:
      tags:
        - TenantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/TenantsRpcCreateTenantInput"
      responses:
        "200":
          $ref: "#/components/responses/TenantsRpcCreateTenantOutput"
      description: >-
        Creates a new tenant.


        The `isDemo` flag can only be set during creation and is immutable
        thereafter.


        Authorization constraints:

        - Restricted to global administrators.
  /TenantsRpc/getTenant:
    post:
      tags:
        - TenantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/TenantsRpcGetTenantInput"
      responses:
        "200":
          $ref: "#/components/responses/TenantsRpcGetTenantOutput"
      description: |-
        Retrieves an existing tenant by ID.

        Authorization constraints:
        - TenantAdmin (restricted to their own tenant).
  /TenantsRpc/listTenants:
    post:
      tags:
        - TenantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/TenantsRpcListTenantsInput"
      responses:
        "200":
          $ref: "#/components/responses/TenantsRpcListTenantsOutput"
      description: |-
        Lists tenants with pagination and filtering.

        Authorization constraints:
        - TenantAdmin (will only return a list containing their own tenant).
  /TenantsRpc/updateTenant:
    post:
      tags:
        - TenantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/TenantsRpcUpdateTenantInput"
      responses:
        "200":
          $ref: "#/components/responses/TenantsRpcUpdateTenantOutput"
      description: >-
        Updates an existing tenant.


        Note: The `isDemo` flag is immutable and cannot be updated. This
        operation only updates mutable fields like the tenant's name.


        Authorization constraints:

        - TenantAdmin (restricted to their own tenant).
  /TenantsRpc/updateTenantStatus:
    post:
      tags:
        - TenantsRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/TenantsRpcUpdateTenantStatusInput"
      responses:
        "200":
          $ref: "#/components/responses/TenantsRpcUpdateTenantStatusOutput"
      description: |-
        Updates the status of an existing tenant.

        Authorization constraints:
        - Restricted to global administrators.
  /UsersRpc/getCurrentProfile:
    post:
      tags:
        - UsersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/UsersRpcGetCurrentProfileInput"
      responses:
        "200":
          $ref: "#/components/responses/UsersRpcGetCurrentProfileOutput"
      description: Returns the base profile for the currently authenticated identity.
  /UsersRpc/updateCurrentProfile:
    post:
      tags:
        - UsersRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/UsersRpcUpdateCurrentProfileInput"
      responses:
        "200":
          $ref: "#/components/responses/UsersRpcUpdateCurrentProfileOutput"
      description: >-
        Replaces the mutable profile fields for the currently authenticated
        identity.


        Omitted optional fields are ignored (partial update). To explicitly
        clear a nullable field like contactPhoneCountryCode or
        contactPhoneNumber, pass an empty string.
  /WebhooksRpc/createEndpoint:
    post:
      tags:
        - WebhooksRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/WebhooksRpcCreateEndpointInput"
      responses:
        "200":
          $ref: "#/components/responses/WebhooksRpcCreateEndpointOutput"
      description: >-
        Creates a new tenant-owned webhook endpoint.


        Authorization constraints:

        - Restricted to tenant administrators of the target tenant or global
        administrators.
  /WebhooksRpc/listDeliveries:
    post:
      tags:
        - WebhooksRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/WebhooksRpcListDeliveriesInput"
      responses:
        "200":
          $ref: "#/components/responses/WebhooksRpcListDeliveriesOutput"
      description: >-
        Lists persisted webhook delivery attempts.


        Authorization constraints:

        - Restricted to tenant administrators of the target tenant or global
        administrators.
  /WebhooksRpc/listEndpoints:
    post:
      tags:
        - WebhooksRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/WebhooksRpcListEndpointsInput"
      responses:
        "200":
          $ref: "#/components/responses/WebhooksRpcListEndpointsOutput"
      description: >-
        Lists webhook endpoints for one tenant.


        Authorization constraints:

        - Restricted to tenant administrators of the target tenant or global
        administrators.
  /WebhooksRpc/updateEndpoint:
    post:
      tags:
        - WebhooksRpcProcedures
      requestBody:
        $ref: "#/components/requestBodies/WebhooksRpcUpdateEndpointInput"
      responses:
        "200":
          $ref: "#/components/responses/WebhooksRpcUpdateEndpointOutput"
      description: >-
        Updates an existing tenant-owned webhook endpoint.


        Authorization constraints:

        - Restricted to tenant administrators of the endpoint tenant or global
        administrators.
components:
  securitySchemes:
    AuthToken:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Enter the full value for the Authorization header. The specific format
        (Bearer, Basic, API Key, etc.) is determined by the server's
        implementation.


        ---

        **Examples:**

        - **Bearer Token:** `Bearer eyJhbGciOiJIUzI1Ni...` (a JWT token)

        - **Basic Auth:** `Basic dXNlcm5hbWU6cGFzc3dvcmQ=` (a base64 encoding of
        `username:password`)

        - **API Key:** `sk_live_123abc456def` (a raw token)
  schemas:
    AuthnApiKey:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the API key (ULID).
        userId:
          type: string
          description: The ID of the user associated with this API key.
        name:
          type: string
          description: The name of the API key, for identification purposes.
        token:
          type: string
          description: The SHA-256 hash of the full API key token (`ak_{id}_{randomness}`).
        createdByUserId:
          type: string
          description: The ID of the user that created this API key, mainly used when
            creating API keys for machine users.
        createdFromIp:
          type: string
          description: The IP address from which the API key was created.
        createdFromUserAgent:
          type: string
          description: The user agent string from the client's device when the API key was
            created.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the API key was created.
        expiresAt:
          type: string
          format: date-time
          description: The timestamp when the API key should automatically expire. If not
            set, the API key does not expire.
        lastUsedAt:
          type: string
          format: date-time
          description: The timestamp when the API key was last used.
      required:
        - id
        - userId
        - name
        - token
        - createdAt
      description: Internal API key entity with security-sensitive token hash.
    AuthnApiKeyFilter:
      type: object
      properties:
        userId:
          type: string
          description: Owner user identifier.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - userId
        - pagination
      description: Filter criteria for listing authn API keys.
    AuthnApiKeyPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/AuthnApiKey"
          description: API key records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated API key result used by storage adapters.
    AuthnDtoApiKey:
      type: object
      properties:
        id:
          type: string
          description: Unique API key identifier (ULID).
        userId:
          type: string
          description: User identifier that owns the key.
        name:
          type: string
          description: Human-readable key name.
        createdByUserId:
          type: string
          description: User identifier that created the key, when different from owner.
        createdFromIp:
          type: string
          description: Client IP address captured when the key was created.
        createdFromUserAgent:
          type: string
          description: Client user-agent captured when the key was created.
        createdAt:
          type: string
          format: date-time
          description: Key creation timestamp.
        expiresAt:
          type: string
          format: date-time
          description: Optional automatic expiration timestamp.
        lastUsedAt:
          type: string
          format: date-time
          description: Timestamp of the most recent successful key usage.
      required:
        - id
        - userId
        - name
        - createdAt
      description: |-
        Authn DTO for API key metadata exposed outside the authn module.
        This type intentionally excludes the hashed API key token.
    AuthnDtoSession:
      type: object
      properties:
        id:
          type: string
          description: Unique session identifier (ULID).
        userId:
          type: string
          description: Owner user identifier.
        ip:
          type: string
          description: Client IP address captured at session creation time.
        userAgent:
          type: string
          description: Client user-agent captured at session creation time.
        createdAt:
          type: string
          format: date-time
          description: Session creation timestamp.
        expiresAt:
          type: string
          format: date-time
          description: Session expiration timestamp.
      required:
        - id
        - userId
        - createdAt
        - expiresAt
      description: |-
        Authn DTO for session metadata exposed outside the authn module.
        This type intentionally excludes the hashed session token.
    AuthnDtoUser:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier (ULID).
        type:
          allOf:
            - $ref: "#/components/schemas/AuthnUserType"
            - description: Identity category (human user or machine user).
        status:
          allOf:
            - $ref: "#/components/schemas/AuthnUserStatus"
            - description: Current account status.
        parentUserId:
          type: string
          description: Owning human user ID when this identity is a machine user.
        email:
          type: string
          description: Primary email address.
        emailVerified:
          type: boolean
          description: True when the email address has been verified.
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp.
      required:
        - id
        - type
        - status
        - email
        - emailVerified
        - createdAt
        - updatedAt
      description: >-
        Authn DTO for user identity data exposed outside the authn module.

        This type intentionally excludes password hashes and other secret-only
        fields.
    AuthnEventApiKeyCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique API key identifier (ULID).
        userId:
          type: string
          description: User identifier that owns the key.
        name:
          type: string
          description: Human-readable key name.
        createdByUserId:
          type: string
          description: User identifier that created the key, when different from owner.
        createdFromIp:
          type: string
          description: Client IP address captured when the key was created.
        createdFromUserAgent:
          type: string
          description: Client user-agent captured when the key was created.
        createdAt:
          type: string
          format: date-time
          description: Key creation timestamp.
        expiresAt:
          type: string
          format: date-time
          description: Optional automatic expiration timestamp.
        lastUsedAt:
          type: string
          format: date-time
          description: Timestamp of the most recent successful key usage.
      required:
        - id
        - userId
        - name
        - createdAt
      description: Event emitted when a new API key is created successfully.
    AuthnEventSessionCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique session identifier (ULID).
        userId:
          type: string
          description: Owner user identifier.
        ip:
          type: string
          description: Client IP address captured at session creation time.
        userAgent:
          type: string
          description: Client user-agent captured at session creation time.
        createdAt:
          type: string
          format: date-time
          description: Session creation timestamp.
        expiresAt:
          type: string
          format: date-time
          description: Session expiration timestamp.
      required:
        - id
        - userId
        - createdAt
        - expiresAt
      description: Event emitted when a new session is created successfully.
    AuthnEventUserCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier (ULID).
        type:
          allOf:
            - $ref: "#/components/schemas/AuthnUserType"
            - description: Identity category (human user or machine user).
        status:
          allOf:
            - $ref: "#/components/schemas/AuthnUserStatus"
            - description: Current account status.
        parentUserId:
          type: string
          description: Owning human user ID when this identity is a machine user.
        email:
          type: string
          description: Primary email address.
        emailVerified:
          type: boolean
          description: True when the email address has been verified.
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp.
      required:
        - id
        - type
        - status
        - email
        - emailVerified
        - createdAt
        - updatedAt
      description: Event emitted after a user identity is created successfully.
    AuthnEventUserEmailChangeVerificationRequested:
      type: object
      properties:
        id:
          type: string
          description: User identifier for which the email change flow was requested.
        currentEmail:
          type: string
          description: Current email address for the overall email change flow.
        newEmail:
          type: string
          description: New email address for the overall email change flow.
        currentEmailToken:
          type: string
          description: Plain one-time verification code delivered to the current email
            address.
        newEmailToken:
          type: string
          description: Plain one-time verification code delivered to the new email address.
        expiresIn:
          type: string
          description: Human-readable expiry duration for the tokens (e.g. "15m").
      required:
        - id
        - currentEmail
        - newEmail
        - currentEmailToken
        - newEmailToken
        - expiresIn
      description: Event emitted when any side of an email change flow must receive a
        verification code.
    AuthnEventUserEmailVerificationRequested:
      type: object
      properties:
        id:
          type: string
          description: User identifier for which verification was requested.
        email:
          type: string
          description: Email address that must receive the verification code.
        token:
          type: string
          description: Plain one-time verification code delivered to the user.
        expiresIn:
          type: string
          description: Human-readable expiry duration for the token (e.g. "15m").
      required:
        - id
        - email
        - token
        - expiresIn
      description: Event emitted when email verification instructions are requested.
    AuthnEventUserPasswordResetCompleted:
      type: object
      properties:
        id:
          type: string
          description: User identifier whose password was reset.
        email:
          type: string
          description: Current email address of the user.
      required:
        - id
        - email
      description: Event emitted after a password reset is completed successfully.
    AuthnEventUserPasswordResetRequested:
      type: object
      properties:
        id:
          type: string
          description: User identifier for which reset was requested.
        email:
          type: string
          description: Email address that received reset instructions.
        token:
          type: string
          description: Plain one-time verification code delivered to the user.
        expiresIn:
          type: string
          description: Human-readable expiry duration for the token (e.g. "15m").
      required:
        - id
        - email
        - token
        - expiresIn
      description: Event emitted when a password reset flow is requested.
    AuthnInteropAuthenticateApiKeyInput:
      type: object
      properties:
        apiKey:
          type: string
          description: Plain API key token in `ak_{id}_{randomness}` format.
      required:
        - apiKey
      description: Input contract to authenticate a plaintext API key in trusted
        internal flows.
    AuthnInteropAuthenticateApiKeyOutput:
      type: object
      properties:
        authenticated:
          type: boolean
          description: True when the API key is valid and active.
        user:
          allOf:
            - $ref: "#/components/schemas/AuthnDtoUser"
            - description: Authenticated user projection when authenticated is true.
        apiKey:
          allOf:
            - $ref: "#/components/schemas/AuthnDtoApiKey"
            - description: Authenticated API key projection when authenticated is true.
      required:
        - authenticated
      description: Output contract for API-key authentication in trusted internal flows.
    AuthnInteropAuthenticateSessionTokenInput:
      type: object
      properties:
        sessionToken:
          type: string
          description: Plain session token in `st_{id}_{randomness}` format.
      required:
        - sessionToken
      description: Input contract to authenticate a plaintext session token in trusted
        internal flows.
    AuthnInteropAuthenticateSessionTokenOutput:
      type: object
      properties:
        authenticated:
          type: boolean
          description: True when the session token is valid and active.
        user:
          allOf:
            - $ref: "#/components/schemas/AuthnDtoUser"
            - description: Authenticated user projection when authenticated is true.
        session:
          allOf:
            - $ref: "#/components/schemas/AuthnDtoSession"
            - description: Authenticated session projection when authenticated is true.
      required:
        - authenticated
      description: Output contract for session-token authentication in trusted
        internal flows.
    AuthnInteropGetUserByIdInput:
      type: object
      properties:
        userId:
          type: string
          description: User identifier (ULID).
      required:
        - userId
      description: Input contract to resolve a single user by identifier in trusted
        inter-module flows.
    AuthnInteropGetUserByIdOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether a user exists for the requested identifier.
        user:
          allOf:
            - $ref: "#/components/schemas/AuthnDtoUser"
            - description: Resolved user projection when found is true.
      required:
        - found
      description: Output contract for single-user resolution in trusted inter-module flows.
    AuthnInteropListUsersByIdsInput:
      type: object
      properties:
        userIds:
          type: array
          items:
            type: string
          description: User identifiers (ULID). Duplicates should be ignored by
            implementations.
      required:
        - userIds
      description: Input contract to resolve multiple users by identifiers in one request.
    AuthnInteropListUsersByIdsOutput:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: "#/components/schemas/AuthnDtoUser"
          description: Users resolved from the requested identifiers. Order is
            implementation-defined.
      required:
        - users
      description: Output contract for batched user resolution in trusted inter-module
        flows.
    AuthnProcsApiKey:
      type: object
      properties:
        createApiKey:
          type: object
          properties:
            input:
              type: object
              properties:
                userId:
                  type: string
                  description: Optional machine user ID (ULID); defaults to the authenticated user
                    ID, but may target any machine user owned by the
                    authenticated user.
                name:
                  type: string
                  description: Human-readable API key name used to identify the key in dashboards
                    and logs.
                expiresAt:
                  type: string
                  format: date-time
                  description: Optional UTC timestamp after which the API key is no longer valid.
              required:
                - name
            output:
              type: object
              properties:
                plainApiKey:
                  type: string
                  description: Plain API key in `ak_{id}_{randomness}` format, returned only once
                    at creation time.
                apiKey:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoApiKey"
                    - description: Created API key projection for external consumers.
              required:
                - plainApiKey
                - apiKey
          required:
            - input
            - output
          description: Creates an API key for the caller or one of their machine users.
        listApiKeys:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                userId:
                  type: string
                  description: Optional machine user ID (ULID); defaults to the authenticated user
                    ID, but may target any machine user owned by the
                    authenticated user.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/AuthnDtoApiKey"
                  description: API keys owned by the effective user (authenticated user by
                    default).
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: Lists API keys for the authenticated user or one of their machine
            users.
        revokeApiKey:
          type: object
          properties:
            input:
              type: object
              properties:
                userId:
                  type: string
                  description: Optional machine user ID (ULID); defaults to the authenticated user
                    ID, but may target any machine user owned by the
                    authenticated user.
                apiKeyId:
                  type: string
                  description: API key identifier to revoke.
              required:
                - apiKeyId
          required:
            - input
          description: Revokes an API key owned by the authenticated user or one of their
            machine users.
      required:
        - createApiKey
        - listApiKeys
        - revokeApiKey
      description: Procedure group for API key lifecycle operations.
    AuthnProcsEmailChange:
      type: object
      properties:
        requestEmailChange:
          type: object
          properties:
            input:
              type: object
              properties:
                newEmail:
                  type: string
                  description: New target email address to be confirmed.
                currentPassword:
                  type: string
                  description: Current plain password for verification before starting the flow.
              required:
                - newEmail
                - currentPassword
          required:
            - input
          description: Starts a secure email change flow that verifies both current and
            new addresses.
        confirmEmailChange:
          type: object
          properties:
            input:
              type: object
              properties:
                currentEmailToken:
                  type: string
                  description: Verification token sent to the current email address.
                newEmailToken:
                  type: string
                  description: Verification token sent to the new email address.
              required:
                - currentEmailToken
                - newEmailToken
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Updated user projection after both verifications succeed and the
                        email is changed.
              required:
                - user
          required:
            - input
            - output
          description: Confirms an email-change flow for the currently authenticated user
            using both verification tokens and applies the new email.
      required:
        - requestEmailChange
        - confirmEmailChange
      description: Procedure group for secure email-change operations.
    AuthnProcsEmailVerification:
      type: object
      properties:
        verifyEmail:
          type: object
          properties:
            input:
              type: object
              properties:
                token:
                  type: string
                  description: Email verification token value.
              required:
                - token
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Updated user projection after successful email verification.
              required:
                - user
          required:
            - input
            - output
          description: Confirms a pending email verification for the currently
            authenticated user using a verification token.
        resendEmailVerification:
          type: object
          properties: {}
          description: Re-sends email verification instructions for the currently
            authenticated user.
      required:
        - verifyEmail
        - resendEmailVerification
      description: Procedure group for email verification operations.
    AuthnProcsPassword:
      type: object
      properties:
        requestPasswordReset:
          type: object
          properties:
            input:
              type: object
              properties:
                email:
                  type: string
                  description: Email address for which to start password reset.
              required:
                - email
          required:
            - input
          description: Starts the password reset flow for an account email.
        resetPassword:
          type: object
          properties:
            input:
              type: object
              properties:
                email:
                  type: string
                  description: Email address for which the reset code was requested.
                token:
                  type: string
                  description: Password-reset token value.
                newPassword:
                  type: string
                  description: New plain password to be stored after hashing.
              required:
                - email
                - token
                - newPassword
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Updated user projection after successful password reset.
              required:
                - user
          required:
            - input
            - output
          description: Completes the password reset flow using a valid reset token.
        changePassword:
          type: object
          properties:
            input:
              type: object
              properties:
                currentPassword:
                  type: string
                  description: Current plain password for verification before change.
                newPassword:
                  type: string
                  description: New plain password to be stored after hashing.
              required:
                - currentPassword
                - newPassword
          required:
            - input
          description: Changes password for the currently authenticated user.
      required:
        - requestPasswordReset
        - resetPassword
        - changePassword
      description: Procedure group for password reset and password change operations.
    AuthnProcsSession:
      type: object
      properties:
        login:
          type: object
          properties:
            input:
              type: object
              properties:
                email:
                  type: string
                  description: Email used to authenticate the user.
                password:
                  type: string
                  description: Plain password used to authenticate the user.
              required:
                - email
                - password
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Authenticated user projection for external consumers.
                sessionToken:
                  type: string
                  description: Plain session token in `st_{id}_{randomness}` format, returned only
                    at creation time.
                session:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoSession"
                    - description: Session projection for external consumers.
              required:
                - user
                - sessionToken
                - session
          required:
            - input
            - output
          description: Authenticates a user with email and password and creates a new
            session.
        logout:
          type: object
          properties: {}
          description: Revokes the current session, logging the caller out of this device.
        getCurrentUser:
          type: object
          properties:
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Current authenticated user projection for external consumers.
              required:
                - user
          required:
            - output
          description: Returns the currently authenticated user.
        listSessions:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/AuthnDtoSession"
                  description: Active sessions owned by the current authenticated user.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: Lists active sessions for the currently authenticated user.
        revokeSession:
          type: object
          properties:
            input:
              type: object
              properties:
                sessionId:
                  type: string
                  description: Session identifier to revoke.
              required:
                - sessionId
          required:
            - input
          description: Revokes a specific session owned by the currently authenticated user.
        revokeOtherSessions:
          type: object
          properties:
            output:
              type: object
              properties:
                revokedCount:
                  type: integer
                  description: Number of revoked sessions excluding the current session.
              required:
                - revokedCount
          required:
            - output
          description: Revokes all sessions for the currently authenticated user except
            the current one.
      required:
        - login
        - logout
        - getCurrentUser
        - listSessions
        - revokeSession
        - revokeOtherSessions
      description: Procedure group for login and session lifecycle management.
    AuthnProcsUserOnboarding:
      type: object
      properties:
        register:
          type: object
          properties:
            input:
              type: object
              properties:
                email:
                  type: string
                  description: User email address (must be unique).
                password:
                  type: string
                  description: Plain password for the new user.
              required:
                - email
                - password
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Newly created user projection for external consumers.
              required:
                - user
          required:
            - input
            - output
          description: Creates a new human user account and sends email verification
            instructions.
        createMachineUser:
          type: object
          properties:
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/AuthnDtoUser"
                    - description: Newly created machine-user projection for external consumers.
              required:
                - user
          required:
            - output
          description: Creates a machine user linked to the currently authenticated human
            user.
        listMachineUsers:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/AuthnDtoUser"
                  description: Machine users owned by the current authenticated human user.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: Lists machine users owned by the currently authenticated human user.
        deleteMachineUser:
          type: object
          properties:
            input:
              type: object
              properties:
                userId:
                  type: string
                  description: Machine user identifier to delete.
              required:
                - userId
          required:
            - input
          description: Deletes a machine user owned by the currently authenticated human
            user.
      required:
        - register
        - createMachineUser
        - listMachineUsers
        - deleteMachineUser
      description: Procedure group for user and machine-user provisioning flows.
    AuthnSession:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the session (ULID).
        userId:
          type: string
          description: The ID of the user associated with this session.
        token:
          type: string
          description: The SHA-256 hash of the full session token (`st_{id}_{randomness}`).
        ip:
          type: string
          description: The IP address from which the session was created.
        userAgent:
          type: string
          description: The user agent string from the client's device.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the session was created.
        expiresAt:
          type: string
          format: date-time
          description: The timestamp when the session expires.
      required:
        - id
        - userId
        - token
        - createdAt
        - expiresAt
      description: Internal authn session entity with security-sensitive token hash.
    AuthnSessionFilter:
      type: object
      properties:
        userId:
          type: string
          description: Owner user identifier.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - userId
        - pagination
      description: Filter criteria for listing authn sessions.
    AuthnSessionPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/AuthnSession"
          description: Session records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated session result used by storage adapters.
    AuthnUser:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the user (ULID).
        type:
          allOf:
            - $ref: "#/components/schemas/AuthnUserType"
            - description: The user type.
        status:
          allOf:
            - $ref: "#/components/schemas/AuthnUserStatus"
            - description: Account status used to control access and lifecycle.
        parentUserId:
          type: string
          description: Parent human owner when this is a machine user.
        email:
          type: string
          description: The email address of the user.
        password:
          type: string
          description: The hashed password for the user (not required for machine users).
        emailVerified:
          type: boolean
          description: Indicates whether the user's email address has been verified.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the user was created.
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the user was last updated (same as createdAt
            when no updates have been made).
      required:
        - id
        - type
        - status
        - email
        - emailVerified
        - createdAt
        - updatedAt
      description: Internal authn user entity with security-sensitive fields.
    AuthnUserFilter:
      type: object
      properties:
        parentUserId:
          type: string
          description: Parent user identifier for machine users.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - parentUserId
        - pagination
      description: Filter criteria for listing authn users by parent user.
    AuthnUserPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/AuthnUser"
          description: User records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated user result used by storage adapters.
    AuthnVerificationToken:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the verification token (ULID).
        userId:
          type: string
          description: The ID of the user associated with this verification token.
        purpose:
          allOf:
            - $ref: "#/components/schemas/AuthnVerificationTokenPurpose"
            - description: The purpose of this verification token.
        targetEmail:
          type: string
          description: The target email address for email change verification flows.
        token:
          type: string
          description: The hashed verification token/code.
        attemptCount:
          type: integer
          description: Number of verification attempts already made against this token.
        ip:
          type: string
          description: The IP address from which the token was created.
        userAgent:
          type: string
          description: The user agent string from the client's device.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the verification token was created.
        expiresAt:
          type: string
          format: date-time
          description: The timestamp when the verification token expires.
        consumedAt:
          type: string
          format: date-time
          description: The timestamp when the verification token was consumed.
      required:
        - id
        - userId
        - purpose
        - token
        - attemptCount
        - createdAt
        - expiresAt
      description: >-
        Internal verification token entity with security-sensitive token hash.


        When a new verification flow is started, older unconsumed tokens for the
        same

        user and related purpose should be deleted.
    AuthzDtoContextAccess:
      type: object
      properties:
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type.
        contextId:
          type: string
          description: Target context identifier (ULID) when the context is scoped below
            system level.
        roles:
          type: array
          items:
            $ref: "#/components/schemas/AuthzRole"
          description: Effective roles granted to the identity within the target context.
      required:
        - contextType
        - roles
      description: Authz DTO representing a context with its effective roles for one
        identity.
    AuthzDtoMembership:
      type: object
      properties:
        id:
          type: string
          description: Unique membership identifier (ULID).
        userId:
          type: string
          description: User identity that owns this membership.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type.
        contextId:
          type: string
          description: Target context identifier (ULID) when the membership is scoped
            below system level.
        role:
          allOf:
            - $ref: "#/components/schemas/AuthzRole"
            - description: Role granted within the target context.
        createdAt:
          type: string
          format: date-time
          description: Membership creation timestamp.
      required:
        - id
        - userId
        - contextType
        - role
        - createdAt
      description: |-
        Authz DTO for membership data exposed outside the authz module.

        This DTO is safe to reuse across RPC, interop, and event boundaries.
    AuthzEventMembershipCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique membership identifier (ULID).
        userId:
          type: string
          description: User identity that owns this membership.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type.
        contextId:
          type: string
          description: Target context identifier (ULID) when the membership is scoped
            below system level.
        role:
          allOf:
            - $ref: "#/components/schemas/AuthzRole"
            - description: Role granted within the target context.
        createdAt:
          type: string
          format: date-time
          description: Membership creation timestamp.
      required:
        - id
        - userId
        - contextType
        - role
        - createdAt
      description: Event emitted after a membership is created successfully.
    AuthzEventMembershipDeleted:
      type: object
      properties:
        id:
          type: string
          description: Unique membership identifier (ULID).
        userId:
          type: string
          description: User identity that owns this membership.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type.
        contextId:
          type: string
          description: Target context identifier (ULID) when the membership is scoped
            below system level.
        role:
          allOf:
            - $ref: "#/components/schemas/AuthzRole"
            - description: Role granted within the target context.
        createdAt:
          type: string
          format: date-time
          description: Membership creation timestamp.
      required:
        - id
        - userId
        - contextType
        - role
        - createdAt
      description: Event emitted after a membership is deleted successfully.
    AuthzInteropAuthorizeInput:
      type: object
      properties:
        userId:
          type: string
          description: User identity whose access should be evaluated.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type to evaluate.
        contextId:
          type: string
          description: Target context identifier (ULID) for tenant, merchant, or fleet
            contexts. Omit for `SYSTEM`.
        roles:
          type: array
          items:
            $ref: "#/components/schemas/AuthzRole"
          description: Optional acceptable roles for the operation. Evaluated as an OR
            condition (user must have at least one of these roles). Empty means
            any active membership in the context is sufficient.
      required:
        - userId
        - contextType
        - roles
      description: Input contract to evaluate context-based access in trusted internal
        flows.
    AuthzInteropAuthorizeOutput:
      type: object
      properties:
        authorized:
          type: boolean
          description: True when the identity has at least one active membership that
            satisfies the request.
        membership:
          allOf:
            - $ref: "#/components/schemas/AuthzDtoMembership"
            - description: Matching membership when authorization succeeds.
      required:
        - authorized
      description: Output contract for context-based authorization evaluation in
        trusted internal flows.
    AuthzInteropGetAuthorizedContextIdsInput:
      type: object
      properties:
        userId:
          type: string
          description: User identity whose authorized scope should be resolved.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type whose authorized identifiers should be
                resolved.
        roles:
          type: array
          items:
            $ref: "#/components/schemas/AuthzRole"
          description: Optional acceptable roles for the operation. Evaluated as an OR
            condition (user must have at least one of these roles). Empty means
            any active membership in the context is sufficient.
      required:
        - userId
        - contextType
        - roles
      description: >-
        Input contract to resolve every context identifier a user is authorized
        to access for one

        authorization context type.


        Trusted consumers can use this to build module-local data scoping
        filters before querying

        their own storage.
    AuthzInteropGetAuthorizedContextIdsOutput:
      type: object
      properties:
        contextIds:
          type: array
          items:
            type: string
          description: Authorized context identifiers for the requested context type when
            access is scoped.
        hasGlobalAccess:
          type: boolean
          description: True when the identity should be treated as having unrestricted
            access for the requested context type.
      required:
        - contextIds
        - hasGlobalAccess
      description: >-
        Output contract for resolving authorized context identifiers in trusted
        internal flows.


        When `hasGlobalAccess` is true, consumers should treat `contextIds` as
        non-restrictive for the

        requested context type and must not apply an ID-based filter for that
        dimension. When

        `hasGlobalAccess` is false, `contextIds` contains the full allowed
        scope; an empty array means no

        authorized scoped contexts were found.
    AuthzInteropListMembershipsByUserIdInput:
      type: object
      properties:
        userId:
          type: string
          description: User identity whose memberships should be listed.
      required:
        - userId
      description: Input contract to list memberships for one identity in trusted
        inter-module flows.
    AuthzInteropListMembershipsByUserIdOutput:
      type: object
      properties:
        memberships:
          type: array
          items:
            $ref: "#/components/schemas/AuthzDtoMembership"
          description: Active memberships currently assigned to the target user.
      required:
        - memberships
      description: Output contract for membership listing in trusted inter-module flows.
    AuthzInteropResolvedContext:
      type: object
      properties:
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Canonical authorization context type that was resolved.
        contextId:
          type: string
          description: Canonical target context identifier (ULID).
        tenantId:
          type: string
          description: Owning tenant identifier (ULID) for the resolved context.
      required:
        - contextType
        - contextId
        - tenantId
      description: >-
        Resolved managed context information used by authz delegated-management
        checks.


        `tenantId` always represents the owning tenant of the resolved context.
        For

        tenant contexts, it must equal `contextId`.
    AuthzInteropResolveManagedContextInput:
      type: object
      properties:
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type to resolve. `SYSTEM` must not use this
                contract.
        contextId:
          type: string
          description: Target context identifier (ULID) to resolve.
      required:
        - contextType
        - contextId
      description: Input contract to resolve the canonical managed context for
        delegated authz rules.
    AuthzInteropResolveManagedContextOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether the requested context exists.
        context:
          allOf:
            - $ref: "#/components/schemas/AuthzInteropResolvedContext"
            - description: Canonical resolved context and tenant lineage when found is true.
      required:
        - found
      description: Output contract for delegated-management context resolution.
    AuthzMembership:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the membership (ULID).
        userId:
          type: string
          description: The user identity that owns this membership.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: The authorization context type.
        contextId:
          type: string
          description: The target context identifier (ULID) for tenant, merchant, or fleet
            contexts.
        role:
          allOf:
            - $ref: "#/components/schemas/AuthzRole"
            - description: The role granted within the target context.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the membership was created.
      required:
        - id
        - userId
        - contextType
        - role
        - createdAt
      description: >-
        Internal membership entity for context-based RBAC.


        Each membership links one identity to one context and one role. When the
        context

        type is `SYSTEM`, `contextId` should be omitted.
    AuthzMembershipFilter:
      type: object
      properties:
        userId:
          type: string
          description: Optional user identity filter.
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Optional authorization context type filter.
        contextId:
          type: string
          description: Optional target context identifier filter.
        role:
          allOf:
            - $ref: "#/components/schemas/AuthzRole"
            - description: Optional role filter.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - pagination
      description: >-
        Internal membership query filter used by authz storage adapters.


        Every field is optional. When omitted, adapters must treat the
        corresponding

        dimension as non-restrictive.
    AuthzMembershipPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/AuthzMembership"
          description: Membership records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated membership result used by storage adapters.
    AuthzProcsLauncher:
      type: object
      properties:
        listCurrentContexts:
          type: object
          properties:
            output:
              type: object
              properties:
                contexts:
                  type: array
                  items:
                    $ref: "#/components/schemas/AuthzDtoContextAccess"
                  description: Contexts available to the current authenticated identity.
              required:
                - contexts
          required:
            - output
          description: Lists the contexts available to the currently authenticated
            identity with effective roles.
      required:
        - listCurrentContexts
      description: Procedure group for launcher-facing authorization discovery.
    AuthzProcsMembership:
      type: object
      properties:
        assignMembership:
          type: object
          properties:
            input:
              type: object
              properties:
                userId:
                  type: string
                  description: User identity that will receive the membership.
                contextType:
                  allOf:
                    - $ref: "#/components/schemas/AuthzContextType"
                    - description: Authorization context type.
                contextId:
                  type: string
                  description: Target context identifier (ULID) for tenant, merchant, or fleet
                    contexts. Omit for `SYSTEM`.
                role:
                  allOf:
                    - $ref: "#/components/schemas/AuthzRole"
                    - description: Role granted within the target context.
              required:
                - userId
                - contextType
                - role
            output:
              type: object
              properties:
                membership:
                  allOf:
                    - $ref: "#/components/schemas/AuthzDtoMembership"
                    - description: Newly created membership projection for external consumers.
              required:
                - membership
          required:
            - input
            - output
          description: >-
            Assigns a new membership to a target user identity.


            Authorization constraints:

            - `System`: only `SystemAdmin` can assign.

            - `Tenant`: `SystemAdmin` and `TenantAdmin` of the same tenant can
            assign.

            - `Merchant`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
            `MerchantManager` of the same merchant can assign.

            - `Fleet`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
            `FleetManager` of the same fleet can assign.
        listMemberships:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                userId:
                  type: string
                  description: Optional user identity filter.
                contextType:
                  allOf:
                    - $ref: "#/components/schemas/AuthzContextType"
                    - description: Optional authorization context type filter. Must be paired with
                        `contextId` when used.
                contextId:
                  type: string
                  description: Optional target context identifier (ULID). Must be paired with
                    `contextType` when used.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/AuthzDtoMembership"
                  description: Active memberships matching the requested filter.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: >-
            Lists active memberships using one generic filter shape.


            Authorization constraints:

            - `System`: only `SystemAdmin` can list.

            - `Tenant`: `SystemAdmin` and `TenantAdmin` of the same tenant can
            list.

            - `Merchant`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
            `MerchantManager` of the same merchant can list.

            - `Fleet`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
            `FleetManager` of the same fleet can list.
        deleteMembership:
          type: object
          properties:
            input:
              type: object
              properties:
                membershipId:
                  type: string
                  description: Membership identifier to delete.
              required:
                - membershipId
          required:
            - input
          description: >-
            Deletes an active authorization membership.


            This operation removes the `Identity + Context + Role` link only.

            It must never be interpreted as user deletion/ban.


            Authorization constraints:

            - `System`: only `SystemAdmin` can delete.

            - `Tenant`: `SystemAdmin` and `TenantAdmin` of the same tenant can
            delete.

            - `Merchant`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
            `MerchantManager` of the same merchant can delete.

            - `Fleet`: `SystemAdmin`, `TenantAdmin` of the parent tenant, and
            `FleetManager` of the same fleet can delete.
      required:
        - assignMembership
        - listMemberships
        - deleteMembership
      description: >-
        Procedure group for delegated membership administration.


        These operations manage access relationships (`Identity + Context +
        Role`), not identity lifecycle.

        Deleting/revoking a membership removes authorization scope only; it does
        not delete or ban the user identity.
    BillingAccount:
      type: object
      properties:
        tenantId:
          type: string
        balanceCredits:
          type: integer
        maxNegativeBalance:
          type: integer
        orderCostCredits:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - tenantId
        - balanceCredits
        - maxNegativeBalance
        - orderCostCredits
        - createdAt
        - updatedAt
      description: Tenant billing account.
    BillingDtoAccount:
      type: object
      properties:
        tenantId:
          type: string
        balanceCredits:
          type: integer
        maxNegativeBalance:
          type: integer
        orderCostCredits:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - tenantId
        - balanceCredits
        - maxNegativeBalance
        - orderCostCredits
        - createdAt
        - updatedAt
    BillingDtoTransaction:
      type: object
      properties:
        id:
          type: string
        tenantId:
          type: string
        type:
          $ref: "#/components/schemas/BillingTransactionType"
        amountCredits:
          type: integer
        orderId:
          type: string
        note:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - tenantId
        - type
        - amountCredits
        - createdAt
    BillingInteropCheckOrderAllowanceInput:
      type: object
      properties:
        tenantId:
          type: string
      required:
        - tenantId
    BillingInteropCheckOrderAllowanceOutput:
      type: object
      properties:
        allowed:
          type: boolean
        balanceCredits:
          type: integer
        maxNegativeBalance:
          type: integer
        orderCostCredits:
          type: integer
      required:
        - allowed
        - balanceCredits
        - maxNegativeBalance
        - orderCostCredits
    BillingProcsAccount:
      type: object
      properties:
        getBillingAccount:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
              required:
                - tenantId
            output:
              type: object
              properties:
                account:
                  $ref: "#/components/schemas/BillingDtoAccount"
              required:
                - account
          required:
            - input
            - output
        configureBillingAccount:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                maxNegativeBalance:
                  type: integer
                orderCostCredits:
                  type: integer
              required:
                - tenantId
                - maxNegativeBalance
                - orderCostCredits
            output:
              type: object
              properties:
                account:
                  $ref: "#/components/schemas/BillingDtoAccount"
              required:
                - account
          required:
            - input
            - output
        adjustBalance:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                amountCredits:
                  type: integer
                note:
                  type: string
              required:
                - tenantId
                - amountCredits
            output:
              type: object
              properties:
                account:
                  $ref: "#/components/schemas/BillingDtoAccount"
                transaction:
                  $ref: "#/components/schemas/BillingDtoTransaction"
              required:
                - account
                - transaction
          required:
            - input
            - output
        listTransactions:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                pagination:
                  $ref: "#/components/schemas/PaginationCursorRequest"
              required:
                - tenantId
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/BillingDtoTransaction"
                pagination:
                  $ref: "#/components/schemas/PaginationCursorResponse"
              required:
                - items
                - pagination
          required:
            - input
            - output
      required:
        - getBillingAccount
        - configureBillingAccount
        - adjustBalance
        - listTransactions
    BillingTransaction:
      type: object
      properties:
        id:
          type: string
        tenantId:
          type: string
        type:
          $ref: "#/components/schemas/BillingTransactionType"
        amountCredits:
          type: integer
        orderId:
          type: string
        note:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - tenantId
        - type
        - amountCredits
        - createdAt
      description: Immutable billing ledger entry.
    BillingTransactionFilter:
      type: object
      properties:
        tenantId:
          type: string
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - tenantId
        - pagination
      description: Filter criteria for listing billing transactions.
    BillingTransactionPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/BillingTransaction"
          description: Transaction records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated transaction result used by storage adapters.
    FilesDtoFile:
      type: object
      properties:
        id:
          type: string
        authorId:
          type: string
        uploadId:
          type: string
        originalName:
          type: string
        mimeType:
          type: string
        sizeBytes:
          type: integer
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - authorId
        - uploadId
        - originalName
        - mimeType
        - sizeBytes
        - createdAt
      description: DTO returned for file reads and writes. No entity/business fields.
    FilesDtoUploadTicket:
      type: object
      properties:
        uploadUrl:
          type: string
          description: The pre-signed S3 URL for direct PUT upload to stage/{uploadId}.
        uploadId:
          type: string
          description: The S3 upload identifier (UUIDv4 without hyphens) the client must
            use.
      required:
        - uploadUrl
        - uploadId
      description: DTO returned when issuing a pre-signed upload URL. Stateless — no
        DB record created yet.
    FilesFile:
      type: object
      properties:
        id:
          type: string
          description: File metadata identifier (ULID). Primary key referenced by business
            modules.
        authorId:
          type: string
          description: Identity of the user who requested the upload (ULID).
        uploadId:
          type: string
          description: S3 object key (UUIDv4 without hyphens, under the prod/ prefix).
        originalName:
          type: string
          description: Original client-side filename (sanitized). Used for UI display.
        mimeType:
          type: string
          description: Declared MIME type (locked into the pre-signed URL at upload time).
        sizeBytes:
          type: integer
          description: Declared file size in bytes.
        createdAt:
          type: string
          format: date-time
          description: Metadata registration timestamp (UTC).
      required:
        - id
        - authorId
        - uploadId
        - originalName
        - mimeType
        - sizeBytes
        - createdAt
      description: Internal file metadata entity. Domain-agnostic — purely infrastructure.
    FilesFileFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
        authorId:
          type: string
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Pagination parameters applied at the storage boundary.
      required:
        - ids
        - pagination
      description: Internal file query filter used by storage adapters.
    FilesFilePage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/FilesFile"
          description: File records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated file result used by storage adapters.
    FilesInteropConfirmUploadInput:
      type: object
      properties:
        uploadId:
          type: string
          description: The S3 upload identifier returned by generateUploadUrl (UUIDv4
            without hyphens).
        authorId:
          type: string
          description: Identity of the author (ULID).
        originalName:
          type: string
          description: Original client-side filename.
        mimeType:
          type: string
          description: Declared MIME type.
        sizeBytes:
          type: integer
          description: Declared file size in bytes.
      required:
        - uploadId
        - authorId
        - originalName
        - mimeType
        - sizeBytes
      description: Private interop input for confirming a staged upload.
    FilesInteropConfirmUploadOutput:
      type: object
      properties:
        file:
          $ref: "#/components/schemas/FilesDtoFile"
      required:
        - file
      description: Private interop output for confirming a staged upload.
    FilesInteropDeleteFileInput:
      type: object
      properties:
        fileId:
          type: string
      required:
        - fileId
      description: Private interop input for deleting a file (DB record + S3 object).
    FilesInteropGenerateDownloadUrlInput:
      type: object
      properties:
        fileId:
          type: string
        expiresInSeconds:
          type: integer
          description: "URL lifetime in seconds. Typical values: 60 (1 min) to 3600 (1
            hour)."
      required:
        - fileId
        - expiresInSeconds
      description: Private interop input for generating a pre-signed download URL.
    FilesInteropGenerateDownloadUrlOutput:
      type: object
      properties:
        url:
          type: string
      required:
        - url
      description: Private interop output for generating a pre-signed download URL.
    FilesInteropGetFileInput:
      type: object
      properties:
        fileId:
          type: string
      required:
        - fileId
      description: Private interop input for retrieving file metadata.
    FilesInteropGetFileOutput:
      type: object
      properties:
        file:
          $ref: "#/components/schemas/FilesDtoFile"
      description: Private interop output for retrieving file metadata.
    FilesInteropGetPublicUrlInput:
      type: object
      properties:
        fileId:
          type: string
      required:
        - fileId
      description: Private interop input for obtaining a public CDN URL.
    FilesInteropGetPublicUrlOutput:
      type: object
      properties:
        url:
          type: string
      required:
        - url
      description: Private interop output for obtaining a public CDN URL.
    FilesProcsFile:
      type: object
      properties:
        generateUploadUrl:
          type: object
          properties:
            input:
              type: object
              properties:
                fileName:
                  type: string
                mimeType:
                  type: string
                sizeBytes:
                  type: integer
              required:
                - fileName
                - mimeType
                - sizeBytes
            output:
              type: object
              properties:
                ticket:
                  $ref: "#/components/schemas/FilesDtoUploadTicket"
              required:
                - ticket
          required:
            - input
            - output
          description: >-
            Generates a pre-signed S3 PUT URL for direct browser-to-S3 upload.

            No database record is created — the file lands in stage/ and must be
            confirmed

            by a domain module via interop.
      required:
        - generateUploadUrl
      description: "Procedure group for the only public RPC: issuing pre-signed upload
        URLs."
    FleetsDtoFleet:
      type: object
      properties:
        id:
          type: string
          description: Unique fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        name:
          type: string
          description: Human-readable fleet name.
        status:
          allOf:
            - $ref: "#/components/schemas/FleetsFleetStatus"
            - description: Current fleet status.
        createdAt:
          type: string
          format: date-time
          description: Fleet creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Fleet last update timestamp.
      required:
        - id
        - tenantId
        - name
        - status
        - createdAt
        - updatedAt
      description: DTO for returning fleet information outside the fleets module.
    FleetsEventFleetCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        name:
          type: string
          description: Human-readable fleet name.
        status:
          allOf:
            - $ref: "#/components/schemas/FleetsFleetStatus"
            - description: Current fleet status.
        createdAt:
          type: string
          format: date-time
          description: Fleet creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Fleet last update timestamp.
      required:
        - id
        - tenantId
        - name
        - status
        - createdAt
        - updatedAt
      description: Event emitted after a fleet is created successfully.
    FleetsEventFleetUpdated:
      type: object
      properties:
        id:
          type: string
          description: Unique fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        name:
          type: string
          description: Human-readable fleet name.
        status:
          allOf:
            - $ref: "#/components/schemas/FleetsFleetStatus"
            - description: Current fleet status.
        createdAt:
          type: string
          format: date-time
          description: Fleet creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Fleet last update timestamp.
      required:
        - id
        - tenantId
        - name
        - status
        - createdAt
        - updatedAt
      description: Event emitted after a fleet is updated successfully.
    FleetsFleet:
      type: object
      properties:
        id:
          type: string
          description: Unique fleet identifier (ULID).
        tenantId:
          type: string
          description: Parent tenant identifier (ULID).
        name:
          type: string
          description: Human-readable fleet name.
        status:
          allOf:
            - $ref: "#/components/schemas/FleetsFleetStatus"
            - description: Current fleet status.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the fleet was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the fleet was last updated.
      required:
        - id
        - tenantId
        - name
        - status
        - createdAt
        - updatedAt
      description: Internal fleet entity representing one logical rider group under a
        tenant.
    FleetsFleetFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: Explicit fleet identifiers allowed by the caller scope.
        tenantIds:
          type: array
          items:
            type: string
          description: Explicit tenant identifiers allowed by the caller scope.
        status:
          allOf:
            - $ref: "#/components/schemas/FleetsFleetStatus"
            - description: Optional fleet status filter.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - ids
        - tenantIds
        - pagination
      description: |-
        Internal fleet query filter used by fleets storage adapters.

        Empty arrays mean the corresponding dimension is not restrictive.
    FleetsFleetPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/FleetsFleet"
          description: Fleet records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated fleet result used by fleets storage adapters.
    FleetsInteropGetFleetByIdInput:
      type: object
      properties:
        fleetId:
          type: string
          description: Fleet identifier (ULID).
      required:
        - fleetId
      description: Input contract to resolve one fleet by identifier in trusted
        inter-module flows.
    FleetsInteropGetFleetByIdOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether a fleet exists for the requested identifier.
        fleet:
          allOf:
            - $ref: "#/components/schemas/FleetsDtoFleet"
            - description: Resolved fleet projection when found is true.
      required:
        - found
      description: Output contract for fleet resolution in trusted inter-module flows.
    FleetsProcsFleet:
      type: object
      properties:
        createFleet:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                  description: Parent tenant identifier.
                name:
                  type: string
                  description: Human-readable fleet name.
              required:
                - tenantId
                - name
            output:
              type: object
              properties:
                fleet:
                  allOf:
                    - $ref: "#/components/schemas/FleetsDtoFleet"
                    - description: Newly created fleet.
              required:
                - fleet
          required:
            - input
            - output
        getFleet:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Fleet identifier.
              required:
                - id
            output:
              type: object
              properties:
                fleet:
                  allOf:
                    - $ref: "#/components/schemas/FleetsDtoFleet"
                    - description: Requested fleet.
              required:
                - fleet
          required:
            - input
            - output
        updateFleet:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Fleet identifier.
                name:
                  type: string
                  description: Updated fleet name.
                status:
                  allOf:
                    - $ref: "#/components/schemas/FleetsFleetStatus"
                    - description: Updated fleet status.
              required:
                - id
            output:
              type: object
              properties:
                fleet:
                  allOf:
                    - $ref: "#/components/schemas/FleetsDtoFleet"
                    - description: Updated fleet.
              required:
                - fleet
          required:
            - input
            - output
        listFleets:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                tenantId:
                  type: string
                  description: Optional parent tenant filter.
                status:
                  allOf:
                    - $ref: "#/components/schemas/FleetsFleetStatus"
                    - description: Optional fleet status filter.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/FleetsDtoFleet"
                  description: Visible fleets.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
      required:
        - createFleet
        - getFleet
        - updateFleet
        - listFleets
      description: Procedure group for fleet management.
    MerchantsDtoMerchant:
      type: object
      properties:
        id:
          type: string
          description: Unique merchant identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        name:
          type: string
          description: Human-readable merchant name.
        status:
          allOf:
            - $ref: "#/components/schemas/MerchantsMerchantStatus"
            - description: Current merchant status.
        latitude:
          type: integer
          description: Latitude in signed microdegrees.
        longitude:
          type: integer
          description: Longitude in signed microdegrees.
        maxRadiusKm:
          type: integer
          description: Maximum service radius in kilometers.
        createdAt:
          type: string
          format: date-time
          description: Merchant creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Merchant last update timestamp.
      required:
        - id
        - tenantId
        - name
        - status
        - latitude
        - longitude
        - maxRadiusKm
        - createdAt
        - updatedAt
      description: DTO for returning merchant information outside the merchants module.
    MerchantsEventMerchantCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique merchant identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        name:
          type: string
          description: Human-readable merchant name.
        status:
          allOf:
            - $ref: "#/components/schemas/MerchantsMerchantStatus"
            - description: Current merchant status.
        latitude:
          type: integer
          description: Latitude in signed microdegrees.
        longitude:
          type: integer
          description: Longitude in signed microdegrees.
        maxRadiusKm:
          type: integer
          description: Maximum service radius in kilometers.
        createdAt:
          type: string
          format: date-time
          description: Merchant creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Merchant last update timestamp.
      required:
        - id
        - tenantId
        - name
        - status
        - latitude
        - longitude
        - maxRadiusKm
        - createdAt
        - updatedAt
      description: Event emitted after a merchant is created successfully.
    MerchantsEventMerchantUpdated:
      type: object
      properties:
        id:
          type: string
          description: Unique merchant identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        name:
          type: string
          description: Human-readable merchant name.
        status:
          allOf:
            - $ref: "#/components/schemas/MerchantsMerchantStatus"
            - description: Current merchant status.
        latitude:
          type: integer
          description: Latitude in signed microdegrees.
        longitude:
          type: integer
          description: Longitude in signed microdegrees.
        maxRadiusKm:
          type: integer
          description: Maximum service radius in kilometers.
        createdAt:
          type: string
          format: date-time
          description: Merchant creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Merchant last update timestamp.
      required:
        - id
        - tenantId
        - name
        - status
        - latitude
        - longitude
        - maxRadiusKm
        - createdAt
        - updatedAt
      description: Event emitted after a merchant is updated successfully.
    MerchantsInteropGetMerchantByIdInput:
      type: object
      properties:
        merchantId:
          type: string
          description: Merchant identifier (ULID).
      required:
        - merchantId
      description: Input contract to resolve one merchant by identifier in trusted
        inter-module flows.
    MerchantsInteropGetMerchantByIdOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether a merchant exists for the requested identifier.
        merchant:
          allOf:
            - $ref: "#/components/schemas/MerchantsDtoMerchant"
            - description: Resolved merchant projection when found is true.
      required:
        - found
      description: Output contract for merchant resolution in trusted inter-module flows.
    MerchantsMerchant:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the merchant (ULID).
        tenantId:
          type: string
          description: Parent tenant identifier (ULID).
        name:
          type: string
          description: Human-readable merchant name.
        status:
          allOf:
            - $ref: "#/components/schemas/MerchantsMerchantStatus"
            - description: Current merchant status.
        latitude:
          type: integer
          description: Latitude in signed microdegrees.
        longitude:
          type: integer
          description: Longitude in signed microdegrees.
        maxRadiusKm:
          type: integer
          description: Maximum service radius in kilometers.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the merchant was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the merchant was last updated.
      required:
        - id
        - tenantId
        - name
        - status
        - latitude
        - longitude
        - maxRadiusKm
        - createdAt
        - updatedAt
      description: >-
        Internal merchant entity representing one origin point under a tenant.


        Coordinates are stored as signed microdegrees to keep VDL numeric
        primitives integer-only.

        For example, `-34603700` means `-34.603700` degrees.
    MerchantsMerchantFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: Explicit merchant identifiers allowed by the caller scope.
        tenantIds:
          type: array
          items:
            type: string
          description: Explicit tenant identifiers allowed by the caller scope.
        status:
          allOf:
            - $ref: "#/components/schemas/MerchantsMerchantStatus"
            - description: Optional merchant status filter.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - ids
        - tenantIds
        - pagination
      description: |-
        Internal merchant query filter used by merchants storage adapters.

        Empty arrays mean the corresponding dimension is not restrictive.
    MerchantsMerchantPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/MerchantsMerchant"
          description: Merchant records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated merchant result used by merchants storage adapters.
    MerchantsProcsMerchant:
      type: object
      properties:
        createMerchant:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                  description: Parent tenant identifier.
                name:
                  type: string
                  description: Human-readable merchant name.
                latitude:
                  type: integer
                  description: Latitude in signed microdegrees.
                longitude:
                  type: integer
                  description: Longitude in signed microdegrees.
                maxRadiusKm:
                  type: integer
                  description: Maximum service radius in kilometers.
              required:
                - tenantId
                - name
                - latitude
                - longitude
                - maxRadiusKm
            output:
              type: object
              properties:
                merchant:
                  allOf:
                    - $ref: "#/components/schemas/MerchantsDtoMerchant"
                    - description: Newly created merchant.
              required:
                - merchant
          required:
            - input
            - output
          description: |-
            Creates a merchant under one tenant.

            Authorization constraints:
            - `TenantAdmin` of the parent tenant.
            - `SystemAdmin` through authz global access.
        getMerchant:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Merchant identifier.
              required:
                - id
            output:
              type: object
              properties:
                merchant:
                  allOf:
                    - $ref: "#/components/schemas/MerchantsDtoMerchant"
                    - description: Requested merchant.
              required:
                - merchant
          required:
            - input
            - output
          description: |-
            Returns one merchant by identifier.

            Authorization constraints:
            - `MerchantManager` of the same merchant.
            - `TenantAdmin` of the parent tenant.
            - `SystemAdmin` through authz global access.
        updateMerchant:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Merchant identifier.
                name:
                  type: string
                  description: Updated merchant name.
                status:
                  allOf:
                    - $ref: "#/components/schemas/MerchantsMerchantStatus"
                    - description: Updated merchant status.
                latitude:
                  type: integer
                  description: Updated latitude in signed microdegrees.
                longitude:
                  type: integer
                  description: Updated longitude in signed microdegrees.
                maxRadiusKm:
                  type: integer
                  description: Updated maximum service radius in kilometers.
              required:
                - id
            output:
              type: object
              properties:
                merchant:
                  allOf:
                    - $ref: "#/components/schemas/MerchantsDtoMerchant"
                    - description: Updated merchant.
              required:
                - merchant
          required:
            - input
            - output
          description: |-
            Updates one merchant.

            Authorization constraints:
            - `MerchantManager` of the same merchant.
            - `TenantAdmin` of the parent tenant.
            - `SystemAdmin` through authz global access.
        listMerchants:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                tenantId:
                  type: string
                  description: Optional parent tenant filter.
                status:
                  allOf:
                    - $ref: "#/components/schemas/MerchantsMerchantStatus"
                    - description: Optional merchant status filter.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/MerchantsDtoMerchant"
                  description: Visible merchants.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: |-
            Lists merchants visible to the current actor.

            Authorization constraints:
            - `MerchantManager` sees only explicitly assigned merchants.
            - `TenantAdmin` sees merchants under authorized tenants.
            - `SystemAdmin` sees every merchant.
      required:
        - createMerchant
        - getMerchant
        - updateMerchant
        - listMerchants
      description: Procedure group for merchant management.
    NotesDtoNote:
      type: object
      properties:
        id:
          type: string
        authorId:
          type: string
        entityType:
          $ref: "#/components/schemas/NotesEntityType"
        entityId:
          type: string
        contextType:
          $ref: "#/components/schemas/AuthzContextType"
        contextId:
          type: string
        content:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - authorId
        - entityType
        - entityId
        - contextType
        - content
        - createdAt
        - updatedAt
      description: DTO returned for note reads and writes.
    NotesNote:
      type: object
      properties:
        id:
          type: string
          description: Note identifier (ULID).
        authorId:
          type: string
          description: Author identity identifier (ULID).
        entityType:
          allOf:
            - $ref: "#/components/schemas/NotesEntityType"
            - description: Target entity kind.
        entityId:
          type: string
          description: Target entity identifier (ULID).
        contextType:
          allOf:
            - $ref: "#/components/schemas/AuthzContextType"
            - description: Authorization context type used to protect this note.
        contextId:
          type: string
          description: Authorization context identifier when the note is scoped below
            system level.
        content:
          type: string
          description: Plain-text note content.
        createdAt:
          type: string
          format: date-time
          description: Note creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Note last update timestamp.
      required:
        - id
        - authorId
        - entityType
        - entityId
        - contextType
        - content
        - createdAt
        - updatedAt
      description: Internal note entity.
    NotesNoteFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
        entityType:
          $ref: "#/components/schemas/NotesEntityType"
        entityId:
          type: string
        authorId:
          type: string
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - ids
        - pagination
      description: Internal note query filter used by storage adapters.
    NotesNotePage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/NotesNote"
          description: Note records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated note result used by storage adapters.
    NotesProcsNote:
      type: object
      properties:
        createNote:
          type: object
          properties:
            input:
              type: object
              properties:
                entityType:
                  $ref: "#/components/schemas/NotesEntityType"
                entityId:
                  type: string
                contextType:
                  $ref: "#/components/schemas/AuthzContextType"
                contextId:
                  type: string
                content:
                  type: string
              required:
                - entityType
                - entityId
                - contextType
                - content
            output:
              type: object
              properties:
                note:
                  $ref: "#/components/schemas/NotesDtoNote"
              required:
                - note
          required:
            - input
            - output
        getNote:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
            output:
              type: object
              properties:
                note:
                  $ref: "#/components/schemas/NotesDtoNote"
              required:
                - note
          required:
            - input
            - output
        listNotes:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  $ref: "#/components/schemas/PaginationCursorRequest"
                entityType:
                  $ref: "#/components/schemas/NotesEntityType"
                entityId:
                  type: string
              required:
                - pagination
                - entityType
                - entityId
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/NotesDtoNote"
                pagination:
                  $ref: "#/components/schemas/PaginationCursorResponse"
              required:
                - items
                - pagination
          required:
            - input
            - output
        updateNote:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                content:
                  type: string
              required:
                - id
                - content
            output:
              type: object
              properties:
                note:
                  $ref: "#/components/schemas/NotesDtoNote"
              required:
                - note
          required:
            - input
            - output
        deleteNote:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
            output:
              type: object
              properties: {}
          required:
            - input
            - output
      required:
        - createNote
        - getNote
        - listNotes
        - updateNote
        - deleteNote
      description: Procedure group for operational notes attached to platform entities.
    OrdersAttachment:
      type: object
      properties:
        id:
          type: string
          description: Attachment identifier (ULID).
        orderId:
          type: string
          description: Order identifier this attachment belongs to.
        fileId:
          type: string
          description: File identifier from the files module (ULID).
        tag:
          allOf:
            - $ref: "#/components/schemas/OrdersAttachmentTag"
            - description: Category tag for operational grouping.
        note:
          type: string
          description: Optional free-text context provided by the rider.
        createdAt:
          type: string
          format: date-time
          description: Attachment creation timestamp.
      required:
        - id
        - orderId
        - fileId
        - tag
        - createdAt
      description: Internal order attachment entity.
    OrdersDtoAttachment:
      type: object
      properties:
        id:
          type: string
        orderId:
          type: string
        fileId:
          type: string
        tag:
          $ref: "#/components/schemas/OrdersAttachmentTag"
        note:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - orderId
        - fileId
        - tag
        - createdAt
      description: DTO for returning order attachment information outside the orders module.
    OrdersDtoAttachmentItem:
      type: object
      properties:
        id:
          type: string
        tag:
          $ref: "#/components/schemas/OrdersAttachmentTag"
        note:
          type: string
        fileUrl:
          type: string
      required:
        - id
        - tag
        - fileUrl
      description: DTO for attachment list items, includes the public file URL.
    OrdersDtoOrder:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
      description: DTO for returning order information outside the orders module.
    OrdersEventOrderAssigned:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
    OrdersEventOrderCanceled:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
    OrdersEventOrderCompleted:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
    OrdersEventOrderFailed:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
    OrdersEventOrderPending:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
    OrdersEventOrderRouted:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        tenantId:
          type: string
        merchantId:
          type: string
        fleetId:
          type: string
        riderId:
          type: string
        assignmentMode:
          $ref: "#/components/schemas/OrdersAssignmentMode"
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pickupPayAmount:
          type: integer
        pickupCollectAmount:
          type: integer
        deliveryPayAmount:
          type: integer
        deliveryCollectAmount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        customerName:
          type: string
        customerAddress:
          type: string
        customerLatitude:
          type: integer
        customerLongitude:
          type: integer
        customerPhoneCountryCode:
          type: string
        customerPhoneNumber:
          type: string
        contents:
          type: string
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
    OrdersEventOrderStatusChanged:
      type: object
      properties:
        id:
          type: string
        order:
          $ref: "#/components/schemas/OrdersDtoOrder"
        previousStatus:
          $ref: "#/components/schemas/OrdersOrderStatus"
        newStatus:
          $ref: "#/components/schemas/OrdersOrderStatus"
        authorId:
          type: string
      required:
        - id
        - order
        - newStatus
    OrdersInteropGetOrderByIdInput:
      type: object
      properties:
        orderId:
          type: string
      required:
        - orderId
    OrdersInteropGetOrderByIdOutput:
      type: object
      properties:
        found:
          type: boolean
        order:
          $ref: "#/components/schemas/OrdersDtoOrder"
      required:
        - found
    OrdersOrder:
      type: object
      properties:
        id:
          type: string
          description: Primary order identifier (ULID).
        code:
          type: string
          description: Public human-facing code.
        tenantId:
          type: string
          description: Parent tenant identifier derived from the merchant lineage.
        merchantId:
          type: string
          description: Origin merchant identifier.
        fleetId:
          type: string
          description: Assigned fleet identifier when routed.
        riderId:
          type: string
          description: Assigned rider identifier when assigned.
        assignmentMode:
          allOf:
            - $ref: "#/components/schemas/OrdersAssignmentMode"
            - description: Assignment mode when a rider is assigned.
        status:
          allOf:
            - $ref: "#/components/schemas/OrdersOrderStatus"
            - description: Current order status.
        pickupPayAmount:
          type: integer
          description: Amount the rider pays at pickup, in cents.
        pickupCollectAmount:
          type: integer
          description: Amount the rider collects at pickup, in cents.
        deliveryPayAmount:
          type: integer
          description: Amount the rider pays at delivery, in cents.
        deliveryCollectAmount:
          type: integer
          description: Amount the rider collects at delivery, in cents.
        createdAt:
          type: string
          format: date-time
          description: Order creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Order last update timestamp.
        customerName:
          type: string
          description: Customer full name.
        customerAddress:
          type: string
          description: Customer delivery address.
        customerLatitude:
          type: integer
          description: Customer location latitude in signed microdegrees.
        customerLongitude:
          type: integer
          description: Customer location longitude in signed microdegrees.
        customerPhoneCountryCode:
          type: string
          description: Customer contact phone country code (e.g. +1, +52).
        customerPhoneNumber:
          type: string
          description: Customer contact phone number.
        contents:
          type: string
          description: "Contents of the order: products, packages, or any description of
            what is being shipped."
      required:
        - id
        - code
        - tenantId
        - merchantId
        - status
        - pickupPayAmount
        - pickupCollectAmount
        - deliveryPayAmount
        - deliveryCollectAmount
        - createdAt
        - updatedAt
        - customerName
        - customerAddress
        - customerLatitude
        - customerLongitude
        - customerPhoneCountryCode
        - customerPhoneNumber
        - contents
      description: Internal order entity.
    OrdersOrderFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
        tenantIds:
          type: array
          items:
            type: string
        merchantIds:
          type: array
          items:
            type: string
        fleetIds:
          type: array
          items:
            type: string
        riderIds:
          type: array
          items:
            type: string
        status:
          $ref: "#/components/schemas/OrdersOrderStatus"
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - ids
        - tenantIds
        - merchantIds
        - fleetIds
        - riderIds
        - pagination
      description: Internal order query filter used by orders storage adapters.
    OrdersOrderPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/OrdersOrder"
          description: Order records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated order result used by orders storage adapters.
    OrdersProcsOrder:
      type: object
      properties:
        createOrder:
          type: object
          properties:
            input:
              type: object
              properties:
                merchantId:
                  type: string
                pickupPayAmount:
                  type: integer
                pickupCollectAmount:
                  type: integer
                deliveryPayAmount:
                  type: integer
                deliveryCollectAmount:
                  type: integer
                customerName:
                  type: string
                customerAddress:
                  type: string
                customerLatitude:
                  type: integer
                customerLongitude:
                  type: integer
                customerPhoneCountryCode:
                  type: string
                customerPhoneNumber:
                  type: string
                contents:
                  type: string
              required:
                - merchantId
                - pickupPayAmount
                - pickupCollectAmount
                - deliveryPayAmount
                - deliveryCollectAmount
                - customerName
                - customerAddress
                - customerLatitude
                - customerLongitude
                - customerPhoneCountryCode
                - customerPhoneNumber
                - contents
            output:
              type: object
              properties:
                order:
                  $ref: "#/components/schemas/OrdersDtoOrder"
              required:
                - order
          required:
            - input
            - output
        getOrder:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
            output:
              type: object
              properties:
                order:
                  $ref: "#/components/schemas/OrdersDtoOrder"
              required:
                - order
          required:
            - input
            - output
        listOrders:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  $ref: "#/components/schemas/PaginationCursorRequest"
                tenantId:
                  type: string
                merchantId:
                  type: string
                fleetId:
                  type: string
                riderId:
                  type: string
                status:
                  $ref: "#/components/schemas/OrdersOrderStatus"
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/OrdersDtoOrder"
                pagination:
                  $ref: "#/components/schemas/PaginationCursorResponse"
              required:
                - items
                - pagination
          required:
            - input
            - output
        routeOrderToFleet:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                fleetId:
                  type: string
              required:
                - id
                - fleetId
            output:
              type: object
              properties:
                order:
                  $ref: "#/components/schemas/OrdersDtoOrder"
              required:
                - order
          required:
            - input
            - output
        assignOrderToRider:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                riderId:
                  type: string
                mode:
                  $ref: "#/components/schemas/OrdersAssignmentMode"
              required:
                - id
                - riderId
                - mode
            output:
              type: object
              properties:
                order:
                  $ref: "#/components/schemas/OrdersDtoOrder"
              required:
                - order
          required:
            - input
            - output
        updateOrderStatus:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                status:
                  $ref: "#/components/schemas/OrdersOrderStatus"
              required:
                - id
                - status
            output:
              type: object
              properties:
                order:
                  $ref: "#/components/schemas/OrdersDtoOrder"
              required:
                - order
          required:
            - input
            - output
        addAttachment:
          type: object
          properties:
            input:
              type: object
              properties:
                orderId:
                  type: string
                  description: The order identifier (ULID).
                uploadId:
                  type: string
                  description: The upload identifier (UUIDv4) returned by files.generateUploadUrl.
                originalName:
                  type: string
                  description: Original client-side filename from the upload.
                mimeType:
                  type: string
                  description: Declared MIME type from the upload.
                sizeBytes:
                  type: integer
                  description: Declared file size in bytes from the upload.
                tag:
                  allOf:
                    - $ref: "#/components/schemas/OrdersAttachmentTag"
                    - description: Category tag for operational grouping.
                note:
                  type: string
                  description: Optional free-text context from the rider.
              required:
                - orderId
                - uploadId
                - originalName
                - mimeType
                - sizeBytes
                - tag
            output:
              type: object
              properties:
                attachment:
                  allOf:
                    - $ref: "#/components/schemas/OrdersDtoAttachment"
                    - description: The newly created attachment.
              required:
                - attachment
          required:
            - input
            - output
        listAttachments:
          type: object
          properties:
            input:
              type: object
              properties:
                orderId:
                  type: string
                  description: The order identifier (ULID).
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
              required:
                - orderId
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/OrdersDtoAttachmentItem"
                  description: Attachment items with public file URLs.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
      required:
        - createOrder
        - getOrder
        - listOrders
        - routeOrderToFleet
        - assignOrderToRider
        - updateOrderStatus
        - addAttachment
        - listAttachments
      description: Procedure group for order lifecycle orchestration.
    OrdersStatusLog:
      type: object
      properties:
        id:
          type: string
          description: Status log identifier (ULID).
        orderId:
          type: string
          description: Order identifier.
        previousStatus:
          allOf:
            - $ref: "#/components/schemas/OrdersOrderStatus"
            - description: Previous status when available.
        newStatus:
          allOf:
            - $ref: "#/components/schemas/OrdersOrderStatus"
            - description: New status applied by this transition.
        authorId:
          type: string
          description: Acting user identity when available.
        createdAt:
          type: string
          format: date-time
          description: Status log creation timestamp.
      required:
        - id
        - orderId
        - newStatus
        - createdAt
      description: Immutable order status log entry.
    PaginationCursorRequest:
      type: object
      properties:
        cursor:
          type: string
          description: Optional cursor to continue from; when omitted, the first cursor is
            used.
        limit:
          type: integer
          description: Optional result count limit; defaults to 10 and must be between 1
            and 100.
      description: Request payload for cursor-based pagination.
    PaginationCursorResponse:
      type: object
      properties:
        hasNextCursor:
          type: boolean
          description: True when there is at least one cursor after the current cursor.
        nextCursor:
          type: string
          description: Cursor that points to the next page.
        cursor:
          type: string
          description: Cursor used for the current page.
        limit:
          type: integer
          description: Effective result count limit applied to this page.
      required:
        - hasNextCursor
        - cursor
        - limit
      description: Response metadata for cursor-based pagination.
    PaginationPageRequest:
      type: object
      properties:
        page:
          type: integer
          description: Optional 1-based page index; when omitted, the first page is used.
        limit:
          type: integer
          description: Optional result count limit; defaults to 10 and must be between 1
            and 100.
      description: Request payload for page-based pagination.
    PaginationPageResponse:
      type: object
      properties:
        hasNextPage:
          type: boolean
          description: True when there is at least one page after the current page.
        nextPage:
          type: integer
          description: Next 1-based page index when available.
        hasPreviousPage:
          type: boolean
          description: True when there is at least one page before the current page.
        previousPage:
          type: integer
          description: Previous 1-based page index when available.
        totalPages:
          type: integer
          description: Total number of pages when known.
        page:
          type: integer
          description: Current 1-based page index.
        limit:
          type: integer
          description: Effective result count limit applied to this page.
      required:
        - hasNextPage
        - hasPreviousPage
        - page
        - limit
      description: Response metadata for page-based pagination.
    RidersDtoRider:
      type: object
      properties:
        id:
          type: string
          description: Rider identifier.
        fleetId:
          type: string
          description: Parent fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        vehicleType:
          allOf:
            - $ref: "#/components/schemas/RidersVehicleType"
            - description: Vehicle type used by the rider.
        licensePlate:
          type: string
          description: Optional license plate.
        status:
          allOf:
            - $ref: "#/components/schemas/RidersRiderStatus"
            - description: Current operational rider status.
        currentLatitude:
          type: integer
          description: Current latitude in signed microdegrees when known.
        currentLongitude:
          type: integer
          description: Current longitude in signed microdegrees when known.
        createdAt:
          type: string
          format: date-time
          description: Rider creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Rider last update timestamp.
      required:
        - id
        - fleetId
        - tenantId
        - vehicleType
        - status
        - createdAt
        - updatedAt
      description: DTO for returning rider information outside the riders module.
    RidersEventRiderCreated:
      type: object
      properties:
        id:
          type: string
          description: Rider identifier.
        fleetId:
          type: string
          description: Parent fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        vehicleType:
          allOf:
            - $ref: "#/components/schemas/RidersVehicleType"
            - description: Vehicle type used by the rider.
        licensePlate:
          type: string
          description: Optional license plate.
        status:
          allOf:
            - $ref: "#/components/schemas/RidersRiderStatus"
            - description: Current operational rider status.
        currentLatitude:
          type: integer
          description: Current latitude in signed microdegrees when known.
        currentLongitude:
          type: integer
          description: Current longitude in signed microdegrees when known.
        createdAt:
          type: string
          format: date-time
          description: Rider creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Rider last update timestamp.
      required:
        - id
        - fleetId
        - tenantId
        - vehicleType
        - status
        - createdAt
        - updatedAt
      description: Event emitted after a rider is created successfully.
    RidersEventRiderUpdated:
      type: object
      properties:
        id:
          type: string
          description: Rider identifier.
        fleetId:
          type: string
          description: Parent fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier.
        vehicleType:
          allOf:
            - $ref: "#/components/schemas/RidersVehicleType"
            - description: Vehicle type used by the rider.
        licensePlate:
          type: string
          description: Optional license plate.
        status:
          allOf:
            - $ref: "#/components/schemas/RidersRiderStatus"
            - description: Current operational rider status.
        currentLatitude:
          type: integer
          description: Current latitude in signed microdegrees when known.
        currentLongitude:
          type: integer
          description: Current longitude in signed microdegrees when known.
        createdAt:
          type: string
          format: date-time
          description: Rider creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Rider last update timestamp.
      required:
        - id
        - fleetId
        - tenantId
        - vehicleType
        - status
        - createdAt
        - updatedAt
      description: Event emitted after a rider is updated successfully.
    RidersInteropGetRiderByIdInput:
      type: object
      properties:
        riderId:
          type: string
          description: Rider identifier (ULID).
      required:
        - riderId
      description: Input contract to resolve one rider by identifier in trusted
        inter-module flows.
    RidersInteropGetRiderByIdOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether a rider exists for the requested identifier.
        rider:
          allOf:
            - $ref: "#/components/schemas/RidersDtoRider"
            - description: Resolved rider projection when found is true.
      required:
        - found
      description: Output contract for rider resolution in trusted inter-module flows.
    RidersProcsRider:
      type: object
      properties:
        createRider:
          type: object
          properties:
            input:
              type: object
              properties:
                userId:
                  type: string
                  description: Rider identifier, equal to the target user identity ULID.
                fleetId:
                  type: string
                  description: Target fleet identifier.
                vehicleType:
                  allOf:
                    - $ref: "#/components/schemas/RidersVehicleType"
                    - description: Rider vehicle type.
                licensePlate:
                  type: string
                  description: Optional license plate. Empty string clears the value.
              required:
                - userId
                - fleetId
                - vehicleType
            output:
              type: object
              properties:
                rider:
                  allOf:
                    - $ref: "#/components/schemas/RidersDtoRider"
                    - description: Newly created rider.
              required:
                - rider
          required:
            - input
            - output
        getRider:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Rider identifier.
              required:
                - id
            output:
              type: object
              properties:
                rider:
                  allOf:
                    - $ref: "#/components/schemas/RidersDtoRider"
                    - description: Requested rider.
              required:
                - rider
          required:
            - input
            - output
        updateRider:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Rider identifier.
                fleetId:
                  type: string
                  description: Updated fleet identifier.
                vehicleType:
                  allOf:
                    - $ref: "#/components/schemas/RidersVehicleType"
                    - description: Updated vehicle type.
                licensePlate:
                  type: string
                  description: Updated license plate. Empty string clears the value.
              required:
                - id
            output:
              type: object
              properties:
                rider:
                  allOf:
                    - $ref: "#/components/schemas/RidersDtoRider"
                    - description: Updated rider.
              required:
                - rider
          required:
            - input
            - output
        updateRiderStatus:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Rider identifier.
                status:
                  allOf:
                    - $ref: "#/components/schemas/RidersRiderStatus"
                    - description: Updated rider status.
              required:
                - id
                - status
            output:
              type: object
              properties:
                rider:
                  allOf:
                    - $ref: "#/components/schemas/RidersDtoRider"
                    - description: Updated rider.
              required:
                - rider
          required:
            - input
            - output
        updateRiderLocation:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Rider identifier.
                latitude:
                  type: integer
                  description: Updated latitude in signed microdegrees. Empty clears the value
                    together with longitude when both are omitted or empty.
                longitude:
                  type: integer
                  description: Updated longitude in signed microdegrees.
              required:
                - id
            output:
              type: object
              properties:
                rider:
                  allOf:
                    - $ref: "#/components/schemas/RidersDtoRider"
                    - description: Updated rider.
              required:
                - rider
          required:
            - input
            - output
        listRiders:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                tenantId:
                  type: string
                  description: Optional tenant filter.
                fleetId:
                  type: string
                  description: Optional fleet filter.
                status:
                  allOf:
                    - $ref: "#/components/schemas/RidersRiderStatus"
                    - description: Optional rider status filter.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/RidersDtoRider"
                  description: Visible riders.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
      required:
        - createRider
        - getRider
        - updateRider
        - updateRiderStatus
        - updateRiderLocation
        - listRiders
      description: Procedure group for rider management.
    RidersRider:
      type: object
      properties:
        id:
          type: string
          description: Rider identifier, equal to the underlying user identity ULID.
        fleetId:
          type: string
          description: Parent fleet identifier.
        tenantId:
          type: string
          description: Parent tenant identifier derived from the fleet lineage.
        vehicleType:
          allOf:
            - $ref: "#/components/schemas/RidersVehicleType"
            - description: Vehicle type used by the rider.
        licensePlate:
          type: string
          description: Optional license plate.
        status:
          allOf:
            - $ref: "#/components/schemas/RidersRiderStatus"
            - description: Current operational rider status.
        currentLatitude:
          type: integer
          description: Current latitude in signed microdegrees when known.
        currentLongitude:
          type: integer
          description: Current longitude in signed microdegrees when known.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the rider profile was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the rider profile was last updated.
      required:
        - id
        - fleetId
        - tenantId
        - vehicleType
        - status
        - createdAt
        - updatedAt
      description: >-
        Internal rider entity representing one operational extension of a base
        user profile.


        `id` reuses the same ULID as the underlying authn/users identity.

        Coordinates are stored as signed microdegrees.
    RidersRiderFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: Explicit rider identifiers allowed by the caller scope.
        fleetIds:
          type: array
          items:
            type: string
          description: Explicit fleet identifiers allowed by the caller scope.
        tenantIds:
          type: array
          items:
            type: string
          description: Explicit tenant identifiers allowed by the caller scope.
        status:
          allOf:
            - $ref: "#/components/schemas/RidersRiderStatus"
            - description: Optional rider status filter.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - ids
        - fleetIds
        - tenantIds
        - pagination
      description: Internal rider query filter used by riders storage adapters.
    RidersRiderPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/RidersRider"
          description: Rider records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated rider result used by riders storage adapters.
    TenantsDtoTenant:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the tenant.
        name:
          type: string
          description: Name of the tenant.
        status:
          allOf:
            - $ref: "#/components/schemas/TenantsTenantStatus"
            - description: Current status of the tenant account.
        isDemo:
          type: boolean
          description: Indicates if this is a demo tenant.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was last updated.
      required:
        - id
        - name
        - status
        - isDemo
        - createdAt
        - updatedAt
      description: DTO for returning tenant information.
    TenantsEventTenantCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the tenant.
        name:
          type: string
          description: Name of the tenant.
        status:
          allOf:
            - $ref: "#/components/schemas/TenantsTenantStatus"
            - description: Current status of the tenant account.
        isDemo:
          type: boolean
          description: Indicates if this is a demo tenant.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was last updated.
      required:
        - id
        - name
        - status
        - isDemo
        - createdAt
        - updatedAt
      description: Event emitted after a new tenant is created successfully.
    TenantsEventTenantUpdated:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the tenant.
        name:
          type: string
          description: Name of the tenant.
        status:
          allOf:
            - $ref: "#/components/schemas/TenantsTenantStatus"
            - description: Current status of the tenant account.
        isDemo:
          type: boolean
          description: Indicates if this is a demo tenant.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was last updated.
      required:
        - id
        - name
        - status
        - isDemo
        - createdAt
        - updatedAt
      description: Event emitted after an existing tenant is updated successfully.
    TenantsInteropCheckTenantStatusInput:
      type: object
      properties:
        tenantId:
          type: string
          description: Unique identifier for the tenant.
      required:
        - tenantId
      description: Input contract to check tenant status in trusted inter-module flows.
    TenantsInteropCheckTenantStatusOutput:
      type: object
      properties:
        exists:
          type: boolean
          description: Indicates whether the tenant exists.
        isActive:
          type: boolean
          description: Indicates whether the tenant is active. True only if exists is true
            and status is Active.
        isDemo:
          type: boolean
          description: Indicates if this is a demo tenant.
      required:
        - exists
        - isActive
        - isDemo
      description: Output contract for tenant status check in trusted inter-module flows.
    TenantsInteropGetTenantByIdInput:
      type: object
      properties:
        tenantId:
          type: string
          description: Unique identifier for the tenant.
      required:
        - tenantId
      description: Input contract to get a tenant by ID in trusted inter-module flows.
    TenantsInteropGetTenantByIdOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether a tenant exists for the requested identifier.
        tenant:
          allOf:
            - $ref: "#/components/schemas/TenantsDtoTenant"
            - description: Resolved tenant projection when found is true.
      required:
        - found
      description: Output contract for getting a tenant by ID in trusted inter-module flows.
    TenantsProcsTenant:
      type: object
      properties:
        createTenant:
          type: object
          properties:
            input:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the new tenant.
                isDemo:
                  type: boolean
                  description: Indicates if this is a demo tenant.
              required:
                - name
                - isDemo
            output:
              type: object
              properties:
                tenant:
                  allOf:
                    - $ref: "#/components/schemas/TenantsDtoTenant"
                    - description: The newly created tenant.
              required:
                - tenant
          required:
            - input
            - output
          description: >-
            Creates a new tenant.


            The `isDemo` flag can only be set during creation and is immutable
            thereafter.


            Authorization constraints:

            - Restricted to global administrators.
        updateTenantStatus:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Unique identifier for the tenant.
                status:
                  allOf:
                    - $ref: "#/components/schemas/TenantsTenantStatus"
                    - description: The new status for the tenant.
              required:
                - id
                - status
            output:
              type: object
              properties:
                tenant:
                  allOf:
                    - $ref: "#/components/schemas/TenantsDtoTenant"
                    - description: The updated tenant.
              required:
                - tenant
          required:
            - input
            - output
          description: |-
            Updates the status of an existing tenant.

            Authorization constraints:
            - Restricted to global administrators.
        getTenant:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Unique identifier for the tenant.
              required:
                - id
            output:
              type: object
              properties:
                tenant:
                  allOf:
                    - $ref: "#/components/schemas/TenantsDtoTenant"
                    - description: The requested tenant.
              required:
                - tenant
          required:
            - input
            - output
          description: |-
            Retrieves an existing tenant by ID.

            Authorization constraints:
            - TenantAdmin (restricted to their own tenant).
        updateTenant:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Unique identifier for the tenant.
                name:
                  type: string
                  description: Name of the tenant.
              required:
                - id
            output:
              type: object
              properties:
                tenant:
                  allOf:
                    - $ref: "#/components/schemas/TenantsDtoTenant"
                    - description: The updated tenant.
              required:
                - tenant
          required:
            - input
            - output
          description: >-
            Updates an existing tenant.


            Note: The `isDemo` flag is immutable and cannot be updated. This
            operation only updates mutable fields like the tenant's name.


            Authorization constraints:

            - TenantAdmin (restricted to their own tenant).
        listTenants:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                status:
                  allOf:
                    - $ref: "#/components/schemas/TenantsTenantStatus"
                    - description: Status filter.
                isDemo:
                  type: boolean
                  description: Demo flag filter.
              required:
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/TenantsDtoTenant"
                  description: The list of tenants.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: |-
            Lists tenants with pagination and filtering.

            Authorization constraints:
            - TenantAdmin (will only return a list containing their own tenant).
      required:
        - createTenant
        - updateTenantStatus
        - getTenant
        - updateTenant
        - listTenants
      description: Procedure group for tenant management.
    TenantsTenant:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the tenant (ULID).
        name:
          type: string
          description: Name of the tenant.
        status:
          allOf:
            - $ref: "#/components/schemas/TenantsTenantStatus"
            - description: Current status of the tenant account.
        isDemo:
          type: boolean
          description: Indicates if this is a demo tenant.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the tenant was last updated.
      required:
        - id
        - name
        - status
        - isDemo
        - createdAt
        - updatedAt
      description: >-
        Tenant entity representing a customer or organization account.


        This record explicitly excludes billing or ownership information to
        maintain

        separation of concerns according to the modular monolith architecture.
    TenantsTenantFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: Explicit tenant identifiers allowed by the caller scope.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination applied at the storage boundary.
        status:
          allOf:
            - $ref: "#/components/schemas/TenantsTenantStatus"
            - description: Optional status filter.
        isDemo:
          type: boolean
          description: Optional demo-tenant filter.
      required:
        - ids
        - pagination
      description: >-
        Internal tenant query filter used by tenants storage adapters.


        An empty `ids` array means the query is not constrained by explicit
        tenant IDs.
    TenantsTenantPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/TenantsTenant"
          description: Tenant records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated tenant result used by tenants storage adapters.
    UsersDtoUser:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier (ULID).
        firstName:
          type: string
          description: Given or first name for the identity.
        lastName:
          type: string
          description: Family or last name for the identity.
        contactPhoneCountryCode:
          type: string
          description: Contact phone country code for the user without + sign (for
            example, 1, 54, etc).
        contactPhoneNumber:
          type: string
          description: Contact phone local number for the user, without country code.
        createdAt:
          type: string
          format: date-time
          description: Profile creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Profile last update timestamp.
      required:
        - id
        - firstName
        - lastName
        - createdAt
        - updatedAt
      description: >-
        Users DTO for base identity data exposed outside the users module.


        This type excludes authn secrets and focuses only on profile
        information.
    UsersEventUserCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier (ULID).
        firstName:
          type: string
          description: Given or first name for the identity.
        lastName:
          type: string
          description: Family or last name for the identity.
        contactPhoneCountryCode:
          type: string
          description: Contact phone country code for the user without + sign (for
            example, 1, 54, etc).
        contactPhoneNumber:
          type: string
          description: Contact phone local number for the user, without country code.
        createdAt:
          type: string
          format: date-time
          description: Profile creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Profile last update timestamp.
      required:
        - id
        - firstName
        - lastName
        - createdAt
        - updatedAt
      description: Event emitted after a base user profile is created successfully.
    UsersEventUserUpdated:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier (ULID).
        firstName:
          type: string
          description: Given or first name for the identity.
        lastName:
          type: string
          description: Family or last name for the identity.
        contactPhoneCountryCode:
          type: string
          description: Contact phone country code for the user without + sign (for
            example, 1, 54, etc).
        contactPhoneNumber:
          type: string
          description: Contact phone local number for the user, without country code.
        createdAt:
          type: string
          format: date-time
          description: Profile creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Profile last update timestamp.
      required:
        - id
        - firstName
        - lastName
        - createdAt
        - updatedAt
      description: Event emitted after a base user profile is updated successfully.
    UsersInteropGetUserByIdInput:
      type: object
      properties:
        userId:
          type: string
          description: User identifier (ULID).
      required:
        - userId
      description: Input contract to resolve a single base profile by identifier in
        trusted inter-module flows.
    UsersInteropGetUserByIdOutput:
      type: object
      properties:
        found:
          type: boolean
          description: Indicates whether a profile exists for the requested identifier.
        user:
          allOf:
            - $ref: "#/components/schemas/UsersDtoUser"
            - description: Resolved profile projection when found is true.
      required:
        - found
      description: Output contract for single-profile resolution in trusted
        inter-module flows.
    UsersInteropListUsersByIdsInput:
      type: object
      properties:
        userIds:
          type: array
          items:
            type: string
          description: User identifiers (ULID). Duplicates should be ignored by
            implementations.
      required:
        - userIds
      description: Input contract to resolve multiple base profiles by identifiers in
        one request.
    UsersInteropListUsersByIdsOutput:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: "#/components/schemas/UsersDtoUser"
          description: Profiles resolved from the requested identifiers. Order is
            implementation-defined.
      required:
        - users
      description: Output contract for batched profile resolution in trusted
        inter-module flows.
    UsersProcsProfile:
      type: object
      properties:
        getCurrentProfile:
          type: object
          properties:
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/UsersDtoUser"
                    - description: Current authenticated profile for external consumers.
              required:
                - user
          required:
            - output
          description: Returns the base profile for the currently authenticated identity.
        updateCurrentProfile:
          type: object
          properties:
            input:
              type: object
              properties:
                firstName:
                  type: string
                  description: Given or first name for the identity.
                lastName:
                  type: string
                  description: Family or last name for the identity.
                contactPhoneCountryCode:
                  type: string
                  description: Contact phone country code for the user without + sign (for
                    example, 1, 54, etc).
                contactPhoneNumber:
                  type: string
                  description: Contact phone local number for the user, without country code.
            output:
              type: object
              properties:
                user:
                  allOf:
                    - $ref: "#/components/schemas/UsersDtoUser"
                    - description: Updated profile for external consumers.
              required:
                - user
          required:
            - input
            - output
          description: >-
            Replaces the mutable profile fields for the currently authenticated
            identity.


            Omitted optional fields are ignored (partial update). To explicitly
            clear a nullable field like contactPhoneCountryCode or
            contactPhoneNumber, pass an empty string.
      required:
        - getCurrentProfile
        - updateCurrentProfile
      description: Procedure group for self-service profile management.
    UsersUser:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the user profile (ULID).
        firstName:
          type: string
          description: Given or first name for the identity.
        lastName:
          type: string
          description: Family or last name for the identity.
        contactPhoneCountryCode:
          type: string
          description: Contact phone country code for the user without + sign (for
            example, 1, 54, etc).
        contactPhoneNumber:
          type: string
          description: Contact phone local number for the user, without country code.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the profile was created.
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the profile was last updated.
      required:
        - id
        - firstName
        - lastName
        - createdAt
        - updatedAt
      description: >-
        Internal base user profile entity.


        This record represents identity data beyond authentication and is
        intended to be

        provisioned using the same ULID as the corresponding authn identity.
    WebhooksDelivery:
      type: object
      properties:
        id:
          type: string
          description: Unique delivery identifier.
        endpointId:
          type: string
          description: Target endpoint identifier.
        tenantId:
          type: string
          description: Tenant owner of the target endpoint.
        responseStatusCode:
          type: integer
          description: HTTP response status code when available.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the delivery was attempted.
      required:
        - id
        - endpointId
        - tenantId
        - createdAt
      description: Persisted webhook delivery attempt record.
    WebhooksDeliveryFilter:
      type: object
      properties:
        tenantId:
          type: string
          description: Tenant owner filter.
        endpointId:
          type: string
          description: Optional endpoint identifier filter.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - tenantId
        - pagination
      description: Filter criteria for listing webhook deliveries.
    WebhooksDeliveryPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/WebhooksDelivery"
          description: Delivery records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated delivery result used by storage adapters.
    WebhooksDtoDelivery:
      type: object
      properties:
        id:
          type: string
        endpointId:
          type: string
        tenantId:
          type: string
        responseStatusCode:
          type: integer
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - endpointId
        - tenantId
        - createdAt
      description: DTO returned for persisted webhook deliveries.
    WebhooksDtoEndpoint:
      type: object
      properties:
        id:
          type: string
        tenantId:
          type: string
        url:
          type: string
        eventType:
          $ref: "#/components/schemas/WebhooksEventType"
        entityId:
          type: string
        status:
          $ref: "#/components/schemas/WebhooksEndpointStatus"
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - tenantId
        - url
        - eventType
        - status
        - createdAt
        - updatedAt
      description: DTO returned for configured webhook endpoints.
    WebhooksEndpoint:
      type: object
      properties:
        id:
          type: string
          description: Unique endpoint identifier.
        tenantId:
          type: string
          description: Tenant owner of the endpoint.
        url:
          type: string
          description: Absolute destination URL for HTTP POST deliveries.
        eventType:
          allOf:
            - $ref: "#/components/schemas/WebhooksEventType"
            - description: Event type that triggers this endpoint.
        entityId:
          type: string
          description: Optional entity identifier for type-specific filtering (merchant
            ID, fleet ID).
        status:
          allOf:
            - $ref: "#/components/schemas/WebhooksEndpointStatus"
            - description: Current lifecycle status of the endpoint.
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp.
      required:
        - id
        - tenantId
        - url
        - eventType
        - status
        - createdAt
        - updatedAt
      description: Tenant-owned webhook endpoint configuration.
    WebhooksEndpointFilter:
      type: object
      properties:
        tenantId:
          type: string
          description: Tenant owner filter.
        eventType:
          allOf:
            - $ref: "#/components/schemas/WebhooksEventType"
            - description: Optional event type filter.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorRequest"
            - description: Cursor-based pagination parameters applied at the storage boundary.
      required:
        - tenantId
        - pagination
      description: Filter criteria for listing webhook endpoints.
    WebhooksEndpointPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/WebhooksEndpoint"
          description: Endpoint records returned for the requested page.
        pagination:
          allOf:
            - $ref: "#/components/schemas/PaginationCursorResponse"
            - description: Cursor-based pagination metadata for the requested page.
      required:
        - items
        - pagination
      description: Internal paginated endpoint result used by storage adapters.
    WebhooksProcsDelivery:
      type: object
      properties:
        listDeliveries:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                  description: Tenant owner filter.
                endpointId:
                  type: string
                  description: Optional endpoint identifier filter.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
              required:
                - tenantId
                - pagination
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/WebhooksDtoDelivery"
                  description: Persisted delivery attempts.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: >-
            Lists persisted webhook delivery attempts.


            Authorization constraints:

            - Restricted to tenant administrators of the target tenant or global
            administrators.
      required:
        - listDeliveries
      description: Procedure group for webhook delivery audit access.
    WebhooksProcsEndpoint:
      type: object
      properties:
        createEndpoint:
          type: object
          properties:
            input:
              type: object
              properties:
                tenantId:
                  type: string
                  description: Tenant owner for the endpoint.
                url:
                  type: string
                  description: Absolute destination URL for HTTP POST deliveries.
                eventType:
                  allOf:
                    - $ref: "#/components/schemas/WebhooksEventType"
                    - description: Event type that triggers this endpoint.
                entityId:
                  type: string
                  description: Optional entity identifier for merchant-specific or fleet-specific
                    webhooks.
              required:
                - tenantId
                - url
                - eventType
            output:
              type: object
              properties:
                endpoint:
                  allOf:
                    - $ref: "#/components/schemas/WebhooksDtoEndpoint"
                    - description: The newly created endpoint.
              required:
                - endpoint
          required:
            - input
            - output
          description: >-
            Creates a new tenant-owned webhook endpoint.


            Authorization constraints:

            - Restricted to tenant administrators of the target tenant or global
            administrators.
        updateEndpoint:
          type: object
          properties:
            input:
              type: object
              properties:
                id:
                  type: string
                  description: Unique endpoint identifier.
                url:
                  type: string
                  description: Replacement destination URL.
                eventType:
                  allOf:
                    - $ref: "#/components/schemas/WebhooksEventType"
                    - description: Replacement event type.
                entityId:
                  type: string
                  description: Replacement entity identifier.
                status:
                  allOf:
                    - $ref: "#/components/schemas/WebhooksEndpointStatus"
                    - description: Replacement endpoint status.
              required:
                - id
            output:
              type: object
              properties:
                endpoint:
                  allOf:
                    - $ref: "#/components/schemas/WebhooksDtoEndpoint"
                    - description: The updated endpoint.
              required:
                - endpoint
          required:
            - input
            - output
          description: >-
            Updates an existing tenant-owned webhook endpoint.


            Authorization constraints:

            - Restricted to tenant administrators of the endpoint tenant or
            global administrators.
        listEndpoints:
          type: object
          properties:
            input:
              type: object
              properties:
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorRequest"
                    - description: Cursor-based pagination parameters.
                tenantId:
                  type: string
                  description: Tenant owner of the endpoints to list.
                eventType:
                  allOf:
                    - $ref: "#/components/schemas/WebhooksEventType"
                    - description: Optional event type filter.
              required:
                - pagination
                - tenantId
            output:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: "#/components/schemas/WebhooksDtoEndpoint"
                  description: Tenant webhook endpoints.
                pagination:
                  allOf:
                    - $ref: "#/components/schemas/PaginationCursorResponse"
                    - description: Cursor-based pagination metadata.
              required:
                - items
                - pagination
          required:
            - input
            - output
          description: >-
            Lists webhook endpoints for one tenant.


            Authorization constraints:

            - Restricted to tenant administrators of the target tenant or global
            administrators.
      required:
        - createEndpoint
        - updateEndpoint
        - listEndpoints
      description: Procedure group for tenant-owned webhook endpoints.
    AuthnUserStatus:
      type: string
      enum:
        - Active
        - Suspended
      description: Account lifecycle state used by authn policies.
    AuthnUserType:
      type: string
      enum:
        - User
        - Machine
      description: Supported identity categories in the authn module.
    AuthnVerificationTokenPurpose:
      type: string
      enum:
        - EmailVerification
        - EmailChangeConfirmCurrent
        - EmailChangeConfirmNew
        - PasswordReset
      description: Supported verification token purposes in authn flows.
    AuthzContextType:
      type: string
      enum:
        - System
        - Tenant
        - Merchant
        - Fleet
      description: Supported authorization contexts across the platform.
    AuthzRole:
      type: string
      enum:
        - SystemAdmin
        - TenantAdmin
        - TenantOperator
        - MerchantManager
        - MerchantOperator
        - FleetManager
        - FleetRider
      description: Supported roles across all authorization contexts.
    AuthzRoleFleet:
      type: string
      enum:
        - FleetManager
        - FleetRider
      description: Supported roles for the fleet authorization context.
    AuthzRoleMerchant:
      type: string
      enum:
        - MerchantManager
        - MerchantOperator
      description: Supported roles for the merchant authorization context.
    AuthzRoleSystem:
      type: string
      enum:
        - SystemAdmin
      description: Supported roles for the system authorization context.
    AuthzRoleTenant:
      type: string
      enum:
        - TenantAdmin
        - TenantOperator
      description: Supported roles for the tenant authorization context.
    BillingTransactionType:
      type: string
      enum:
        - ManualAdjustment
        - OrderCharge
        - OrderRefund
      description: Supported billing transaction types.
    FleetsFleetStatus:
      type: string
      enum:
        - Active
        - Suspended
      description: Status of a fleet account.
    MerchantsMerchantStatus:
      type: string
      enum:
        - Active
        - Suspended
      description: Status of a merchant account.
    NotesEntityType:
      type: string
      enum:
        - Order
        - Tenant
        - Merchant
        - Fleet
        - Rider
        - User
      description: Supported entity kinds that can carry internal notes.
    OrdersAssignmentMode:
      type: string
      enum:
        - Force
        - Offer
      description: Supported order assignment modes.
    OrdersAttachmentTag:
      type: string
      enum:
        - ProofOfDelivery
        - ProofOfPickup
        - Document
        - PackageCondition
        - LocationIssue
        - CustomerIssue
        - Other
      description: Attachment categories optimized for operational metrics and
        liability allocation.
    OrdersOrderStatus:
      type: string
      enum:
        - Pending
        - Routed
        - Assigned
        - PickupRoute
        - PickupArrived
        - DeliveryRoute
        - DeliveryArrived
        - Completed
        - Canceled
        - Failed
      description: Immutable high-level order lifecycle states.
    RidersRiderStatus:
      type: string
      enum:
        - Offline
        - Online
        - Busy
      description: Real-time operational rider statuses.
    RidersVehicleType:
      type: string
      enum:
        - Bicycle
        - Motorcycle
        - Car
        - Van
        - Other
      description: Supported rider vehicle types.
    TenantsTenantStatus:
      type: string
      enum:
        - Active
        - Suspended
      description: Status of a tenant account.
    WebhooksEndpointStatus:
      type: string
      enum:
        - Active
        - Disabled
      description: Lifecycle status for a tenant-owned webhook endpoint.
    WebhooksEventType:
      type: string
      enum:
        - OrderCreated
        - OrderCreatedByMerchant
        - OrderRouted
        - OrderRoutedByFleet
      description: Webhook event types that trigger endpoint deliveries.
  requestBodies:
    AuthnRpcChangePasswordInput:
      description: Request body for AuthnRpc/changePassword procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              currentPassword:
                type: string
                description: Current plain password for verification before change.
              newPassword:
                type: string
                description: New plain password to be stored after hashing.
            required:
              - currentPassword
              - newPassword
    AuthnRpcConfirmEmailChangeInput:
      description: Request body for AuthnRpc/confirmEmailChange procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              currentEmailToken:
                type: string
                description: Verification token sent to the current email address.
              newEmailToken:
                type: string
                description: Verification token sent to the new email address.
            required:
              - currentEmailToken
              - newEmailToken
    AuthnRpcCreateApiKeyInput:
      description: Request body for AuthnRpc/createApiKey procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              userId:
                type: string
                description: Optional machine user ID (ULID); defaults to the authenticated user
                  ID, but may target any machine user owned by the authenticated
                  user.
              name:
                type: string
                description: Human-readable API key name used to identify the key in dashboards
                  and logs.
              expiresAt:
                type: string
                format: date-time
                description: Optional UTC timestamp after which the API key is no longer valid.
            required:
              - name
    AuthnRpcCreateMachineUserInput:
      description: Request body for AuthnRpc/createMachineUser procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    AuthnRpcDeleteMachineUserInput:
      description: Request body for AuthnRpc/deleteMachineUser procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              userId:
                type: string
                description: Machine user identifier to delete.
            required:
              - userId
    AuthnRpcGetCurrentUserInput:
      description: Request body for AuthnRpc/getCurrentUser procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    AuthnRpcListApiKeysInput:
      description: Request body for AuthnRpc/listApiKeys procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              userId:
                type: string
                description: Optional machine user ID (ULID); defaults to the authenticated user
                  ID, but may target any machine user owned by the authenticated
                  user.
            required:
              - pagination
    AuthnRpcListMachineUsersInput:
      description: Request body for AuthnRpc/listMachineUsers procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
            required:
              - pagination
    AuthnRpcListSessionsInput:
      description: Request body for AuthnRpc/listSessions procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
            required:
              - pagination
    AuthnRpcLoginInput:
      description: Request body for AuthnRpc/login procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                description: Email used to authenticate the user.
              password:
                type: string
                description: Plain password used to authenticate the user.
            required:
              - email
              - password
    AuthnRpcLogoutInput:
      description: Request body for AuthnRpc/logout procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    AuthnRpcRegisterInput:
      description: Request body for AuthnRpc/register procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                description: User email address (must be unique).
              password:
                type: string
                description: Plain password for the new user.
            required:
              - email
              - password
    AuthnRpcRequestEmailChangeInput:
      description: Request body for AuthnRpc/requestEmailChange procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              newEmail:
                type: string
                description: New target email address to be confirmed.
              currentPassword:
                type: string
                description: Current plain password for verification before starting the flow.
            required:
              - newEmail
              - currentPassword
    AuthnRpcRequestPasswordResetInput:
      description: Request body for AuthnRpc/requestPasswordReset procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                description: Email address for which to start password reset.
            required:
              - email
    AuthnRpcResendEmailVerificationInput:
      description: Request body for AuthnRpc/resendEmailVerification procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    AuthnRpcResetPasswordInput:
      description: Request body for AuthnRpc/resetPassword procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                description: Email address for which the reset code was requested.
              token:
                type: string
                description: Password-reset token value.
              newPassword:
                type: string
                description: New plain password to be stored after hashing.
            required:
              - email
              - token
              - newPassword
    AuthnRpcRevokeApiKeyInput:
      description: Request body for AuthnRpc/revokeApiKey procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              userId:
                type: string
                description: Optional machine user ID (ULID); defaults to the authenticated user
                  ID, but may target any machine user owned by the authenticated
                  user.
              apiKeyId:
                type: string
                description: API key identifier to revoke.
            required:
              - apiKeyId
    AuthnRpcRevokeOtherSessionsInput:
      description: Request body for AuthnRpc/revokeOtherSessions procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    AuthnRpcRevokeSessionInput:
      description: Request body for AuthnRpc/revokeSession procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              sessionId:
                type: string
                description: Session identifier to revoke.
            required:
              - sessionId
    AuthnRpcVerifyEmailInput:
      description: Request body for AuthnRpc/verifyEmail procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              token:
                type: string
                description: Email verification token value.
            required:
              - token
    AuthzRpcAssignMembershipInput:
      description: Request body for AuthzRpc/assignMembership procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              userId:
                type: string
                description: User identity that will receive the membership.
              contextType:
                allOf:
                  - $ref: "#/components/schemas/AuthzContextType"
                  - description: Authorization context type.
              contextId:
                type: string
                description: Target context identifier (ULID) for tenant, merchant, or fleet
                  contexts. Omit for `SYSTEM`.
              role:
                allOf:
                  - $ref: "#/components/schemas/AuthzRole"
                  - description: Role granted within the target context.
            required:
              - userId
              - contextType
              - role
    AuthzRpcDeleteMembershipInput:
      description: Request body for AuthzRpc/deleteMembership procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              membershipId:
                type: string
                description: Membership identifier to delete.
            required:
              - membershipId
    AuthzRpcListCurrentContextsInput:
      description: Request body for AuthzRpc/listCurrentContexts procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    AuthzRpcListMembershipsInput:
      description: Request body for AuthzRpc/listMemberships procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              userId:
                type: string
                description: Optional user identity filter.
              contextType:
                allOf:
                  - $ref: "#/components/schemas/AuthzContextType"
                  - description: Optional authorization context type filter. Must be paired with
                      `contextId` when used.
              contextId:
                type: string
                description: Optional target context identifier (ULID). Must be paired with
                  `contextType` when used.
            required:
              - pagination
    BillingRpcAdjustBalanceInput:
      description: Request body for BillingRpc/adjustBalance procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
              amountCredits:
                type: integer
              note:
                type: string
            required:
              - tenantId
              - amountCredits
    BillingRpcConfigureBillingAccountInput:
      description: Request body for BillingRpc/configureBillingAccount procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
              maxNegativeBalance:
                type: integer
              orderCostCredits:
                type: integer
            required:
              - tenantId
              - maxNegativeBalance
              - orderCostCredits
    BillingRpcGetBillingAccountInput:
      description: Request body for BillingRpc/getBillingAccount procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
            required:
              - tenantId
    BillingRpcListTransactionsInput:
      description: Request body for BillingRpc/listTransactions procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
              pagination:
                $ref: "#/components/schemas/PaginationCursorRequest"
            required:
              - tenantId
              - pagination
    FilesRpcGenerateUploadUrlInput:
      description: Request body for FilesRpc/generateUploadUrl procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              fileName:
                type: string
              mimeType:
                type: string
              sizeBytes:
                type: integer
            required:
              - fileName
              - mimeType
              - sizeBytes
    FleetsRpcCreateFleetInput:
      description: Request body for FleetsRpc/createFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
                description: Parent tenant identifier.
              name:
                type: string
                description: Human-readable fleet name.
            required:
              - tenantId
              - name
    FleetsRpcGetFleetInput:
      description: Request body for FleetsRpc/getFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Fleet identifier.
            required:
              - id
    FleetsRpcListFleetsInput:
      description: Request body for FleetsRpc/listFleets procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              tenantId:
                type: string
                description: Optional parent tenant filter.
              status:
                allOf:
                  - $ref: "#/components/schemas/FleetsFleetStatus"
                  - description: Optional fleet status filter.
            required:
              - pagination
    FleetsRpcUpdateFleetInput:
      description: Request body for FleetsRpc/updateFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Fleet identifier.
              name:
                type: string
                description: Updated fleet name.
              status:
                allOf:
                  - $ref: "#/components/schemas/FleetsFleetStatus"
                  - description: Updated fleet status.
            required:
              - id
    MerchantsRpcCreateMerchantInput:
      description: Request body for MerchantsRpc/createMerchant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
                description: Parent tenant identifier.
              name:
                type: string
                description: Human-readable merchant name.
              latitude:
                type: integer
                description: Latitude in signed microdegrees.
              longitude:
                type: integer
                description: Longitude in signed microdegrees.
              maxRadiusKm:
                type: integer
                description: Maximum service radius in kilometers.
            required:
              - tenantId
              - name
              - latitude
              - longitude
              - maxRadiusKm
    MerchantsRpcGetMerchantInput:
      description: Request body for MerchantsRpc/getMerchant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Merchant identifier.
            required:
              - id
    MerchantsRpcListMerchantsInput:
      description: Request body for MerchantsRpc/listMerchants procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              tenantId:
                type: string
                description: Optional parent tenant filter.
              status:
                allOf:
                  - $ref: "#/components/schemas/MerchantsMerchantStatus"
                  - description: Optional merchant status filter.
            required:
              - pagination
    MerchantsRpcUpdateMerchantInput:
      description: Request body for MerchantsRpc/updateMerchant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Merchant identifier.
              name:
                type: string
                description: Updated merchant name.
              status:
                allOf:
                  - $ref: "#/components/schemas/MerchantsMerchantStatus"
                  - description: Updated merchant status.
              latitude:
                type: integer
                description: Updated latitude in signed microdegrees.
              longitude:
                type: integer
                description: Updated longitude in signed microdegrees.
              maxRadiusKm:
                type: integer
                description: Updated maximum service radius in kilometers.
            required:
              - id
    NotesRpcCreateNoteInput:
      description: Request body for NotesRpc/createNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              entityType:
                $ref: "#/components/schemas/NotesEntityType"
              entityId:
                type: string
              contextType:
                $ref: "#/components/schemas/AuthzContextType"
              contextId:
                type: string
              content:
                type: string
            required:
              - entityType
              - entityId
              - contextType
              - content
    NotesRpcDeleteNoteInput:
      description: Request body for NotesRpc/deleteNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
            required:
              - id
    NotesRpcGetNoteInput:
      description: Request body for NotesRpc/getNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
            required:
              - id
    NotesRpcListNotesInput:
      description: Request body for NotesRpc/listNotes procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                $ref: "#/components/schemas/PaginationCursorRequest"
              entityType:
                $ref: "#/components/schemas/NotesEntityType"
              entityId:
                type: string
            required:
              - pagination
              - entityType
              - entityId
    NotesRpcUpdateNoteInput:
      description: Request body for NotesRpc/updateNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              content:
                type: string
            required:
              - id
              - content
    OrdersRpcAddAttachmentInput:
      description: Request body for OrdersRpc/addAttachment procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              orderId:
                type: string
                description: The order identifier (ULID).
              uploadId:
                type: string
                description: The upload identifier (UUIDv4) returned by files.generateUploadUrl.
              originalName:
                type: string
                description: Original client-side filename from the upload.
              mimeType:
                type: string
                description: Declared MIME type from the upload.
              sizeBytes:
                type: integer
                description: Declared file size in bytes from the upload.
              tag:
                allOf:
                  - $ref: "#/components/schemas/OrdersAttachmentTag"
                  - description: Category tag for operational grouping.
              note:
                type: string
                description: Optional free-text context from the rider.
            required:
              - orderId
              - uploadId
              - originalName
              - mimeType
              - sizeBytes
              - tag
    OrdersRpcAssignOrderToRiderInput:
      description: Request body for OrdersRpc/assignOrderToRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              riderId:
                type: string
              mode:
                $ref: "#/components/schemas/OrdersAssignmentMode"
            required:
              - id
              - riderId
              - mode
    OrdersRpcCreateOrderInput:
      description: Request body for OrdersRpc/createOrder procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              merchantId:
                type: string
              pickupPayAmount:
                type: integer
              pickupCollectAmount:
                type: integer
              deliveryPayAmount:
                type: integer
              deliveryCollectAmount:
                type: integer
              customerName:
                type: string
              customerAddress:
                type: string
              customerLatitude:
                type: integer
              customerLongitude:
                type: integer
              customerPhoneCountryCode:
                type: string
              customerPhoneNumber:
                type: string
              contents:
                type: string
            required:
              - merchantId
              - pickupPayAmount
              - pickupCollectAmount
              - deliveryPayAmount
              - deliveryCollectAmount
              - customerName
              - customerAddress
              - customerLatitude
              - customerLongitude
              - customerPhoneCountryCode
              - customerPhoneNumber
              - contents
    OrdersRpcGetOrderInput:
      description: Request body for OrdersRpc/getOrder procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
            required:
              - id
    OrdersRpcListAttachmentsInput:
      description: Request body for OrdersRpc/listAttachments procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              orderId:
                type: string
                description: The order identifier (ULID).
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
            required:
              - orderId
              - pagination
    OrdersRpcListOrdersInput:
      description: Request body for OrdersRpc/listOrders procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                $ref: "#/components/schemas/PaginationCursorRequest"
              tenantId:
                type: string
              merchantId:
                type: string
              fleetId:
                type: string
              riderId:
                type: string
              status:
                $ref: "#/components/schemas/OrdersOrderStatus"
            required:
              - pagination
    OrdersRpcRouteOrderToFleetInput:
      description: Request body for OrdersRpc/routeOrderToFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              fleetId:
                type: string
            required:
              - id
              - fleetId
    OrdersRpcUpdateOrderStatusInput:
      description: Request body for OrdersRpc/updateOrderStatus procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              status:
                $ref: "#/components/schemas/OrdersOrderStatus"
            required:
              - id
              - status
    RidersRpcCreateRiderInput:
      description: Request body for RidersRpc/createRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              userId:
                type: string
                description: Rider identifier, equal to the target user identity ULID.
              fleetId:
                type: string
                description: Target fleet identifier.
              vehicleType:
                allOf:
                  - $ref: "#/components/schemas/RidersVehicleType"
                  - description: Rider vehicle type.
              licensePlate:
                type: string
                description: Optional license plate. Empty string clears the value.
            required:
              - userId
              - fleetId
              - vehicleType
    RidersRpcGetRiderInput:
      description: Request body for RidersRpc/getRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Rider identifier.
            required:
              - id
    RidersRpcListRidersInput:
      description: Request body for RidersRpc/listRiders procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              tenantId:
                type: string
                description: Optional tenant filter.
              fleetId:
                type: string
                description: Optional fleet filter.
              status:
                allOf:
                  - $ref: "#/components/schemas/RidersRiderStatus"
                  - description: Optional rider status filter.
            required:
              - pagination
    RidersRpcUpdateRiderInput:
      description: Request body for RidersRpc/updateRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Rider identifier.
              fleetId:
                type: string
                description: Updated fleet identifier.
              vehicleType:
                allOf:
                  - $ref: "#/components/schemas/RidersVehicleType"
                  - description: Updated vehicle type.
              licensePlate:
                type: string
                description: Updated license plate. Empty string clears the value.
            required:
              - id
    RidersRpcUpdateRiderLocationInput:
      description: Request body for RidersRpc/updateRiderLocation procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Rider identifier.
              latitude:
                type: integer
                description: Updated latitude in signed microdegrees. Empty clears the value
                  together with longitude when both are omitted or empty.
              longitude:
                type: integer
                description: Updated longitude in signed microdegrees.
            required:
              - id
    RidersRpcUpdateRiderStatusInput:
      description: Request body for RidersRpc/updateRiderStatus procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Rider identifier.
              status:
                allOf:
                  - $ref: "#/components/schemas/RidersRiderStatus"
                  - description: Updated rider status.
            required:
              - id
              - status
    TenantsRpcCreateTenantInput:
      description: Request body for TenantsRpc/createTenant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                description: Name of the new tenant.
              isDemo:
                type: boolean
                description: Indicates if this is a demo tenant.
            required:
              - name
              - isDemo
    TenantsRpcGetTenantInput:
      description: Request body for TenantsRpc/getTenant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the tenant.
            required:
              - id
    TenantsRpcListTenantsInput:
      description: Request body for TenantsRpc/listTenants procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              status:
                allOf:
                  - $ref: "#/components/schemas/TenantsTenantStatus"
                  - description: Status filter.
              isDemo:
                type: boolean
                description: Demo flag filter.
            required:
              - pagination
    TenantsRpcUpdateTenantInput:
      description: Request body for TenantsRpc/updateTenant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the tenant.
              name:
                type: string
                description: Name of the tenant.
            required:
              - id
    TenantsRpcUpdateTenantStatusInput:
      description: Request body for TenantsRpc/updateTenantStatus procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the tenant.
              status:
                allOf:
                  - $ref: "#/components/schemas/TenantsTenantStatus"
                  - description: The new status for the tenant.
            required:
              - id
              - status
    UsersRpcGetCurrentProfileInput:
      description: Request body for UsersRpc/getCurrentProfile procedure
      content:
        application/json:
          schema:
            type: object
            properties: {}
    UsersRpcUpdateCurrentProfileInput:
      description: Request body for UsersRpc/updateCurrentProfile procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              firstName:
                type: string
                description: Given or first name for the identity.
              lastName:
                type: string
                description: Family or last name for the identity.
              contactPhoneCountryCode:
                type: string
                description: Contact phone country code for the user without + sign (for
                  example, 1, 54, etc).
              contactPhoneNumber:
                type: string
                description: Contact phone local number for the user, without country code.
    WebhooksRpcCreateEndpointInput:
      description: Request body for WebhooksRpc/createEndpoint procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
                description: Tenant owner for the endpoint.
              url:
                type: string
                description: Absolute destination URL for HTTP POST deliveries.
              eventType:
                allOf:
                  - $ref: "#/components/schemas/WebhooksEventType"
                  - description: Event type that triggers this endpoint.
              entityId:
                type: string
                description: Optional entity identifier for merchant-specific or fleet-specific
                  webhooks.
            required:
              - tenantId
              - url
              - eventType
    WebhooksRpcListDeliveriesInput:
      description: Request body for WebhooksRpc/listDeliveries procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              tenantId:
                type: string
                description: Tenant owner filter.
              endpointId:
                type: string
                description: Optional endpoint identifier filter.
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
            required:
              - tenantId
              - pagination
    WebhooksRpcListEndpointsInput:
      description: Request body for WebhooksRpc/listEndpoints procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              pagination:
                allOf:
                  - $ref: "#/components/schemas/PaginationCursorRequest"
                  - description: Cursor-based pagination parameters.
              tenantId:
                type: string
                description: Tenant owner of the endpoints to list.
              eventType:
                allOf:
                  - $ref: "#/components/schemas/WebhooksEventType"
                  - description: Optional event type filter.
            required:
              - pagination
              - tenantId
    WebhooksRpcUpdateEndpointInput:
      description: Request body for WebhooksRpc/updateEndpoint procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                description: Unique endpoint identifier.
              url:
                type: string
                description: Replacement destination URL.
              eventType:
                allOf:
                  - $ref: "#/components/schemas/WebhooksEventType"
                  - description: Replacement event type.
              entityId:
                type: string
                description: Replacement entity identifier.
              status:
                allOf:
                  - $ref: "#/components/schemas/WebhooksEndpointStatus"
                  - description: Replacement endpoint status.
            required:
              - id
  responses:
    AuthnRpcChangePasswordOutput:
      description: Response for AuthnRpc/changePassword procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcConfirmEmailChangeOutput:
      description: Response for AuthnRpc/confirmEmailChange procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Updated user projection after both verifications succeed and the
                          email is changed.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcCreateApiKeyOutput:
      description: Response for AuthnRpc/createApiKey procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  plainApiKey:
                    type: string
                    description: Plain API key in `ak_{id}_{randomness}` format, returned only once
                      at creation time.
                  apiKey:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoApiKey"
                      - description: Created API key projection for external consumers.
                required:
                  - plainApiKey
                  - apiKey
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcCreateMachineUserOutput:
      description: Response for AuthnRpc/createMachineUser procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Newly created machine-user projection for external consumers.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcDeleteMachineUserOutput:
      description: Response for AuthnRpc/deleteMachineUser procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcGetCurrentUserOutput:
      description: Response for AuthnRpc/getCurrentUser procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Current authenticated user projection for external consumers.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcListApiKeysOutput:
      description: Response for AuthnRpc/listApiKeys procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/AuthnDtoApiKey"
                    description: API keys owned by the effective user (authenticated user by
                      default).
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcListMachineUsersOutput:
      description: Response for AuthnRpc/listMachineUsers procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/AuthnDtoUser"
                    description: Machine users owned by the current authenticated human user.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcListSessionsOutput:
      description: Response for AuthnRpc/listSessions procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/AuthnDtoSession"
                    description: Active sessions owned by the current authenticated user.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcLoginOutput:
      description: Response for AuthnRpc/login procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Authenticated user projection for external consumers.
                  sessionToken:
                    type: string
                    description: Plain session token in `st_{id}_{randomness}` format, returned only
                      at creation time.
                  session:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoSession"
                      - description: Session projection for external consumers.
                required:
                  - user
                  - sessionToken
                  - session
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcLogoutOutput:
      description: Response for AuthnRpc/logout procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcRegisterOutput:
      description: Response for AuthnRpc/register procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Newly created user projection for external consumers.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcRequestEmailChangeOutput:
      description: Response for AuthnRpc/requestEmailChange procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcRequestPasswordResetOutput:
      description: Response for AuthnRpc/requestPasswordReset procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcResendEmailVerificationOutput:
      description: Response for AuthnRpc/resendEmailVerification procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcResetPasswordOutput:
      description: Response for AuthnRpc/resetPassword procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Updated user projection after successful password reset.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcRevokeApiKeyOutput:
      description: Response for AuthnRpc/revokeApiKey procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcRevokeOtherSessionsOutput:
      description: Response for AuthnRpc/revokeOtherSessions procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  revokedCount:
                    type: integer
                    description: Number of revoked sessions excluding the current session.
                required:
                  - revokedCount
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcRevokeSessionOutput:
      description: Response for AuthnRpc/revokeSession procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthnRpcVerifyEmailOutput:
      description: Response for AuthnRpc/verifyEmail procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/AuthnDtoUser"
                      - description: Updated user projection after successful email verification.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthzRpcAssignMembershipOutput:
      description: Response for AuthzRpc/assignMembership procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  membership:
                    allOf:
                      - $ref: "#/components/schemas/AuthzDtoMembership"
                      - description: Newly created membership projection for external consumers.
                required:
                  - membership
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthzRpcDeleteMembershipOutput:
      description: Response for AuthzRpc/deleteMembership procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthzRpcListCurrentContextsOutput:
      description: Response for AuthzRpc/listCurrentContexts procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  contexts:
                    type: array
                    items:
                      $ref: "#/components/schemas/AuthzDtoContextAccess"
                    description: Contexts available to the current authenticated identity.
                required:
                  - contexts
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    AuthzRpcListMembershipsOutput:
      description: Response for AuthzRpc/listMemberships procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/AuthzDtoMembership"
                    description: Active memberships matching the requested filter.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    BillingRpcAdjustBalanceOutput:
      description: Response for BillingRpc/adjustBalance procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  account:
                    $ref: "#/components/schemas/BillingDtoAccount"
                  transaction:
                    $ref: "#/components/schemas/BillingDtoTransaction"
                required:
                  - account
                  - transaction
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    BillingRpcConfigureBillingAccountOutput:
      description: Response for BillingRpc/configureBillingAccount procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  account:
                    $ref: "#/components/schemas/BillingDtoAccount"
                required:
                  - account
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    BillingRpcGetBillingAccountOutput:
      description: Response for BillingRpc/getBillingAccount procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  account:
                    $ref: "#/components/schemas/BillingDtoAccount"
                required:
                  - account
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    BillingRpcListTransactionsOutput:
      description: Response for BillingRpc/listTransactions procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/BillingDtoTransaction"
                  pagination:
                    $ref: "#/components/schemas/PaginationCursorResponse"
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    FilesRpcGenerateUploadUrlOutput:
      description: Response for FilesRpc/generateUploadUrl procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  ticket:
                    $ref: "#/components/schemas/FilesDtoUploadTicket"
                required:
                  - ticket
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    FleetsRpcCreateFleetOutput:
      description: Response for FleetsRpc/createFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  fleet:
                    allOf:
                      - $ref: "#/components/schemas/FleetsDtoFleet"
                      - description: Newly created fleet.
                required:
                  - fleet
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    FleetsRpcGetFleetOutput:
      description: Response for FleetsRpc/getFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  fleet:
                    allOf:
                      - $ref: "#/components/schemas/FleetsDtoFleet"
                      - description: Requested fleet.
                required:
                  - fleet
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    FleetsRpcListFleetsOutput:
      description: Response for FleetsRpc/listFleets procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/FleetsDtoFleet"
                    description: Visible fleets.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    FleetsRpcUpdateFleetOutput:
      description: Response for FleetsRpc/updateFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  fleet:
                    allOf:
                      - $ref: "#/components/schemas/FleetsDtoFleet"
                      - description: Updated fleet.
                required:
                  - fleet
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    MerchantsRpcCreateMerchantOutput:
      description: Response for MerchantsRpc/createMerchant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  merchant:
                    allOf:
                      - $ref: "#/components/schemas/MerchantsDtoMerchant"
                      - description: Newly created merchant.
                required:
                  - merchant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    MerchantsRpcGetMerchantOutput:
      description: Response for MerchantsRpc/getMerchant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  merchant:
                    allOf:
                      - $ref: "#/components/schemas/MerchantsDtoMerchant"
                      - description: Requested merchant.
                required:
                  - merchant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    MerchantsRpcListMerchantsOutput:
      description: Response for MerchantsRpc/listMerchants procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/MerchantsDtoMerchant"
                    description: Visible merchants.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    MerchantsRpcUpdateMerchantOutput:
      description: Response for MerchantsRpc/updateMerchant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  merchant:
                    allOf:
                      - $ref: "#/components/schemas/MerchantsDtoMerchant"
                      - description: Updated merchant.
                required:
                  - merchant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    NotesRpcCreateNoteOutput:
      description: Response for NotesRpc/createNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  note:
                    $ref: "#/components/schemas/NotesDtoNote"
                required:
                  - note
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    NotesRpcDeleteNoteOutput:
      description: Response for NotesRpc/deleteNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties: {}
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    NotesRpcGetNoteOutput:
      description: Response for NotesRpc/getNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  note:
                    $ref: "#/components/schemas/NotesDtoNote"
                required:
                  - note
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    NotesRpcListNotesOutput:
      description: Response for NotesRpc/listNotes procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/NotesDtoNote"
                  pagination:
                    $ref: "#/components/schemas/PaginationCursorResponse"
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    NotesRpcUpdateNoteOutput:
      description: Response for NotesRpc/updateNote procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  note:
                    $ref: "#/components/schemas/NotesDtoNote"
                required:
                  - note
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcAddAttachmentOutput:
      description: Response for OrdersRpc/addAttachment procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  attachment:
                    allOf:
                      - $ref: "#/components/schemas/OrdersDtoAttachment"
                      - description: The newly created attachment.
                required:
                  - attachment
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcAssignOrderToRiderOutput:
      description: Response for OrdersRpc/assignOrderToRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  order:
                    $ref: "#/components/schemas/OrdersDtoOrder"
                required:
                  - order
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcCreateOrderOutput:
      description: Response for OrdersRpc/createOrder procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  order:
                    $ref: "#/components/schemas/OrdersDtoOrder"
                required:
                  - order
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcGetOrderOutput:
      description: Response for OrdersRpc/getOrder procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  order:
                    $ref: "#/components/schemas/OrdersDtoOrder"
                required:
                  - order
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcListAttachmentsOutput:
      description: Response for OrdersRpc/listAttachments procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/OrdersDtoAttachmentItem"
                    description: Attachment items with public file URLs.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcListOrdersOutput:
      description: Response for OrdersRpc/listOrders procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/OrdersDtoOrder"
                  pagination:
                    $ref: "#/components/schemas/PaginationCursorResponse"
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcRouteOrderToFleetOutput:
      description: Response for OrdersRpc/routeOrderToFleet procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  order:
                    $ref: "#/components/schemas/OrdersDtoOrder"
                required:
                  - order
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    OrdersRpcUpdateOrderStatusOutput:
      description: Response for OrdersRpc/updateOrderStatus procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  order:
                    $ref: "#/components/schemas/OrdersDtoOrder"
                required:
                  - order
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    RidersRpcCreateRiderOutput:
      description: Response for RidersRpc/createRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  rider:
                    allOf:
                      - $ref: "#/components/schemas/RidersDtoRider"
                      - description: Newly created rider.
                required:
                  - rider
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    RidersRpcGetRiderOutput:
      description: Response for RidersRpc/getRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  rider:
                    allOf:
                      - $ref: "#/components/schemas/RidersDtoRider"
                      - description: Requested rider.
                required:
                  - rider
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    RidersRpcListRidersOutput:
      description: Response for RidersRpc/listRiders procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/RidersDtoRider"
                    description: Visible riders.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    RidersRpcUpdateRiderLocationOutput:
      description: Response for RidersRpc/updateRiderLocation procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  rider:
                    allOf:
                      - $ref: "#/components/schemas/RidersDtoRider"
                      - description: Updated rider.
                required:
                  - rider
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    RidersRpcUpdateRiderOutput:
      description: Response for RidersRpc/updateRider procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  rider:
                    allOf:
                      - $ref: "#/components/schemas/RidersDtoRider"
                      - description: Updated rider.
                required:
                  - rider
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    RidersRpcUpdateRiderStatusOutput:
      description: Response for RidersRpc/updateRiderStatus procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  rider:
                    allOf:
                      - $ref: "#/components/schemas/RidersDtoRider"
                      - description: Updated rider.
                required:
                  - rider
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    TenantsRpcCreateTenantOutput:
      description: Response for TenantsRpc/createTenant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  tenant:
                    allOf:
                      - $ref: "#/components/schemas/TenantsDtoTenant"
                      - description: The newly created tenant.
                required:
                  - tenant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    TenantsRpcGetTenantOutput:
      description: Response for TenantsRpc/getTenant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  tenant:
                    allOf:
                      - $ref: "#/components/schemas/TenantsDtoTenant"
                      - description: The requested tenant.
                required:
                  - tenant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    TenantsRpcListTenantsOutput:
      description: Response for TenantsRpc/listTenants procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/TenantsDtoTenant"
                    description: The list of tenants.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    TenantsRpcUpdateTenantOutput:
      description: Response for TenantsRpc/updateTenant procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  tenant:
                    allOf:
                      - $ref: "#/components/schemas/TenantsDtoTenant"
                      - description: The updated tenant.
                required:
                  - tenant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    TenantsRpcUpdateTenantStatusOutput:
      description: Response for TenantsRpc/updateTenantStatus procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  tenant:
                    allOf:
                      - $ref: "#/components/schemas/TenantsDtoTenant"
                      - description: The updated tenant.
                required:
                  - tenant
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    UsersRpcGetCurrentProfileOutput:
      description: Response for UsersRpc/getCurrentProfile procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/UsersDtoUser"
                      - description: Current authenticated profile for external consumers.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    UsersRpcUpdateCurrentProfileOutput:
      description: Response for UsersRpc/updateCurrentProfile procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  user:
                    allOf:
                      - $ref: "#/components/schemas/UsersDtoUser"
                      - description: Updated profile for external consumers.
                required:
                  - user
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    WebhooksRpcCreateEndpointOutput:
      description: Response for WebhooksRpc/createEndpoint procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  endpoint:
                    allOf:
                      - $ref: "#/components/schemas/WebhooksDtoEndpoint"
                      - description: The newly created endpoint.
                required:
                  - endpoint
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    WebhooksRpcListDeliveriesOutput:
      description: Response for WebhooksRpc/listDeliveries procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/WebhooksDtoDelivery"
                    description: Persisted delivery attempts.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    WebhooksRpcListEndpointsOutput:
      description: Response for WebhooksRpc/listEndpoints procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/WebhooksDtoEndpoint"
                    description: Tenant webhook endpoints.
                  pagination:
                    allOf:
                      - $ref: "#/components/schemas/PaginationCursorResponse"
                      - description: Cursor-based pagination metadata.
                required:
                  - items
                  - pagination
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
    WebhooksRpcUpdateEndpointOutput:
      description: Response for WebhooksRpc/updateEndpoint procedure
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
              output:
                type: object
                properties:
                  endpoint:
                    allOf:
                      - $ref: "#/components/schemas/WebhooksDtoEndpoint"
                      - description: The updated endpoint.
                required:
                  - endpoint
              error:
                type: object
                properties:
                  message:
                    type: string
                  category:
                    type: string
                  code:
                    type: string
                  details:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - message
            required:
              - ok
