/** * Catalog booking-engine routes (quote / drafts / holds). The factory is * mounted on BOTH adminRoutes AND publicRoutes, so each leg appears under * `/v1/admin/catalog/*` and `/v1/public/catalog/*`. * * Migrated to `@hono/zod-openapi` for the OpenAPI admin backfill (voyant#2114 / * voyant#2208). Request schemas reuse `routes-contracts`; quote/book responses * reuse the `@voyant-travel/catalog-contracts` V1 wire schemas the handlers * already serialize through; the draft row schema is authored from * `SelectBookingDraft` (§17: timestamp columns serialize to ISO strings). * * agent-quality: file-size exception — intentional: the seven `createRoute` * objects (each with its real status set) co-locate with the handler helpers * per the established admin route pattern (mirrors `commerce/pricing/ * routes-core.ts`). Splitting the route table from its handlers would fragment * one mounted instance without aiding review. See voyant#2114 / voyant#2208. */ import { OpenAPIHono } from "@hono/zod-openapi"; import type { AnyDrizzleDb } from "@voyant-travel/db"; import type { ApiModule } from "@voyant-travel/hono/module"; import { type QuoteResponseV1 } from "./contracts.js"; import { type QuoteEntityResult } from "./quote.js"; import { type CatalogBookingRoutesOptions } from "./routes-contracts.js"; /** * Deployment `Variables` the engine reads off the request context — `db` and * `userId` are resolved by the parent app's middleware chain and read back * through the injected `resolveDb`/`resolveActorId` resolvers. Kept permissive * because the resolvers own the actual lookup. */ type Env = { Variables: { db?: AnyDrizzleDb; userId?: string; }; }; export type { CatalogBookingAdapterContextInput, CatalogBookingBatchQuoteBody, CatalogBookingBatchQuoteSelection, CatalogBookingBatchQuoteTransformInput, CatalogBookingDraftBody, CatalogBookingHoldPlaceBody, CatalogBookingHoldReleaseBody, CatalogBookingHoldTtlInput, CatalogBookingProvenance, CatalogBookingProvenanceInput, CatalogBookingQuoteBody, CatalogBookingQuoteTransformInput, CatalogBookingRoutesOptions, } from "./routes-contracts.js"; export declare function createCatalogBookingRoutes(options: CatalogBookingRoutesOptions): OpenAPIHono; export declare function createCatalogBookingApiModule(options: CatalogBookingRoutesOptions): ApiModule; export declare function engineParametersFromDraft(parameters: Record | undefined, draftPayload: unknown, context?: { entityModule?: string; sourceKind?: string; sourceProvider?: string; }): Record; export declare function serializeQuoteResult(result: QuoteEntityResult): QuoteResponseV1;