/** * Service layer over `booking_drafts` โ€” CRUD + lifecycle helpers * the route layer composes. Per booking-journey-architecture ยง5.7. */ import type { AnyDrizzleDb } from "@voyantjs/db"; import { type SelectBookingDraft } from "./drafts-schema.js"; export declare const DEFAULT_DRAFT_TTL_MS: number; export interface UpsertDraftInput { /** Draft id โ€” when omitted, a fresh id is generated. */ id?: string; entityModule: string; entityId: string; sourceKind: string; sourceConnectionId?: string; sourceRef?: string; draftPayload: Record; currentStep?: string; currentQuoteId?: string; holdExpiresAt?: Date | null; createdBy?: string | null; ttlMs?: number; } export declare function createBookingDraft(db: AnyDrizzleDb, input: UpsertDraftInput): Promise; export declare function getBookingDraft(db: AnyDrizzleDb, id: string): Promise; export interface UpdateDraftPatch { draftPayload?: Record; currentStep?: string; currentQuoteId?: string | null; holdExpiresAt?: Date | null; refreshTtlMs?: number; } export declare function updateBookingDraft(db: AnyDrizzleDb, id: string, patch: UpdateDraftPatch): Promise; export declare function markDraftConsumed(db: AnyDrizzleDb, id: string, bookingId: string): Promise; /** * Reaper helper โ€” returns ids of drafts that are past TTL and not * yet consumed. Operators can run this in a daily cron and release * any associated holds before deleting. */ export declare function findExpiredDrafts(db: AnyDrizzleDb, cutoff?: Date): Promise; export declare function deleteBookingDraft(db: AnyDrizzleDb, id: string): Promise; //# sourceMappingURL=drafts-service.d.ts.map