import type { BookingDraftQuantities, BookingDraftTraveler, PricingAssignmentUnit, ResolvableExtraLine, ResolvedBookingDraft } from "./types.js"; /** * Resolve a booking-create draft into the per-unit quantities and * per-traveler unit assignments the submit pipeline + price preview * both need. Single source of truth for traveler→unit mapping. * * Shape branching: * - **Person-priced options** (only `person` units, no `room`): * quantities are derived from traveler assignments (1 adult + 1 * child + 1 infant = 3 line items, not "3 x Adult"). Auto-source * travelers are re-derived against the current option's bands. * - **Accommodation options** (any `room` unit): operator-picked * stepper quantities are preserved (1 DBL room is 1 line). Per- * traveler room assignments still update `travelerIndexesByUnitId` * so `booking_item_travelers` rows can be created. * * Respects assignment sources: * - `none` → the corresponding field stays null * - `manual` → the existing unit is kept when valid for the chosen option * - `auto` → re-derived against current options */ export declare function resolveBookingDraft(options: { quantities: BookingDraftQuantities; travelers: readonly TTraveler[]; units: readonly PricingAssignmentUnit[]; now?: Date; }): ResolvedBookingDraft; /** * Normalize per-person extras to charged traveler quantity and * stamp traveler links + `clientLineKey` so the server can link * each extra line to the travelers it applies to via * `booking_item_travelers`. * * Per-person mode (`pricingMode === "per_person"` or * `pricedPerPerson === true`): quantity multiplied by travelerCount, * `travelerKeys` set to all travelers when stable keys are supplied; * otherwise `travelerIndexes` is set as a deprecated fallback. * Non-per-person lines pass through with `clientLineKey` only. */ export declare function resolveBookingExtraLines(options: { extraLines: readonly TLine[]; travelerCount: number; travelerKeys?: readonly (string | null | undefined)[]; }): TLine[]; /** * Project a resolved draft's traveler list into the wire-format * `BookingCreateTravelerInput[]` shape the dialog submits. Derives * the `travelerCategory` from DOB / role. * * `roomUnitId` is a deprecated compatibility alias for the pricing tier * option unit. Inventory placement is expressed only by item lines and their * `travelerKeys`; the server accepts this field but does not persist it. */ export declare function travelersToRows(value: { travelers: readonly BookingDraftTraveler[]; }, now?: Date): Array<{ clientTravelerKey: string | null; personId: string | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; participantType: "traveler"; travelerCategory: "adult" | "child" | "infant" | null; isPrimary: boolean; roomUnitId: string | null; }>;