/** * Availability "allocation" admin routes — the per-slot resource/traveler * allocation surface (manifests, resource CRUD, traveler↔resource assignment, * sharing-group pairing/labels, audit log, CSV exports) plus the product-option * resource-template configuration and the materialisation / auto-allocation * automations. Mounted for the published OpenAPI admin contract under * `/v1/admin/operations/availability/*` (see `availability/routes.ts`). * * Migrated to `@hono/zod-openapi` for the OpenAPI admin backfill (voyant#2114 / * voyant#2208 — operations sub-batch 10B). Request schemas reuse the exported * `validation.ts` schemas the handlers already parse; response schemas are * authored here from the service return shapes (manifests, mutation results, * audit entries, resource-template trees) — §17: timestamps serialize to ISO * strings on the wire; the resource `flags` jsonb is an open record; the CSV * export legs return `text/csv` (no JSON body). * * Each resource family is its own small `OpenAPIHono` sub-chain composed onto * `availabilityAllocationRoutes` via `.route("/")` so the `.openapi()` * operations propagate up through the parent availability registries while * keeping type-inference cost bounded (one flat chain has O(n²) inference cost). * * agent-quality: file-size exception — intentional: a mechanically-repetitive * allocation bundle (22 legs) over the slot-allocation, resource-template, and * automation families, each with a `createRoute` def + co-located handler per * the established admin route pattern (mirrors `routes-core.ts`). Splitting per * family would fragment the single mounted instance without aiding review. See * voyant#2114 / voyant#2208 (operations sub-batch 10B). */ import { OpenAPIHono } from "@hono/zod-openapi"; import type { Env } from "./routes-shared.js"; /** * Compose the per-family sub-chains onto a single `OpenAPIHono` so the * `.openapi()` operations propagate up through the parent availability * registries (`OpenAPIHono.route` copies the sub-app's registered routes). */ export declare const availabilityAllocationRoutes: OpenAPIHono | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { json: { capacity: number; namePattern?: string | undefined; refType?: string | null | undefined; refId?: string | null | undefined; layout?: string | null | undefined; defaultCount?: number | null | undefined; flags?: Record | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { json: { capacity: number; namePattern?: string | undefined; refType?: string | null | undefined; refId?: string | null | undefined; layout?: string | null | undefined; defaultCount?: number | null | undefined; flags?: Record | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { json: { capacity: number; namePattern?: string | undefined; refType?: string | null | undefined; refId?: string | null | undefined; layout?: string | null | undefined; defaultCount?: number | null | undefined; flags?: Record | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { json: { capacity: number; namePattern?: string | undefined; refType?: string | null | undefined; refId?: string | null | undefined; layout?: string | null | undefined; defaultCount?: number | null | undefined; flags?: Record | undefined; }; }; output: { data: { id: string; productOptionId: string; kind: string; refType: string | null; refId: string | null; capacity: number; namePattern: string; layout: string | null; defaultCount: number | null; flags: { [x: string]: import("hono/utils/types").JSONValue; }; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/products/:productId/options/:optionId/allocation/resource-templates/:kind": { $delete: { input: { param: { productId: string; optionId: string; kind: string; }; } & { query: { refId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { query: { refId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { query: { refId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { query: { refId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { productId: string; optionId: string; kind: string; }; } & { query: { refId?: string | undefined; }; }; output: { data: { productOptionId: string; kind: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/products/:id/allocation/materialize-open-slots": { $post: { input: { param: { id: string; }; } & { json: { optionId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { optionId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { optionId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; }; } & { json: { optionId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; }; } & { json: { optionId?: string | undefined; }; }; output: { data: { slots: number; created: number; }; }; outputFormat: "json"; status: 200; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/slots/:id/allocation/auto-materialize": { $post: { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { data: { kind: string; assigned?: number | undefined; skipped?: number | undefined; created?: number | undefined; resources?: { id: string; slotId: string; kind: string; refType: string | null; refId: string | null; label: string | null; capacity: number; flags: { [x: string]: import("hono/utils/types").JSONValue; }; parentId: string | null; sortOrder: number; createdAt: string; updatedAt: string; }[] | undefined; }; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/materialize-templates": { $post: { input: { param: { id: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; }; }; output: { data: { created: number; }; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/auto-allocate": { $post: { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; }; } & { json: { kind?: string | undefined; }; }; output: { data: { kind: string; assigned?: number | undefined; skipped?: number | undefined; created?: number | undefined; resources?: { id: string; slotId: string; kind: string; refType: string | null; refId: string | null; label: string | null; capacity: number; flags: { [x: string]: import("hono/utils/types").JSONValue; }; parentId: string | null; sortOrder: number; createdAt: string; updatedAt: string; }[] | undefined; }; }; outputFormat: "json"; status: 200; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/slots/:id/allocation/audit-log": { $get: { input: { param: { id: string; }; } & { query: { limit?: unknown; }; }; output: { data: { id: string; slotId: string; action: string; actorId: string | null; travelerId: string | null; resourceId: string | null; before: { [x: string]: import("hono/utils/types").JSONValue; } | null; after: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; }[]; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/export-passengers": { $get: { input: { param: { id: string; }; }; output: Response; outputFormat: "json"; status: import("hono/utils/http-status").StatusCode; } | { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; } & { "/slots/:id/allocation/export-rooming-list": { $get: { input: { param: { id: string; }; }; output: Response; outputFormat: "json"; status: import("hono/utils/http-status").StatusCode; } | { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/slots/:id/allocation/travelers/:travelerId": { $patch: { input: { param: { id: string; travelerId: string; }; } & { json: { kind: string; resourceId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; travelerId: string; }; } & { json: { kind: string; resourceId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; travelerId: string; }; } & { json: { kind: string; resourceId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; travelerId: string; }; } & { json: { kind: string; resourceId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; travelerId: string; }; } & { json: { kind: string; resourceId: string | null; }; }; output: { data: { travelerId: string; kind: string; resourceId: string | null; }; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/travelers/:travelerId/sharing-group": { $patch: { input: { param: { id: string; travelerId: string; }; } & { json: { sharingGroupId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; travelerId: string; }; } & { json: { sharingGroupId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; travelerId: string; }; } & { json: { sharingGroupId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; travelerId: string; }; } & { json: { sharingGroupId: string | null; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; travelerId: string; }; } & { json: { sharingGroupId: string | null; }; }; output: { data: { travelerId: string; sharingGroupId: string | null; }; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/sharing-groups/pair": { $post: { input: { param: { id: string; }; } & { json: { travelerIds: string[]; sharingGroupId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { travelerIds: string[]; sharingGroupId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { travelerIds: string[]; sharingGroupId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; }; } & { json: { travelerIds: string[]; sharingGroupId?: string | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; }; } & { json: { travelerIds: string[]; sharingGroupId?: string | undefined; }; }; output: { data: { sharingGroupId: string; travelerIds: string[]; }; }; outputFormat: "json"; status: 201; }; }; } & { "/slots/:id/allocation/sharing-groups/:groupId/label": { $put: { input: { param: { id: string; groupId: string; }; } & { json: { label: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; groupId: string; }; } & { json: { label: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; groupId: string; }; } & { json: { label: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; groupId: string; }; } & { json: { label: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; groupId: string; }; } & { json: { label: string; }; }; output: { data: { groupId: string; label: string; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/sharing-groups/:groupId/label": { $delete: { input: { param: { id: string; groupId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; groupId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; groupId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; groupId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; groupId: string; }; }; output: { data: { groupId: string; label: string; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/slots/:id/allocation": { $get: { input: { param: { id: string; }; }; output: { data: { slot: { id: string; productId: string | null; startsAt: string | null; endsAt: string | null; }; bookings: { id: string; bookingNumber: string; status: string; bookingSequence: number; paymentStatus: string; contactFirstName: string | null; contactLastName: string | null; contactEmail: string | null; contactPhone: string | null; sellCurrency: string | null; pax: number | null; sellAmountCents: number | null; paidAmountCents: number | null; travelers: { id: string; bookingId: string; bookingNumber: string; bookingStatus: string; bookingSequence: number; paymentStatus: string; firstName: string; lastName: string; fullName: string; email: string | null; phone: string | null; isLeadTraveler: boolean; isPrimary: boolean; sharingGroupId: string | null; optionId: string | null; optionUnitId: string | null; optionUnitCode: string | null; roomTypeId: string | null; bedPreference: string | null; allocations: { [x: string]: string; }; travelerCategory: string | null; participantType: string; hasAccessibilityNeeds: boolean; hasDietaryRequirements: boolean; }[]; }[]; resources: { id: string; slotId: string; kind: string; refType: string | null; refId: string | null; label: string | null; capacity: number; flags: { [x: string]: import("hono/utils/types").JSONValue; }; parentId: string | null; sortOrder: number; createdAt: string; updatedAt: string; }[]; sharingGroupLabels: { [x: string]: string; }; summary: { bookingCount: number; travelerCount: number; leadTravelerCount: number; bookingsByStatus: { [x: string]: number; }; }; }; }; outputFormat: "json"; status: 200; } | { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; } & { "/slots/:id/allocation/resources": { $post: { input: { param: { id: string; }; } & { json: { kind: string; capacity: number; refType?: string | null | undefined; refId?: string | null | undefined; label?: string | null | undefined; flags?: Record | undefined; parentId?: string | null | undefined; sortOrder?: number | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { kind: string; capacity: number; refType?: string | null | undefined; refId?: string | null | undefined; label?: string | null | undefined; flags?: Record | undefined; parentId?: string | null | undefined; sortOrder?: number | undefined; }; }; output: { data: { id: string; slotId: string; kind: string; refType: string | null; refId: string | null; label: string | null; capacity: number; flags: { [x: string]: import("hono/utils/types").JSONValue; }; parentId: string | null; sortOrder: number; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 201; } | { input: { param: { id: string; }; } & { json: { kind: string; capacity: number; refType?: string | null | undefined; refId?: string | null | undefined; label?: string | null | undefined; flags?: Record | undefined; parentId?: string | null | undefined; sortOrder?: number | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { kind: string; capacity: number; refType?: string | null | undefined; refId?: string | null | undefined; label?: string | null | undefined; flags?: Record | undefined; parentId?: string | null | undefined; sortOrder?: number | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; }; } & { json: { kind: string; capacity: number; refType?: string | null | undefined; refId?: string | null | undefined; label?: string | null | undefined; flags?: Record | undefined; parentId?: string | null | undefined; sortOrder?: number | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; }; }; } & { "/slots/:id/allocation/resources/:resourceId": { $patch: { input: { param: { id: string; resourceId: string; }; } & { json: { label?: string | null | undefined; sortOrder?: number | undefined; refType?: string | null | undefined; refId?: string | null | undefined; capacity?: number | undefined; flags?: Record | undefined; parentId?: string | null | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; resourceId: string; }; } & { json: { label?: string | null | undefined; sortOrder?: number | undefined; refType?: string | null | undefined; refId?: string | null | undefined; capacity?: number | undefined; flags?: Record | undefined; parentId?: string | null | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; resourceId: string; }; } & { json: { label?: string | null | undefined; sortOrder?: number | undefined; refType?: string | null | undefined; refId?: string | null | undefined; capacity?: number | undefined; flags?: Record | undefined; parentId?: string | null | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; resourceId: string; }; } & { json: { label?: string | null | undefined; sortOrder?: number | undefined; refType?: string | null | undefined; refId?: string | null | undefined; capacity?: number | undefined; flags?: Record | undefined; parentId?: string | null | undefined; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; resourceId: string; }; } & { json: { label?: string | null | undefined; sortOrder?: number | undefined; refType?: string | null | undefined; refId?: string | null | undefined; capacity?: number | undefined; flags?: Record | undefined; parentId?: string | null | undefined; }; }; output: { data: { id: string; slotId: string; kind: string; refType: string | null; refId: string | null; label: string | null; capacity: number; flags: { [x: string]: import("hono/utils/types").JSONValue; }; parentId: string | null; sortOrder: number; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/slots/:id/allocation/resources/:resourceId": { $delete: { input: { param: { id: string; resourceId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; resourceId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; resourceId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 409; } | { input: { param: { id: string; resourceId: string; }; }; output: { error: string; detail?: import("hono/utils/types").JSONValue | undefined; }; outputFormat: "json"; status: 500; } | { input: { param: { id: string; resourceId: string; }; }; output: { data: { id: string; kind: string; label: string | null; capacity: number; }; }; outputFormat: "json"; status: 200; }; }; }, "/">, "/">;