import type { bookingPaymentSchedules } from "@voyant-travel/finance/schema"; import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import type { SQLWrapper } from "drizzle-orm/sql"; import type { z } from "zod"; import type { notificationReminderRules } from "./schema.js"; import type { NotificationAttachment, NotificationChannel, NotificationProvider } from "./types.js"; import type { bookingDocumentBundleItemSchema, insertNotificationReminderRuleSchema, insertNotificationTemplateSchema, notificationDeliveryListQuerySchema, notificationReminderRuleListQuerySchema, notificationReminderRunListQuerySchema, notificationReminderRunRecordSchema, notificationTemplateListQuerySchema, previewNotificationTemplateSchema, runDueRemindersSchema, updateNotificationReminderRuleSchema, updateNotificationTemplateSchema } from "./validation.js"; export type NotificationTemplateListQuery = z.infer; export type NotificationDeliveryListQuery = z.infer; export type CreateNotificationTemplateInput = z.infer; export type UpdateNotificationTemplateInput = z.infer; export type NotificationReminderRuleListQuery = z.infer; export type NotificationReminderRunListQuery = z.infer; export type NotificationReminderRunRecord = z.infer; export type CreateNotificationReminderRuleInput = z.infer; export type UpdateNotificationReminderRuleInput = z.infer; export type RunDueRemindersInput = z.infer; export type PreviewNotificationTemplateInput = z.infer; export interface SendPaymentSessionNotificationInput { idempotencyKey: string; templateId?: string | null; templateSlug?: string | null; scheduledFor?: string | null; } export type SendInvoiceNotificationInput = SendPaymentSessionNotificationInput; export interface SendBookingDocumentsNotificationInput { idempotencyKey: string; templateId?: string | null; templateSlug?: string | null; scheduledFor?: string | null; documentTypes?: Array["documentType"]> | null; } export type BookingDocumentBundleItem = z.infer; export type ReminderSweepResult = { processed: number; sent: number; skipped: number; failed: number; }; export type ReminderQueueResult = { processed: number; queued: number; skipped: number; failed: number; }; export type NotificationReminderRuleRow = typeof notificationReminderRules.$inferSelect; export type BookingPaymentScheduleRow = typeof bookingPaymentSchedules.$inferSelect; export declare class NotificationError extends Error { constructor(message: string); } export declare class NotificationIdempotencyConflictError extends NotificationError { constructor(); } export interface NotificationService { getProvider(channel: NotificationChannel): NotificationProvider | undefined; getProviderByName(providerName: string): NotificationProvider | undefined; } export declare function createNotificationService(providers: ReadonlyArray): NotificationService; export declare function resolveDeliverySender(input: { channel: string; provider: NotificationProvider; inputFrom?: string | null; templateFrom?: string | null; }): string | null; export declare function summarizeNotificationAttachments(attachments: ReadonlyArray | null | undefined): { filename: string; path: string | null; contentType: string | null; disposition: "attachment" | "inline" | null; contentId: string | null; }[]; export declare function renderNotificationTemplate(template: string | null | undefined, data: Record): string | null; export declare function previewNotificationTemplate(input: PreviewNotificationTemplateInput): { channel: "email" | "sms"; provider: string | null; fromAddress: string | null; subject: string | null; html: string | null; text: string | null; }; export declare function toTimestamp(value?: string | Date | null): Date | null; export declare function startOfUtcDay(value: Date): Date; export declare function addUtcDays(value: Date, days: number): Date; export declare function toDateString(value: Date): string; export declare function buildReminderDedupeKey(ruleId: string, targetId: string, runDate: string): string; export declare function resolveReminderRecipient(booking: { contactFirstName: string | null; contactLastName: string | null; contactEmail: string | null; contactPhone: string | null; contactPreferredLanguage: string | null; } | null, participants: Array<{ email: string | null; isPrimary: boolean; participantType: string; firstName: string; lastName: string; }>): { email: string | null; isPrimary: boolean; participantType: string; firstName: string; lastName: string; } | null; export declare function listBookingNotificationParticipants(db: PostgresJsDatabase, bookingId: string): Promise<{ id: string; firstName: string; lastName: string; email: string | null; participantType: "other" | "traveler" | "occupant"; isPrimary: boolean; }[]>; export declare function listBookingNotificationItems(db: PostgresJsDatabase, bookingId: string): Promise; export declare function paginate(rowsPromise: Promise, totalPromise: Promise>, limit: number, offset: number): Promise>; export declare function buildWhereClause(conditions: Array): import("drizzle-orm").SQL | undefined;