export type PaymentScheduleMode = "full" | "split"; export interface PaymentInstallment { /** Stable React key, regenerated on row add. */ id: string; /** Amount for this installment. In Full mode the field is implicit (uses the booking total). */ amountCents: number | null; dueDate: string | null; alreadyPaid: boolean; paymentDate: string | null; paymentMethod: string; paymentReference: string; } export interface PaymentScheduleValue { mode: PaymentScheduleMode; /** * Full mode keeps a single installment whose amount mirrors the * booking total at submit time. Split keeps two or more installments * the operator types amounts + due dates for. */ installments: PaymentInstallment[]; } export declare function createInstallment(overrides?: Partial): PaymentInstallment; export declare const emptyPaymentScheduleValue: PaymentScheduleValue; /** * Factory for the initial `PaymentScheduleValue` when the booking has a * known departure (slot or product start date). The single Full-mode * installment defaults to the departure day so operators don't have to * re-pick it on every fresh form, and so the dueDate field doesn't * surface today's date for a trip starting weeks/months later. * * When `departureDate` is null/undefined we fall back to `emptyPaymentScheduleValue` * which uses today. */ export declare function createPaymentScheduleValue(departureDate: string | null | undefined): PaymentScheduleValue; export interface PaymentScheduleSectionProps { value: PaymentScheduleValue; onChange: (value: PaymentScheduleValue) => void; /** * Booking total in cents. Used to drive the Full-mode amount (which * mirrors the total at submit) and to default split-mode amounts to * an even share when the operator switches modes / adds rows. */ totalAmountCents?: number; /** * ISO date of the booking's departure / service start. When provided, * split-mode installments default to dates between today and the * departure (rather than `today + 30·i`, which can land *after* * departure for short lead times). */ departureDate?: string | null; /** Used only for display formatting (e.g., "EUR"). No server-side effect. */ currency?: string; labels?: { heading?: string; modeUnpaid?: string; modeFull?: string; modeAdvance?: string; modeSplit?: string; dueDate?: string; amount?: string; firstInstallment?: string; secondInstallment?: string; preset5050?: string; unpaidHint?: string; totalDue?: string; scheduledTotal?: string; remaining?: string; alreadyPaid?: string; paymentDate?: string; paymentMethod?: string; paymentReference?: string; addInstallment?: string; removeInstallment?: string; }; } /** * Payment schedule picker for booking-create flows. The operator picks * Full (one due date for the whole amount) or Split (N installments, * default two with 50/50, but the "+" button adds as many as needed). * * Switching modes prefills sensible defaults: Full → today's due date; * Split → today + today+30 with a 50/50 amount split. Everything * remains editable so this is just a low-friction starting point. * * The section produces a controlled `PaymentScheduleValue` — actually * creating `booking_payment_schedules` rows happens in the parent at * submit time, after the booking exists (schedules have a FK to * `bookings.id`). */ export declare function PaymentScheduleSection({ value, onChange, totalAmountCents, departureDate, currency, labels, }: PaymentScheduleSectionProps): import("react").JSX.Element;