/** * `cancelEntity` — third step in the booking engine lifecycle. * * Looks up the snapshot row, dispatches `adapter.cancel`, returns the * adapter's refund result. The snapshot stays — it's the audit record — * and the booking row's lifecycle (set status to cancelled, etc.) is the * caller's responsibility, kept outside the engine to preserve the * decoupling from `packages/bookings`. */ import type { AnyDrizzleDb } from "@voyantjs/db"; import type { CancelResult, SourceAdapterContext, SourceAdapterRequestScope } from "../adapter/contract.js"; import type { SourceAdapterRegistry } from "./registry.js"; export interface CancelEntityRequest { bookingId: string; entityModule: string; entityId: string; reason?: string; scope?: SourceAdapterRequestScope; idempotencyKey?: string; adapterContext: SourceAdapterContext; } export interface CancelEntityResult { status: CancelResult["status"]; refundAmount?: number; refundCurrency?: string; pendingChannel?: string; /** The snapshot row's id — exposed for callers that want to log the cancel against it. */ snapshotId: string; } export interface CancelEntityDeps { registry: SourceAdapterRegistry; } /** * Cancel the given (booking, entity) pair. Throws `ORDER_NOT_FOUND` when * no snapshot row matches. Otherwise dispatches to the registered * adapter; if the adapter doesn't implement `cancel`, returns the * adapter's refusal verbatim so the caller can surface it. */ export declare function cancelEntity(db: AnyDrizzleDb, deps: CancelEntityDeps, request: CancelEntityRequest): Promise; //# sourceMappingURL=cancel.d.ts.map