import { type allocationResources } from "@voyant-travel/availability/schema"; import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import type { z } from "zod"; import type { AllocationPaymentStatus } from "./service-allocation-manifest-queries.js"; import type { assignTravelerAllocationSchema, insertAllocationResourceSchema, pairSharingGroupSchema, updateAllocationResourceSchema, updateSharingGroupLabelSchema, updateTravelerSharingGroupSchema } from "./validation.js"; export { type AllocationAuditLogEntry, listAllocationAuditLog, recordAllocationAudit, } from "./service-allocation-audit.js"; export { AllocationServiceError } from "./service-allocation-errors.js"; export type { AllocationPaymentStatus, BookingRow } from "./service-allocation-manifest-queries.js"; export { derivePaidAmountCents, derivePaymentStatus, } from "./service-allocation-manifest-queries.js"; export type { PlannedAllocation, ResourceCapacityViolation, SlotResourceAvailability, } from "./service-allocation-resource-capacity.js"; export { getSlotResourceAvailability, getSlotsResourceAvailability, listAllocationResources, validateSlotAllocationCapacity, } from "./service-allocation-resource-capacity.js"; export { createAllocationResource, deleteAllocationResource, updateAllocationResource, } from "./service-allocation-resource-crud.js"; export type CreateAllocationResourceInput = z.infer; export type UpdateAllocationResourceInput = z.infer; export type AssignTravelerAllocationInput = z.infer; export type UpdateTravelerSharingGroupInput = z.infer; export type PairSharingGroupInput = z.infer; export type UpdateSharingGroupLabelInput = z.infer; export interface AllocationMutationOptions { actorId?: string | null; } export interface AllocationManifestTraveler { id: string; bookingId: string; bookingNumber: string; bookingStatus: string; /** * Per-slot booking ordinal (1-based) derived from each booking's * createdAt. All travelers on the same booking share the same number, * so the operator can scan the resource grid and spot at a glance * which chips belong together. */ bookingSequence: number; /** Aggregated payment status of the parent booking (see derivePaymentStatus). */ paymentStatus: AllocationPaymentStatus; firstName: string; lastName: string; fullName: string; email: string | null; phone: string | null; isLeadTraveler: boolean; isPrimary: boolean; sharingGroupId: string | null; optionId: string | null; optionUnitId: string | null; optionUnitCode: string | null; roomTypeId: string | null; bedPreference: string | null; allocations: Record; travelerCategory: string | null; participantType: string; hasAccessibilityNeeds: boolean; hasDietaryRequirements: boolean; } export interface AllocationManifestBooking { id: string; bookingNumber: string; status: string; /** Per-slot ordinal (1-based) by createdAt; same number as the travelers on this booking. */ bookingSequence: number; /** Aggregated payment status of the booking (see derivePaymentStatus). */ paymentStatus: AllocationPaymentStatus; contactFirstName: string | null; contactLastName: string | null; contactEmail: string | null; contactPhone: string | null; sellCurrency: string | null; pax: number | null; /** Total contracted sell amount on the booking (in `sellCurrency`). */ sellAmountCents: number | null; /** * Best-effort settled amount: max of `schedules_paid_cents`, * `invoice_paid_cents`, and `sellAmountCents` (when `paid_at` is set), * capped at `sellAmountCents`. Returned in `sellCurrency`. */ paidAmountCents: number | null; travelers: AllocationManifestTraveler[]; } export interface SlotAllocationManifest { slot: { id: string; productId: string | null; startsAt: string | null; endsAt: string | null; }; bookings: AllocationManifestBooking[]; resources: Array; sharingGroupLabels: Record; summary: { bookingCount: number; travelerCount: number; leadTravelerCount: number; bookingsByStatus: Record; }; } export declare function getSlotAllocationManifest(db: PostgresJsDatabase, slotId: string): Promise; export declare function assignTravelerAllocation(db: PostgresJsDatabase, slotId: string, travelerId: string, input: AssignTravelerAllocationInput, options?: AllocationMutationOptions): Promise<{ travelerId: string; kind: string; resourceId: string | null; }>; export declare function updateTravelerSharingGroup(db: PostgresJsDatabase, slotId: string, travelerId: string, input: UpdateTravelerSharingGroupInput, options?: AllocationMutationOptions): Promise<{ travelerId: string; sharingGroupId: string | null; }>; export declare function pairSharingGroup(db: PostgresJsDatabase, slotId: string, input: PairSharingGroupInput, options?: AllocationMutationOptions): Promise<{ sharingGroupId: string; travelerIds: string[]; }>; export declare function updateSharingGroupLabel(db: PostgresJsDatabase, slotId: string, groupId: string, input: UpdateSharingGroupLabelInput, options?: AllocationMutationOptions): Promise<{ createdAt: Date; updatedAt: Date; label: string; groupId: string; }>; export declare function deleteSharingGroupLabel(db: PostgresJsDatabase, slotId: string, groupId: string, options?: AllocationMutationOptions): Promise<{ createdAt: Date; updatedAt: Date; label: string; groupId: string; } | null>;