import { type ActionLedgerRequestContextValues, type CreatedTargetMutationLease } from "@voyant-travel/action-ledger"; import type { EventBus } from "@voyant-travel/core"; import type { NamespacedCustomFieldValues } from "@voyant-travel/core/custom-fields"; import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import type { z } from "zod"; import { type BookingPiiService, type BookingTravelerSnapshot } from "./pii.js"; import { type BookingStatus } from "./state-machine.js"; import type { bookingListQuerySchema, cancelBookingSchema, completeBookingSchema, confirmBookingSchema, convertProductSchema, createTravelerWithTravelDetailsSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemParticipantSchema, insertBookingItemSchema, insertBookingNoteSchema, insertTravelerRecordSchema, insertTravelerSchema, overrideBookingStatusSchema, recordBookingRedemptionSchema, startBookingSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingNoteSchema, updateBookingSchema, updateTravelerRecordSchema, updateTravelerSchema, updateTravelerWithTravelDetailsSchema } from "./validation.js"; type BookingListQuery = z.infer; type ConvertProductInput = z.infer; type UpdateBookingInput = z.infer; type ExtendBookingHoldInput = z.infer; type ConfirmBookingInput = z.infer; type CancelBookingInput = z.infer; type ExpireBookingInput = z.infer; type ExpireStaleBookingsInput = z.infer; type StartBookingInput = z.infer; type CompleteBookingInput = z.infer; type OverrideBookingStatusInput = z.infer; type CreateTravelerInput = z.infer; type UpdateTravelerInput = z.infer; type CreateTravelerRecordInput = z.infer; type UpdateTravelerRecordInput = z.infer; export type CreateTravelerWithTravelDetailsInput = z.infer; export type UpdateTravelerWithTravelDetailsInput = z.infer; export declare function normalizeBookingBillingPartyUpdate(data: UpdateBookingInput): UpdateBookingInput; type CreateBookingItemInput = z.infer; type UpdateBookingItemInput = z.infer; type CreateBookingItemParticipantInput = z.infer; type CreateBookingNoteInput = z.infer; type UpdateBookingNoteInput = z.infer; type CreateBookingDocumentInput = z.infer; type CreateBookingFulfillmentInput = z.infer; type UpdateBookingFulfillmentInput = z.infer; type RecordBookingRedemptionInput = z.infer; /** * Raised when a product booking would end up with no items at all — the caller * sent no `itemLines` and the resolved option has no single obvious unit to seed * (several optional units, or none). Creating the booking anyway yields a shell * that holds no inventory and carries no price, so the create fails closed and * the caller is told to name the units it wants. */ export declare class BookingItemsUnresolvedError extends Error { readonly productId: string; readonly optionId: string | null; readonly candidateUnitCount: number; constructor(productId: string, optionId: string | null, candidateUnitCount: number); } /** Product data needed for convertProductToBooking — supplied by the caller (template). */ export interface ConvertProductData { product: { id: string; name: string; description: string | null; sellCurrency: string; sellAmountCents: number | null; costAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; }; option: { id: string; name: string; } | null; /** * Availability slot the caller chose, if any. When set, the resulting booking * pins its startDate/endDate to the slot so recurring/scheduled products don't * land with null dates. */ slot?: { id: string; dateLocal: string; startsAt: Date; endsAt: Date | null; timezone: string; } | null; dayServices: Array<{ supplierServiceId: string | null; name: string; costCurrency: string; costAmountCents: number; }>; units: Array<{ id: string; optionId: string; name: string; description: string | null; unitType: string | null; isRequired: boolean; minQuantity: number | null; sortOrder: number; }>; } /** * Optional runtime hooks for status-transition flows. Keeps the service * decoupled from delivery concerns — bookings only has to emit, never know * what listens. */ export interface BookingServiceRuntime { eventBus?: EventBus; /** Optional managed-plan allowance; null/undefined keeps bookings unlimited. */ monthlyBookingLimit?: number | null; actionLedgerContext?: ActionLedgerRequestContextValues; actionLedgerAuthorizationSource?: string | null; actionLedgerCausationActionId?: string | null; actionLedgerApprovalId?: string | null; actionLedgerIdempotencyScope?: string | null; actionLedgerIdempotencyKey?: string | null; actionLedgerIdempotencyFingerprint?: string | null; actionLedgerRouteOrToolName?: string | null; expirePaymentSessionsForBooking?: (db: PostgresJsDatabase, bookingId: string) => Promise | void; closePaymentSchedulesForBooking?: (db: PostgresJsDatabase, bookingId: string, status: Extract) => Promise | void; recordCancellationFinancialSettlement?: (db: PostgresJsDatabase, input: { bookingId: string; bookingNumber: string; previousStatus: BookingCancelledEvent["previousStatus"]; reason: string | null; actorId: string; }) => Promise | null | undefined> | Record | null | undefined; } export declare function bookingLifecycleOutboxEventId(transition: "confirmed" | "cancelled", bookingId: string, runtime?: Pick, persistedTransitionAt?: Date | string | null): string; /** * Payload shape for `availability.slot.changed`. Mirrors the canonical * `AvailabilitySlotChangedEvent` from `@voyant-travel/operations` — defined * locally to avoid a runtime dep on operations (we already mirror its * schema via `availabilitySlotsRef` for the same reason). Subscribers * (e.g. channel-push) can import the canonical type directly. * * Per docs/architecture/channel-push-architecture.md §5.1. */ export interface AvailabilitySlotChangedEventPayload { slotId: string; productId: string; optionId: string | null; startsAt: Date | string; remainingPax: number | null; unlimited: boolean; source: "booking" | "cancel" | "expire" | "modify" | "manual" | "refresh"; } /** Stable string identifier for the event. */ export declare const AVAILABILITY_SLOT_CHANGED_EVENT: "availability.slot.changed"; /** * Payload shape for `booking.confirmed`. Subscribers should treat unknown * fields as forward-compatible additions. */ export interface BookingConfirmedEvent { bookingId: string; bookingNumber: string; actorId: string | null; /** * When true, customer-facing notification subscribers (e.g. the * notifications module's `autoConfirmAndDispatch`) should skip * dispatch for this event. Set by callers that want to confirm a * booking silently — e.g. operator-side data correction or * confirming a booking on behalf of a customer who's already been * notified out-of-band. */ suppressNotifications?: boolean; } /** * Payload for `booking.cancelled`. `previousStatus` is the state the booking * transitioned *out of* — useful for subscribers that care about cancelling a * confirmed booking (refund flow) vs cancelling a draft/hold (no side effects). */ export interface BookingCancelledEvent { bookingId: string; bookingNumber: string; previousStatus: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress"; reason?: string | null; actorId: string | null; suppressNotifications?: boolean; } /** * Payload for `booking.expired`. Fires when an on-hold booking's timer runs * out. `cause` flags whether it was the explicit route call or the sweep job — * subscribers that want to email the customer should probably skip * sweep-originated events to avoid pager noise during backfills. */ export interface BookingExpiredEvent { bookingId: string; bookingNumber: string; cause: "route" | "sweep"; actorId: string | null; } /** Payload for `booking.started` — confirmed → in_progress. */ export interface BookingStartedEvent { bookingId: string; bookingNumber: string; actorId: string | null; } /** Payload for `booking.completed` — in_progress → completed. */ export interface BookingCompletedEvent { bookingId: string; bookingNumber: string; actorId: string | null; } /** * Payload for `booking.status_overridden`. Fires when an admin bypasses the * transition graph. Subscribers should treat this as a privileged audit signal * distinct from the normal lifecycle events — e.g. compliance dashboards. */ export interface BookingStatusOverriddenEvent { bookingId: string; bookingNumber: string; fromStatus: BookingStatus; toStatus: BookingStatus; reason: string; actorId: string | null; } export interface BookingTravelerSharingGroupMember { id: string; bookingId: string; bookingNumber: string; participantType: string; travelerCategory: string | null; personId: string | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; isLeadTraveler: boolean; sharingGroupId: string; roomTypeId: string | null; bedPreference: string | null; allocations: Record; createdAt: Date; updatedAt: Date; } export interface BookingTravelerSharingGroupSummary { id: string; label: string; occupancy: number; roomTypeId: string | null; bookingIds: string[]; } /** * Per-resource capacity check used when a traveler is being assigned * to one or more allocation_resources via `travelDetails.allocations`. * * The slot-level pax check (`adjustSlotCapacity`) only enforces total * pax against `availability_slots.remaining_pax` — it cannot tell * that a request fits in the slot's room total but oversells the DBL * bucket. This helper walks each requested (kind, resourceId) pair, * loads the resource, and counts other travelers already assigned to * it across live bookings on the same slot. If the new traveler would * push that count above the resource's `capacity`, we throw * `resource_capacity_exhausted` citing the offending resource so * the caller can surface a useful error to the client. * * Implemented with raw SQL because @voyant-travel/bookings deliberately * has no runtime dep on @voyant-travel/operations (see the module- * decoupling notes in CLAUDE.md / MEMORY.md). The schema is stable — * `allocation_resources` and `booking_traveler_travel_details.allocations` * are migration-frozen. */ export interface BookingResourceCapacityViolation { slotId: string; resourceId: string; kind: string; capacity: number; existingAssigned: number; } /** * Exported for unit tests — production callers go through * `assertResourceCapacityForAllocations` / * `persistTravelDetailsWithCapacityCheck` below. */ export declare function loadResourceCapacityViolations(db: PostgresJsDatabase, travelerId: string, allocations: Record): Promise; export interface BookingAggregateUpcomingDeparture { id: string; bookingNumber: string | null; status: BookingStatus; startDate: string | null; endDate: string | null; pax: number | null; sellCurrency: string | null; sellAmountCents: number | null; } export interface BookingAggregates { /** Total bookings across all statuses in range. */ total: number; /** * Sum of `pax` across active-status bookings in range. Null pax * rows count as zero. Used by the operator dashboard's * "total travelers" KPI. */ totalPax: number; /** One row per booking status (including zero counts for active statuses). */ countsByStatus: Array<{ status: BookingStatus; count: number; }>; /** Booking counts bucketed by YYYY-MM (UTC), oldest first. */ monthlyCounts: Array<{ yearMonth: string; count: number; }>; /** * Sell revenue bucketed by YYYY-MM (UTC), grouped by currency. Null currency * rows are dropped since a booking without a sell currency is malformed. */ monthlyRevenue: Array<{ yearMonth: string; currency: string; sellAmountCents: number; }>; /** * Active bookings with `startDate >= today`: the total count plus a * bounded slice of the soonest-departing rows (default 8, max 20) * so the dashboard can render the upcoming list without a second * round-trip. */ upcomingDepartures: { count: number; items: BookingAggregateUpcomingDeparture[]; }; } declare const bookingsService: { /** * Pre-aggregated dashboard numbers for the admin bookings surface. Replaces * the pattern of fetching a large `listBookings` page and deriving KPIs * client-side — which broke past the page limit and disagreed across apps * on which statuses count. * * All ranges are UTC-based. */ getBookingAggregates(db: PostgresJsDatabase, options?: { from?: string; to?: string; upcomingLimit?: number; }): Promise; listBookings(db: PostgresJsDatabase, query: BookingListQuery): Promise<{ data: { startsAt: string | null; endsAt: string | null; items: { id: string; title: string; itemType: string; productId: string | null; productName: string | null; startsAt: string | null; endsAt: string | null; }[]; id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; }[]; total: number; limit: number; offset: number; }>; getBookingById(db: PostgresJsDatabase, id: string): Promise<{ id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null>; getBookingByNumber(db: PostgresJsDatabase, bookingNumber: string): Promise<{ id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null>; listAllocations(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productId: import("drizzle-orm/pg-core").PgColumn<{ name: "product_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionUnitId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_unit_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; pricingCategoryId: import("drizzle-orm/pg-core").PgColumn<{ name: "pricing_category_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; availabilitySlotId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; quantity: import("drizzle-orm/pg-core").PgColumn<{ name: "quantity"; tableName: "booking_allocations"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; allocationType: import("drizzle-orm/pg-core").PgColumn<{ name: "allocation_type"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgEnumColumn"; data: "resource" | "unit" | "pickup"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["unit", "pickup", "resource"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgEnumColumn"; data: "confirmed" | "cancelled" | "fulfilled" | "expired" | "held" | "released"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["held", "confirmed", "released", "expired", "cancelled", "fulfilled"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; holdExpiresAt: import("drizzle-orm/pg-core").PgColumn<{ name: "hold_expires_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; confirmedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "confirmed_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; releasedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "released_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_allocations"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_allocations", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; bookingItemId: string; productId: string | null; optionId: string | null; optionUnitId: string | null; pricingCategoryId: string | null; availabilitySlotId: string | null; quantity: number; allocationType: "resource" | "unit" | "pickup"; status: "confirmed" | "cancelled" | "fulfilled" | "expired" | "held" | "released"; holdExpiresAt: Date | null; confirmedAt: Date | null; releasedAt: Date | null; metadata: Record | null; createdAt: Date; updatedAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productId: import("drizzle-orm/pg-core").PgColumn<{ name: "product_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionUnitId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_unit_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; pricingCategoryId: import("drizzle-orm/pg-core").PgColumn<{ name: "pricing_category_id"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; availabilitySlotId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_allocations"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; quantity: import("drizzle-orm/pg-core").PgColumn<{ name: "quantity"; tableName: "booking_allocations"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; allocationType: import("drizzle-orm/pg-core").PgColumn<{ name: "allocation_type"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgEnumColumn"; data: "resource" | "unit" | "pickup"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["unit", "pickup", "resource"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_allocations"; dataType: "string"; columnType: "PgEnumColumn"; data: "confirmed" | "cancelled" | "fulfilled" | "expired" | "held" | "released"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["held", "confirmed", "released", "expired", "cancelled", "fulfilled"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; holdExpiresAt: import("drizzle-orm/pg-core").PgColumn<{ name: "hold_expires_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; confirmedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "confirmed_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; releasedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "released_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_allocations"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_allocations"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; updateBooking(db: PostgresJsDatabase, id: string, data: UpdateBookingInput, runtime?: BookingServiceRuntime): Promise<{ id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null>; deleteBooking(db: PostgresJsDatabase, id: string): Promise<{ id: string; } | null>; confirmBooking(db: PostgresJsDatabase, id: string, data: ConfirmBookingInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ readonly limit: number; readonly current: number; readonly periodStart: string; readonly periodEnd: string; readonly status: "monthly_booking_limit_reached"; readonly message: string; } | { status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; }>; recoverExpiredPaidBooking(db: PostgresJsDatabase, id: string, data?: ConfirmBookingInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ readonly limit: number; readonly current: number; readonly periodStart: string; readonly periodEnd: string; readonly status: "monthly_booking_limit_reached"; readonly message: string; } | { status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; }>; extendBookingHold(db: PostgresJsDatabase, id: string, data: ExtendBookingHoldInput, userId?: string): Promise<{ status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; }>; expireBooking(db: PostgresJsDatabase, id: string, data: ExpireBookingInput, userId?: string, runtime?: BookingServiceRuntime & { cause?: "route" | "sweep"; }): Promise<{ status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; }>; expireStaleBookings(db: PostgresJsDatabase, data: ExpireStaleBookingsInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ expiredIds: string[]; count: number; cutoff: Date; }>; cancelBooking(db: PostgresJsDatabase, id: string, data: CancelBookingInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; booking?: undefined; }>; startBooking(db: PostgresJsDatabase, id: string, data: StartBookingInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; }>; completeBooking(db: PostgresJsDatabase, id: string, data: CompleteBookingInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; }>; /** * Admin-only force: bypasses the transition graph. Terminal overrides * cascade to items and allocations so reporting and capacity stay * consistent; non-terminal overrides remain booking-row data correction. */ overrideBookingStatus(db: PostgresJsDatabase, id: string, data: OverrideBookingStatusInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{ readonly limit: number; readonly current: number; readonly periodStart: string; readonly periodEnd: string; readonly status: "monthly_booking_limit_reached"; readonly message: string; } | { status: "ok"; booking: { id: string; bookingNumber: string; revision: number; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; personId: string | null; organizationId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; sellCurrency: string; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; createdAt: Date; updatedAt: Date; } | null; } | { status: Exclude; booking?: undefined; }>; listTravelerRecords(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; personId: import("drizzle-orm/pg-core").PgColumn<{ name: "person_id"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; participantType: import("drizzle-orm/pg-core").PgColumn<{ name: "participant_type"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "traveler" | "occupant"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["traveler", "occupant", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerCategory: import("drizzle-orm/pg-core").PgColumn<{ name: "traveler_category"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "adult" | "child" | "infant" | "senior"; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["adult", "child", "infant", "senior", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; firstName: import("drizzle-orm/pg-core").PgColumn<{ name: "first_name"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; lastName: import("drizzle-orm/pg-core").PgColumn<{ name: "last_name"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; email: import("drizzle-orm/pg-core").PgColumn<{ name: "email"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; phone: import("drizzle-orm/pg-core").PgColumn<{ name: "phone"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; preferredLanguage: import("drizzle-orm/pg-core").PgColumn<{ name: "preferred_language"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; specialRequests: import("drizzle-orm/pg-core").PgColumn<{ name: "special_requests"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; isPrimary: import("drizzle-orm/pg-core").PgColumn<{ name: "is_primary"; tableName: "booking_travelers"; dataType: "boolean"; columnType: "PgBoolean"; data: boolean; driverParam: boolean; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_travelers"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_travelers"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_travelers", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; personId: string | null; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; personId: import("drizzle-orm/pg-core").PgColumn<{ name: "person_id"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; participantType: import("drizzle-orm/pg-core").PgColumn<{ name: "participant_type"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "traveler" | "occupant"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["traveler", "occupant", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerCategory: import("drizzle-orm/pg-core").PgColumn<{ name: "traveler_category"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "adult" | "child" | "infant" | "senior"; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["adult", "child", "infant", "senior", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; firstName: import("drizzle-orm/pg-core").PgColumn<{ name: "first_name"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; lastName: import("drizzle-orm/pg-core").PgColumn<{ name: "last_name"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; email: import("drizzle-orm/pg-core").PgColumn<{ name: "email"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; phone: import("drizzle-orm/pg-core").PgColumn<{ name: "phone"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; preferredLanguage: import("drizzle-orm/pg-core").PgColumn<{ name: "preferred_language"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; specialRequests: import("drizzle-orm/pg-core").PgColumn<{ name: "special_requests"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; isPrimary: import("drizzle-orm/pg-core").PgColumn<{ name: "is_primary"; tableName: "booking_travelers"; dataType: "boolean"; columnType: "PgBoolean"; data: boolean; driverParam: boolean; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_travelers"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_travelers"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; getTravelerRecordById(db: PostgresJsDatabase, bookingId: string, travelerId: string): Promise<{ id: string; bookingId: string; personId: string | null; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; } | null>; createTravelerRecord(db: PostgresJsDatabase, bookingId: string, data: CreateTravelerRecordInput, userId?: string): Promise<{ id: string; createdAt: Date; bookingId: string; notes: string | null; updatedAt: Date; email: string | null; phone: string | null; personId: string | null; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; } | null>; updateTravelerRecord(db: PostgresJsDatabase, travelerId: string, data: UpdateTravelerRecordInput): Promise<{ id: string; bookingId: string; personId: string | null; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; } | null>; /** * Create a traveler row and persist the encrypted travel-details envelope in * a single call. Migration boundary helper for consumers coming from the * pre-0.10 `createTravelerRecord({ ..., accessibilityNeeds, ... })` shape: * the storage split (plaintext columns + encrypted bucket) is preserved, but * the call ergonomics collapse back to one flat payload. Plaintext fields go * to `createTravelerRecord`; encrypted fields are forwarded to * `pii.upsertTravelerTravelDetails`. Operations are sequential, not * transactional — a failure in the encrypted-fields write leaves the * plaintext row in place (matching the pre-helper two-call protocol). */ createTravelerWithTravelDetails(db: PostgresJsDatabase, bookingId: string, data: CreateTravelerWithTravelDetailsInput, opts: { pii: BookingPiiService; userId?: string; actorId?: string | null; /** * Optional resolver invoked when `data.personId` is set. Returns * a plaintext snapshot of dietary / accessibility / primary * passport from the linked person record. Snapshot fields fill * gaps in `data` only — explicit input always wins. Templates * wire this from `relationshipsService.loadPersonTravelSnapshot`. */ resolveTravelSnapshot?: (personId: string) => Promise; }): Promise<{ traveler: { id: string; createdAt: Date; bookingId: string; notes: string | null; updatedAt: Date; email: string | null; phone: string | null; personId: string | null; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; }; travelDetails: { travelerId: string; nationality: string | null; documentType: "other" | "visa" | "passport" | "id_card" | "driver_license" | null; documentNumber: string | null; documentExpiry: string | null; documentIssuingCountry: string | null; documentIssuingAuthority: string | null; documentPersonDocumentId: string | null; dateOfBirth: string | null; dietaryRequirements: string | null; accessibilityNeeds: string | null; isLeadTraveler: boolean; sharingGroupId: string | null; roomTypeId: string | null; bedPreference: "single" | "twin" | "double" | "no-preference" | null; allocations: Record; createdAt: Date; updatedAt: Date; } | null; } | null>; /** * Update a traveler row and (re-)upsert the encrypted travel-details * envelope in a single call. Same migration-ergonomics motivation as * `createTravelerWithTravelDetails`. Undefined fields are not written; * `null` clears a column / encrypted field. */ updateTravelerWithTravelDetails(db: PostgresJsDatabase, travelerId: string, data: UpdateTravelerWithTravelDetailsInput, opts: { pii: BookingPiiService; actorId?: string | null; }): Promise<{ traveler: { id: string; bookingId: string; personId: string | null; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; }; travelDetails: { travelerId: string; nationality: string | null; documentType: "other" | "visa" | "passport" | "id_card" | "driver_license" | null; documentNumber: string | null; documentExpiry: string | null; documentIssuingCountry: string | null; documentIssuingAuthority: string | null; documentPersonDocumentId: string | null; dateOfBirth: string | null; dietaryRequirements: string | null; accessibilityNeeds: string | null; isLeadTraveler: boolean; sharingGroupId: string | null; roomTypeId: string | null; bedPreference: "single" | "twin" | "double" | "no-preference" | null; allocations: Record; createdAt: Date; updatedAt: Date; } | null; } | null>; deleteTravelerRecord(db: PostgresJsDatabase, travelerId: string): Promise<{ id: string; bookingId: string; } | null>; listTravelers(db: PostgresJsDatabase, bookingId: string): Promise<{ id: string; bookingId: string; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; }[]>; listSharingGroupsForSlot(db: PostgresJsDatabase, slotId: string): Promise; listTravelersBySharingGroup(db: PostgresJsDatabase, slotId: string, sharingGroupId: string): Promise; createTraveler(db: PostgresJsDatabase, bookingId: string, data: CreateTravelerInput, userId?: string): Promise<{ id: string; bookingId: string; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; } | null>; updateTraveler(db: PostgresJsDatabase, travelerId: string, data: UpdateTravelerInput): Promise<{ id: string; bookingId: string; participantType: "other" | "traveler" | "occupant"; travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null; firstName: string; lastName: string; email: string | null; phone: string | null; preferredLanguage: string | null; specialRequests: string | null; isPrimary: boolean; notes: string | null; createdAt: Date; updatedAt: Date; } | null>; deleteTraveler(db: PostgresJsDatabase, travelerId: string): Promise<{ id: string; bookingId: string; } | null>; /** * Lists booking items. Snapshot columns * (`productNameSnapshot`/`optionNameSnapshot`/`unitNameSnapshot`/ * `departureLabelSnapshot`) travel with the row, so consumers see * exactly what was sold at booking time — no JOIN required, works in * catalog-less deployments, survives product deletion or renames. */ listItems(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; title: import("drizzle-orm/pg-core").PgColumn<{ name: "title"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; description: import("drizzle-orm/pg-core").PgColumn<{ name: "description"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; itemType: import("drizzle-orm/pg-core").PgColumn<{ name: "item_type"; tableName: "booking_items"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "extra" | "service" | "unit" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["unit", "extra", "service", "fee", "tax", "discount", "adjustment", "accommodation", "transport", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_items"; dataType: "string"; columnType: "PgEnumColumn"; data: "draft" | "confirmed" | "cancelled" | "fulfilled" | "on_hold" | "expired"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["draft", "on_hold", "confirmed", "cancelled", "expired", "fulfilled"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; serviceDate: import("drizzle-orm/pg-core").PgColumn<{ name: "service_date"; tableName: "booking_items"; dataType: "string"; columnType: "PgDateString"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; startsAt: import("drizzle-orm/pg-core").PgColumn<{ name: "starts_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; endsAt: import("drizzle-orm/pg-core").PgColumn<{ name: "ends_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; quantity: import("drizzle-orm/pg-core").PgColumn<{ name: "quantity"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; sellCurrency: import("drizzle-orm/pg-core").PgColumn<{ name: "sell_currency"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; unitSellAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "unit_sell_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; totalSellAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "total_sell_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; costCurrency: import("drizzle-orm/pg-core").PgColumn<{ name: "cost_currency"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; unitCostAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "unit_cost_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; totalCostAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "total_cost_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productId: import("drizzle-orm/pg-core").PgColumn<{ name: "product_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionUnitId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_unit_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; pricingCategoryId: import("drizzle-orm/pg-core").PgColumn<{ name: "pricing_category_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; availabilitySlotId: import("drizzle-orm/pg-core").PgColumn<{ name: "availability_slot_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productNameSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "product_name_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionNameSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "option_name_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; unitNameSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "unit_name_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; departureLabelSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "departure_label_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; sourceSnapshotId: import("drizzle-orm/pg-core").PgColumn<{ name: "source_snapshot_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; sourceOfferId: import("drizzle-orm/pg-core").PgColumn<{ name: "source_offer_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_items"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_items", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; title: string; description: string | null; itemType: "other" | "extra" | "service" | "unit" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport"; status: "draft" | "confirmed" | "cancelled" | "fulfilled" | "on_hold" | "expired"; serviceDate: string | null; startsAt: Date | null; endsAt: Date | null; quantity: number; sellCurrency: string; unitSellAmountCents: number | null; totalSellAmountCents: number | null; costCurrency: string | null; unitCostAmountCents: number | null; totalCostAmountCents: number | null; notes: string | null; productId: string | null; optionId: string | null; optionUnitId: string | null; pricingCategoryId: string | null; availabilitySlotId: string | null; productNameSnapshot: string | null; optionNameSnapshot: string | null; unitNameSnapshot: string | null; departureLabelSnapshot: string | null; sourceSnapshotId: string | null; sourceOfferId: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; title: import("drizzle-orm/pg-core").PgColumn<{ name: "title"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; description: import("drizzle-orm/pg-core").PgColumn<{ name: "description"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; itemType: import("drizzle-orm/pg-core").PgColumn<{ name: "item_type"; tableName: "booking_items"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "extra" | "service" | "unit" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["unit", "extra", "service", "fee", "tax", "discount", "adjustment", "accommodation", "transport", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_items"; dataType: "string"; columnType: "PgEnumColumn"; data: "draft" | "confirmed" | "cancelled" | "fulfilled" | "on_hold" | "expired"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["draft", "on_hold", "confirmed", "cancelled", "expired", "fulfilled"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; serviceDate: import("drizzle-orm/pg-core").PgColumn<{ name: "service_date"; tableName: "booking_items"; dataType: "string"; columnType: "PgDateString"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; startsAt: import("drizzle-orm/pg-core").PgColumn<{ name: "starts_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; endsAt: import("drizzle-orm/pg-core").PgColumn<{ name: "ends_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; quantity: import("drizzle-orm/pg-core").PgColumn<{ name: "quantity"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; sellCurrency: import("drizzle-orm/pg-core").PgColumn<{ name: "sell_currency"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; unitSellAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "unit_sell_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; totalSellAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "total_sell_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; costCurrency: import("drizzle-orm/pg-core").PgColumn<{ name: "cost_currency"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; unitCostAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "unit_cost_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; totalCostAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "total_cost_amount_cents"; tableName: "booking_items"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productId: import("drizzle-orm/pg-core").PgColumn<{ name: "product_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionUnitId: import("drizzle-orm/pg-core").PgColumn<{ name: "option_unit_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; pricingCategoryId: import("drizzle-orm/pg-core").PgColumn<{ name: "pricing_category_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; availabilitySlotId: import("drizzle-orm/pg-core").PgColumn<{ name: "availability_slot_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productNameSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "product_name_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; optionNameSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "option_name_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; unitNameSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "unit_name_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; departureLabelSnapshot: import("drizzle-orm/pg-core").PgColumn<{ name: "departure_label_snapshot"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; sourceSnapshotId: import("drizzle-orm/pg-core").PgColumn<{ name: "source_snapshot_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; sourceOfferId: import("drizzle-orm/pg-core").PgColumn<{ name: "source_offer_id"; tableName: "booking_items"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_items"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_items"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; listProductTicketSettings(db: PostgresJsDatabase, productIds: string[]): Omit; productId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fulfillmentMode: import("drizzle-orm/pg-core").PgColumn<{ name: "fulfillment_mode"; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; defaultDeliveryFormat: import("drizzle-orm/pg-core").PgColumn<{ name: "default_delivery_format"; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; ticketPerUnit: import("drizzle-orm/pg-core").PgColumn<{ name: "ticket_per_unit"; tableName: "product_ticket_settings"; dataType: "boolean"; columnType: "PgBoolean"; data: boolean; driverParam: boolean; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"product_ticket_settings", "not-null">, false, "where" | "orderBy", { id: string; productId: string; fulfillmentMode: string; defaultDeliveryFormat: string; ticketPerUnit: boolean; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; productId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fulfillmentMode: import("drizzle-orm/pg-core").PgColumn<{ name: "fulfillment_mode"; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; defaultDeliveryFormat: import("drizzle-orm/pg-core").PgColumn<{ name: "default_delivery_format"; tableName: "product_ticket_settings"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; ticketPerUnit: import("drizzle-orm/pg-core").PgColumn<{ name: "ticket_per_unit"; tableName: "product_ticket_settings"; dataType: "boolean"; columnType: "PgBoolean"; data: boolean; driverParam: boolean; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy"> | Promise; /** * Re-derive `bookings.sellAmountCents` / `costAmountCents` from * `Σ(booking_items.total*AmountCents)`, plus — when the booking * declares a `baseCurrency` and `fxRateSetId` — re-derive * `baseSellAmountCents` / `baseCostAmountCents` by converting each * item's total via the FX rate set. * * Called automatically inside the item-mutation methods so callers * that go through `createItem` / `updateItem` / `deleteItem` never * have to remember to roll the parent. Public so external flows * (saga compensations, ad-hoc fix-ups) can also invoke it. * * Pass a tx-bound `db` to compose with an existing transaction; this * method does NOT wrap its own transaction. * * **FX rollup behaviour**: * * - Single-currency booking (every item's `sellCurrency === baseCurrency`, * or `baseCurrency === sellCurrency` on the parent): `base*Cents` * equal `sell*Cents` / `cost*Cents` directly. No FX lookup needed. * - Multi-currency booking with `fxRateSetId`: every item is * converted to `baseCurrency` via `exchange_rates`. If any item's * currency is missing from the rate set, the FX rollup short-circuits * with `fxStatus: "missing_rate"` and `base*Cents` are LEFT * UNCHANGED on the parent (caller chooses whether to abort). * - No `baseCurrency` configured: FX rollup is skipped entirely * (`fxStatus: "skipped"`), and `base*Cents` stay null. * * Returns `{ sellAmountCents, costAmountCents, baseSellAmountCents, * baseCostAmountCents, fxStatus, missingCurrency? }` or `null` for a * missing booking. */ recomputeBookingTotal(db: PostgresJsDatabase, bookingId: string): Promise<{ missingCurrency?: string | undefined; sellAmountCents: number; costAmountCents: number; baseSellAmountCents: number | null; baseCostAmountCents: number | null; fxStatus: "ok" | "missing_rate" | "skipped"; } | null>; createItem(db: PostgresJsDatabase, bookingId: string, data: CreateBookingItemInput, userId?: string): Promise<{ id: string; status: "draft" | "confirmed" | "cancelled" | "fulfilled" | "on_hold" | "expired"; createdAt: Date; bookingId: string; description: string | null; quantity: number; sellCurrency: string; unitSellAmountCents: number | null; totalSellAmountCents: number | null; costCurrency: string | null; unitCostAmountCents: number | null; totalCostAmountCents: number | null; notes: string | null; metadata: Record | null; updatedAt: Date; productId: string | null; optionId: string | null; optionUnitId: string | null; title: string; itemType: "other" | "extra" | "service" | "unit" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport"; serviceDate: string | null; startsAt: Date | null; endsAt: Date | null; pricingCategoryId: string | null; availabilitySlotId: string | null; productNameSnapshot: string | null; optionNameSnapshot: string | null; unitNameSnapshot: string | null; departureLabelSnapshot: string | null; sourceSnapshotId: string | null; sourceOfferId: string | null; } | null>; updateItem(db: PostgresJsDatabase, itemId: string, data: UpdateBookingItemInput): Promise<{ id: string; bookingId: string; title: string; description: string | null; itemType: "other" | "extra" | "service" | "unit" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport"; status: "draft" | "confirmed" | "cancelled" | "fulfilled" | "on_hold" | "expired"; serviceDate: string | null; startsAt: Date | null; endsAt: Date | null; quantity: number; sellCurrency: string; unitSellAmountCents: number | null; totalSellAmountCents: number | null; costCurrency: string | null; unitCostAmountCents: number | null; totalCostAmountCents: number | null; notes: string | null; productId: string | null; optionId: string | null; optionUnitId: string | null; pricingCategoryId: string | null; availabilitySlotId: string | null; productNameSnapshot: string | null; optionNameSnapshot: string | null; unitNameSnapshot: string | null; departureLabelSnapshot: string | null; sourceSnapshotId: string | null; sourceOfferId: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | null>; deleteItem(db: PostgresJsDatabase, itemId: string, userId?: string): Promise<{ id: string; } | null>; listItemParticipants(db: PostgresJsDatabase, itemId: string): Omit; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; role: import("drizzle-orm/pg-core").PgColumn<{ name: "role"; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "traveler" | "occupant" | "beneficiary"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["traveler", "occupant", "beneficiary", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; isPrimary: import("drizzle-orm/pg-core").PgColumn<{ name: "is_primary"; tableName: "booking_item_travelers"; dataType: "boolean"; columnType: "PgBoolean"; data: boolean; driverParam: boolean; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_item_travelers"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_item_travelers", "not-null">, false, "where" | "orderBy", { id: string; bookingItemId: string; travelerId: string; role: "other" | "traveler" | "occupant" | "beneficiary"; isPrimary: boolean; createdAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; role: import("drizzle-orm/pg-core").PgColumn<{ name: "role"; tableName: "booking_item_travelers"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "traveler" | "occupant" | "beneficiary"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["traveler", "occupant", "beneficiary", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; isPrimary: import("drizzle-orm/pg-core").PgColumn<{ name: "is_primary"; tableName: "booking_item_travelers"; dataType: "boolean"; columnType: "PgBoolean"; data: boolean; driverParam: boolean; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_item_travelers"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; addItemParticipant(db: PostgresJsDatabase, itemId: string, data: CreateBookingItemParticipantInput): Promise<{ id: string; createdAt: Date; bookingItemId: string; travelerId: string; isPrimary: boolean; role: "other" | "traveler" | "occupant" | "beneficiary"; } | null | undefined>; removeItemParticipant(db: PostgresJsDatabase, linkId: string): Promise<{ id: string; } | null>; listSupplierStatuses(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_service_id"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierId: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_id"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; serviceName: import("drizzle-orm/pg-core").PgColumn<{ name: "service_name"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgEnumColumn"; data: "confirmed" | "cancelled" | "pending" | "rejected"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["pending", "confirmed", "rejected", "cancelled"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierReference: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_reference"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; costCurrency: import("drizzle-orm/pg-core").PgColumn<{ name: "cost_currency"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; costAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "cost_amount_cents"; tableName: "booking_supplier_statuses"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierInvoiceLineId: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_invoice_line_id"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; confirmedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "confirmed_at"; tableName: "booking_supplier_statuses"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_supplier_statuses"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_supplier_statuses"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_supplier_statuses", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; supplierServiceId: string | null; supplierId: string | null; serviceName: string; status: "confirmed" | "cancelled" | "pending" | "rejected"; supplierReference: string | null; costCurrency: string; costAmountCents: number; supplierInvoiceLineId: string | null; notes: string | null; confirmedAt: Date | null; createdAt: Date; updatedAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierServiceId: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_service_id"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierId: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_id"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; serviceName: import("drizzle-orm/pg-core").PgColumn<{ name: "service_name"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgEnumColumn"; data: "confirmed" | "cancelled" | "pending" | "rejected"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["pending", "confirmed", "rejected", "cancelled"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierReference: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_reference"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; costCurrency: import("drizzle-orm/pg-core").PgColumn<{ name: "cost_currency"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; costAmountCents: import("drizzle-orm/pg-core").PgColumn<{ name: "cost_amount_cents"; tableName: "booking_supplier_statuses"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; supplierInvoiceLineId: import("drizzle-orm/pg-core").PgColumn<{ name: "supplier_invoice_line_id"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_supplier_statuses"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; confirmedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "confirmed_at"; tableName: "booking_supplier_statuses"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_supplier_statuses"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_supplier_statuses"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; createSupplierStatus(db: PostgresJsDatabase, bookingId: string, data: { supplierServiceId?: string | null; supplierId?: string | null; serviceName: string; status?: "pending" | "confirmed" | "rejected" | "cancelled"; supplierReference?: string | null; costCurrency: string; costAmountCents: number; supplierInvoiceLineId?: string | null; notes?: string | null; }, userId?: string): Promise<{ id: string; status: "confirmed" | "cancelled" | "pending" | "rejected"; createdAt: Date; bookingId: string; costCurrency: string; notes: string | null; updatedAt: Date; costAmountCents: number; confirmedAt: Date | null; supplierServiceId: string | null; supplierId: string | null; serviceName: string; supplierReference: string | null; supplierInvoiceLineId: string | null; } | null>; updateSupplierStatus(db: PostgresJsDatabase, bookingId: string, statusId: string, data: { supplierServiceId?: string | null; supplierId?: string | null; serviceName?: string; status?: "pending" | "confirmed" | "rejected" | "cancelled"; supplierReference?: string | null; costCurrency?: string; costAmountCents?: number; supplierInvoiceLineId?: string | null; notes?: string | null; confirmedAt?: string | null; }, userId?: string): Promise<{ id: string; bookingId: string; supplierServiceId: string | null; supplierId: string | null; serviceName: string; status: "confirmed" | "cancelled" | "pending" | "rejected"; supplierReference: string | null; costCurrency: string; costAmountCents: number; supplierInvoiceLineId: string | null; notes: string | null; confirmedAt: Date | null; createdAt: Date; updatedAt: Date; } | null>; listFulfillments(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fulfillmentType: import("drizzle-orm/pg-core").PgColumn<{ name: "fulfillment_type"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "service_voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["service_voucher", "ticket", "pdf", "qr_code", "barcode", "mobile", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; deliveryChannel: import("drizzle-orm/pg-core").PgColumn<{ name: "delivery_channel"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgEnumColumn"; data: "email" | "other" | "download" | "api" | "wallet"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["download", "email", "api", "wallet", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgEnumColumn"; data: "pending" | "issued" | "reissued" | "revoked" | "failed"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["pending", "issued", "reissued", "revoked", "failed"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; artifactUrl: import("drizzle-orm/pg-core").PgColumn<{ name: "artifact_url"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; payload: import("drizzle-orm/pg-core").PgColumn<{ name: "payload"; tableName: "booking_fulfillments"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; issuedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "issued_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; revokedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "revoked_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_fulfillments", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; bookingItemId: string | null; travelerId: string | null; fulfillmentType: "other" | "service_voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile"; deliveryChannel: "email" | "other" | "download" | "api" | "wallet"; status: "pending" | "issued" | "reissued" | "revoked" | "failed"; artifactUrl: string | null; payload: Record | null; issuedAt: Date | null; revokedAt: Date | null; createdAt: Date; updatedAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fulfillmentType: import("drizzle-orm/pg-core").PgColumn<{ name: "fulfillment_type"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "service_voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["service_voucher", "ticket", "pdf", "qr_code", "barcode", "mobile", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; deliveryChannel: import("drizzle-orm/pg-core").PgColumn<{ name: "delivery_channel"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgEnumColumn"; data: "email" | "other" | "download" | "api" | "wallet"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["download", "email", "api", "wallet", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; status: import("drizzle-orm/pg-core").PgColumn<{ name: "status"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgEnumColumn"; data: "pending" | "issued" | "reissued" | "revoked" | "failed"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["pending", "issued", "reissued", "revoked", "failed"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; artifactUrl: import("drizzle-orm/pg-core").PgColumn<{ name: "artifact_url"; tableName: "booking_fulfillments"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; payload: import("drizzle-orm/pg-core").PgColumn<{ name: "payload"; tableName: "booking_fulfillments"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; issuedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "issued_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; revokedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "revoked_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; updatedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "updated_at"; tableName: "booking_fulfillments"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; issueFulfillment(db: PostgresJsDatabase, bookingId: string, data: CreateBookingFulfillmentInput, userId?: string): Promise<{ id: string; status: "pending" | "issued" | "reissued" | "revoked" | "failed"; createdAt: Date; bookingId: string; updatedAt: Date; bookingItemId: string | null; travelerId: string | null; fulfillmentType: "other" | "service_voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile"; deliveryChannel: "email" | "other" | "download" | "api" | "wallet"; artifactUrl: string | null; payload: Record | null; issuedAt: Date | null; revokedAt: Date | null; } | null>; updateFulfillment(db: PostgresJsDatabase, bookingId: string, fulfillmentId: string, data: UpdateBookingFulfillmentInput, userId?: string): Promise<{ id: string; bookingId: string; bookingItemId: string | null; travelerId: string | null; fulfillmentType: "other" | "service_voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile"; deliveryChannel: "email" | "other" | "download" | "api" | "wallet"; status: "pending" | "issued" | "reissued" | "revoked" | "failed"; artifactUrl: string | null; payload: Record | null; issuedAt: Date | null; revokedAt: Date | null; createdAt: Date; updatedAt: Date; } | null>; listRedemptionEvents(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; redeemedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "redeemed_at"; tableName: "booking_redemption_events"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; redeemedBy: import("drizzle-orm/pg-core").PgColumn<{ name: "redeemed_by"; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; location: import("drizzle-orm/pg-core").PgColumn<{ name: "location"; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; method: import("drizzle-orm/pg-core").PgColumn<{ name: "method"; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "manual" | "api" | "scan"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["manual", "scan", "api", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_redemption_events"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_redemption_events"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_redemption_events", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; bookingItemId: string | null; travelerId: string | null; redeemedAt: Date; redeemedBy: string | null; location: string | null; method: "other" | "manual" | "api" | "scan"; metadata: Record | null; createdAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingItemId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; redeemedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "redeemed_at"; tableName: "booking_redemption_events"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; redeemedBy: import("drizzle-orm/pg-core").PgColumn<{ name: "redeemed_by"; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; location: import("drizzle-orm/pg-core").PgColumn<{ name: "location"; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; method: import("drizzle-orm/pg-core").PgColumn<{ name: "method"; tableName: "booking_redemption_events"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "manual" | "api" | "scan"; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["manual", "scan", "api", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_redemption_events"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_redemption_events"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; recordRedemption(db: PostgresJsDatabase, bookingId: string, data: RecordBookingRedemptionInput, userId?: string): Promise<{ id: string; createdAt: Date; bookingId: string; metadata: Record | null; bookingItemId: string | null; travelerId: string | null; redeemedAt: Date; redeemedBy: string | null; location: string | null; method: "other" | "manual" | "api" | "scan"; } | null>; listActivity(db: PostgresJsDatabase, bookingId: string): Omit; actorEmail: import("drizzle-orm/pg-core").PgColumn<{ name: "email"; tableName: "user"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; actorId: import("drizzle-orm/pg-core").PgColumn<{ name: "actor_id"; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; activityType: import("drizzle-orm/pg-core").PgColumn<{ name: "activity_type"; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgEnumColumn"; data: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "booking_started" | "booking_completed" | "hold_extended" | "hold_expired" | "status_change" | "status_overridden" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "traveler_update" | "note_added" | "system_action"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "booking_started", "booking_completed", "hold_extended", "hold_expired", "status_change", "status_overridden", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "traveler_update", "note_added", "system_action"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; description: import("drizzle-orm/pg-core").PgColumn<{ name: "description"; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_activity_log"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_activity_log"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "partial", Record<"booking_activity_log", "not-null"> & { user: "nullable"; }, false, "where" | "orderBy", { actorName: string | null; actorEmail: string | null; id: string; bookingId: string; actorId: string | null; activityType: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "booking_started" | "booking_completed" | "hold_extended" | "hold_expired" | "status_change" | "status_overridden" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "traveler_update" | "note_added" | "system_action"; description: string; metadata: Record | null; createdAt: Date; }[], { actorName: import("drizzle-orm").Column, { notNull: false; }>, object, object>; actorEmail: import("drizzle-orm").Column, { notNull: false; }>, object, object>; id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; actorId: import("drizzle-orm/pg-core").PgColumn<{ name: "actor_id"; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; activityType: import("drizzle-orm/pg-core").PgColumn<{ name: "activity_type"; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgEnumColumn"; data: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "booking_started" | "booking_completed" | "hold_extended" | "hold_expired" | "status_change" | "status_overridden" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "traveler_update" | "note_added" | "system_action"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "booking_started", "booking_completed", "hold_extended", "hold_expired", "status_change", "status_overridden", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "traveler_update", "note_added", "system_action"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; description: import("drizzle-orm/pg-core").PgColumn<{ name: "description"; tableName: "booking_activity_log"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; metadata: import("drizzle-orm/pg-core").PgColumn<{ name: "metadata"; tableName: "booking_activity_log"; dataType: "json"; columnType: "PgJsonb"; data: Record; driverParam: unknown; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, { $type: Record; }>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_activity_log"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; listNotes(db: PostgresJsDatabase, bookingId: string): Omit; authorEmail: import("drizzle-orm/pg-core").PgColumn<{ name: "email"; tableName: "user"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; authorId: import("drizzle-orm/pg-core").PgColumn<{ name: "author_id"; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; content: import("drizzle-orm/pg-core").PgColumn<{ name: "content"; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_notes"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "partial", Record<"booking_notes", "not-null"> & { user: "nullable"; }, false, "where" | "orderBy", { authorName: string | null; authorEmail: string | null; id: string; bookingId: string; authorId: string; content: string; createdAt: Date; }[], { authorName: import("drizzle-orm").Column, { notNull: false; }>, object, object>; authorEmail: import("drizzle-orm").Column, { notNull: false; }>, object, object>; id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; authorId: import("drizzle-orm/pg-core").PgColumn<{ name: "author_id"; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; content: import("drizzle-orm/pg-core").PgColumn<{ name: "content"; tableName: "booking_notes"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_notes"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; createNote(db: PostgresJsDatabase, bookingId: string, userId: string, data: CreateBookingNoteInput): Promise<{ id: string; createdAt: Date; bookingId: string; authorId: string; content: string; } | null>; updateNote(db: PostgresJsDatabase, bookingId: string, noteId: string, userId: string, data: UpdateBookingNoteInput): Promise<{ id: string; bookingId: string; authorId: string; content: string; createdAt: Date; } | null>; deleteNote(db: PostgresJsDatabase, bookingId: string, noteId: string, userId: string): Promise<{ id: string; authorId: string; } | null>; listDocuments(db: PostgresJsDatabase, bookingId: string): Omit; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; type: import("drizzle-orm/pg-core").PgColumn<{ name: "type"; tableName: "booking_documents"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "visa" | "insurance" | "health" | "passport_copy"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["visa", "insurance", "health", "passport_copy", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fileName: import("drizzle-orm/pg-core").PgColumn<{ name: "file_name"; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fileUrl: import("drizzle-orm/pg-core").PgColumn<{ name: "file_url"; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; expiresAt: import("drizzle-orm/pg-core").PgColumn<{ name: "expires_at"; tableName: "booking_documents"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_documents"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }, "single", Record<"booking_documents", "not-null">, false, "where" | "orderBy", { id: string; bookingId: string; travelerId: string | null; type: "other" | "visa" | "insurance" | "health" | "passport_copy"; fileName: string; fileUrl: string; expiresAt: Date | null; notes: string | null; createdAt: Date; }[], { id: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: true; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; bookingId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; travelerId: import("drizzle-orm/pg-core").PgColumn<{ name: string; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; type: import("drizzle-orm/pg-core").PgColumn<{ name: "type"; tableName: "booking_documents"; dataType: "string"; columnType: "PgEnumColumn"; data: "other" | "visa" | "insurance" | "health" | "passport_copy"; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: ["visa", "insurance", "health", "passport_copy", "other"]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fileName: import("drizzle-orm/pg-core").PgColumn<{ name: "file_name"; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; fileUrl: import("drizzle-orm/pg-core").PgColumn<{ name: "file_url"; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; expiresAt: import("drizzle-orm/pg-core").PgColumn<{ name: "expires_at"; tableName: "booking_documents"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; notes: import("drizzle-orm/pg-core").PgColumn<{ name: "notes"; tableName: "booking_documents"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; createdAt: import("drizzle-orm/pg-core").PgColumn<{ name: "created_at"; tableName: "booking_documents"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }>, "where" | "orderBy">; createDocument(db: PostgresJsDatabase, bookingId: string, data: CreateBookingDocumentInput): Promise<{ id: string; createdAt: Date; bookingId: string; notes: string | null; travelerId: string | null; type: "other" | "visa" | "insurance" | "health" | "passport_copy"; fileName: string; fileUrl: string; expiresAt: Date | null; } | null | undefined>; deleteDocument(db: PostgresJsDatabase, documentId: string): Promise<{ id: string; bookingId: string; } | null>; }; export { bookingsService }; /** * Command-only booking-domain settlement. The runtime lease is minted by the * action-ledger created-target state machine and is bound to this exact * transaction, so callers cannot invoke the mutation outside the admitted * Finance command. */ export declare function settleBookingCreateDomain(lease: CreatedTargetMutationLease, tx: PostgresJsDatabase, commandIdempotencyKey: string, data: ConvertProductInput, userId?: string, options?: { availabilityHoldToken?: string; monthlyBookingLimit?: number | null; /** * The action identity the caller is executing under, which must match the * one the ledger minted the lease with. * * Supplied by the caller rather than hardcoded here because `bookings` * cannot import Finance's action constants — Finance depends on Bookings, * not the reverse. A literal pinned to one entrypoint silently rejected the * second: `book_product` (voyant#3933) minted its lease under * `action.book-product` and failed closed on every call (voyant#3992). * Defaults to the original create action so existing callers are unchanged. */ actionName?: string; actionVersion?: string; }): Promise<{ id: string; status: "draft" | "confirmed" | "cancelled" | "on_hold" | "awaiting_payment" | "in_progress" | "completed" | "expired"; organizationId: string | null; createdAt: Date; sellCurrency: string; updatedAt: Date; bookingNumber: string; revision: number; personId: string | null; sourceType: "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner" | "internal"; externalBookingRef: string | null; communicationLanguage: string | null; contactFirstName: string | null; contactLastName: string | null; contactPartyType: string | null; contactTaxId: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; contactCountry: string | null; contactRegion: string | null; contactCity: string | null; contactAddressLine1: string | null; contactAddressLine2: string | null; contactPostalCode: string | null; baseCurrency: string | null; fxRateSetId: string | null; sellAmountCents: number | null; baseSellAmountCents: number | null; costAmountCents: number | null; baseCostAmountCents: number | null; marginPercent: number | null; startDate: string | null; endDate: string | null; pax: number | null; internalNotes: string | null; notificationsSuppressed: boolean; customerPaymentPolicy: unknown; priceOverride: import("./schema-core.js").BookingPriceOverride | null; customFields: NamespacedCustomFieldValues; holdExpiresAt: Date | null; acceptedAt: Date | null; confirmedAt: Date | null; expiredAt: Date | null; cancelledAt: Date | null; completedAt: Date | null; awaitingPaymentAt: Date | null; paidAt: Date | null; redeemedAt: Date | null; } | null>;