import { availabilitySlots } from "@voyant-travel/availability/schema"; import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; type SlotStatus = (typeof availabilitySlots.$inferSelect)["status"]; export interface AvailabilityAggregates { /** Total slots in the (optional) `startsAt` range. */ total: number; countsByStatus: Array<{ status: SlotStatus; count: number; }>; /** * Open slots from `now` forward, irrespective of the `from..to` range. * Point-in-time KPI — operator's "how many departures are still sellable". */ upcomingSlots: number; /** * Sum of `remaining_pax` across the same `upcomingSlots` set, excluding * slots flagged `unlimited` (they'd inflate the number to meaningless * without a reasonable cap). */ upcomingPax: number; /** * Departure count bucketed by `starts_at` UTC yearMonth (within the range * when set). Counts every non-cancelled slot so inventory that went * sold-out still appears on the calendar. */ monthlyDepartures: Array<{ yearMonth: string; count: number; }>; } export declare function getAvailabilityAggregates(db: PostgresJsDatabase, options?: { from?: string; to?: string; }): Promise; export {};