import type { PricingCategoryRecord } from "@voyant-travel/commerce-react/pricing"; import type { BookingsUiMessages } from "../i18n/messages.js"; import type { BookingCreatePaymentScheduleInput, PricingPreviewSnapshot } from "../index.js"; import type { OptionUnitsStepperUnit } from "./option-units-stepper-section.js"; import type { PaymentScheduleValue } from "./payment-schedule-section.js"; import type { TravelerEntry, TravelerPricingCategoryOption } from "./travelers-section.js"; export declare function generateBookingNumber(): string; export declare function paymentScheduleToRows(value: PaymentScheduleValue, currency: string, totalAmountCents: number | null): BookingCreatePaymentScheduleInput[]; /** * Pick the option-unit that matches a given age. Falls back to an * ADULT-coded unit when no min/max window matches, then to the first * unit in the option. When `age` is null (no DOB), prefer ADULT. */ /** * The catalog stepper builds unit names like "Standard double - Adult" * when an option has multiple units. The Room dropdown wants the bare * option name ("Standard double"), so we trim off the trailing * "- " suffix for display. */ export declare function stripUnitSuffix(name: string): string; /** * Any payment-schedule entry the operator has marked as already * paid. Drives the smart-default booking status on submit — if money * is in (deposit / full / split installment), the booking lands in * `confirmed`; otherwise it lands in `awaiting_payment`. */ export declare function hasAnyPaidPayment(schedule: PaymentScheduleValue): boolean; export declare function findAlreadyPaidInstallmentMissingPaymentDate(schedule: PaymentScheduleValue): number | null; /** * Inverse of stripUnitSuffix — strip the leading "Option name - " so * the per-unit label stands alone for category buttons. */ export declare function stripOptionPrefix(name: string): string; export declare function sameRoomUnits(left: OptionUnitsStepperUnit[], right: OptionUnitsStepperUnit[]): boolean; export declare function inferTravelerPricingCategoryId(traveler: TravelerEntry, categories: ReadonlyArray): string | null; export declare function normalizeBookingUnit(unit: OptionUnitsStepperUnit): OptionUnitsStepperUnit; export declare function isBookingInventoryUnit(unit: Pick): boolean; export declare function pricingSnapshotRoomUnits(snapshot: PricingPreviewSnapshot | null | undefined): OptionUnitsStepperUnit[]; export declare function mergePricingRoomMetadata(units: readonly OptionUnitsStepperUnit[], pricingUnits: readonly OptionUnitsStepperUnit[]): OptionUnitsStepperUnit[]; export type PricingCategoryLike = Pick & { categoryType: string; }; interface PayloadResolverMismatch { kind: "qty" | "missing" | "extra"; optionUnitId: string; submittedQuantity: number; resolvedQuantity: number; } export declare function isPayloadResolverMismatchBody(body: unknown): body is { code: "payload_resolver_mismatch"; mismatches: PayloadResolverMismatch[]; }; export declare function formatPayloadResolverMismatchError(body: { mismatches: PayloadResolverMismatch[]; }, unitLabels: Record, validationMessages: BookingsUiMessages["bookingCreateDialog"]["validation"]): string; export {};