import type { bookings } from "./schema-core.js"; export type BookingStatus = (typeof bookings.$inferSelect)["status"]; export declare const BOOKING_TRANSITIONS: { readonly draft: readonly ["on_hold", "awaiting_payment", "confirmed", "cancelled"]; readonly on_hold: readonly ["awaiting_payment", "confirmed", "expired", "cancelled"]; readonly awaiting_payment: readonly ["confirmed", "expired", "cancelled"]; readonly confirmed: readonly ["in_progress", "cancelled"]; readonly in_progress: readonly ["completed", "cancelled"]; readonly completed: readonly []; readonly expired: readonly []; readonly cancelled: readonly []; }; export declare class BookingTransitionError extends Error { readonly from: BookingStatus; readonly to: BookingStatus; readonly code = "INVALID_BOOKING_TRANSITION"; constructor(from: BookingStatus, to: BookingStatus); } export declare function canTransitionBooking(from: BookingStatus, to: BookingStatus): boolean; export interface BookingStatusPatch { status: BookingStatus; confirmedAt?: Date | null; expiredAt?: Date; cancelledAt?: Date; completedAt?: Date; awaitingPaymentAt?: Date; /** * Stamped when the booking transitions to `confirmed` from * `awaiting_payment` (i.e. the moment payment was received). * Distinct from `confirmedAt` so reporting can split "free * confirmations" from paid ones. */ paidAt?: Date; } export declare function transitionBooking(from: BookingStatus, to: BookingStatus, opts?: { now?: Date; }): BookingStatusPatch;