import { type PaymentMethod, type PaymentStatus } from "@voyant-travel/finance-react"; import * as React from "react"; export interface BookingPaymentSummaryPaymentRow { id: string; source: "payment"; invoiceId: string; invoiceNumber: string; invoiceType?: "invoice" | "proforma" | "credit_note"; amountCents: number; currency: string; /** When the customer paid in a different currency than the invoice. */ baseCurrency?: string | null; baseAmountCents?: number | null; status: PaymentStatus; paymentMethod: PaymentMethod; paymentDate: string; referenceNumber: string | null; notes: string | null; } export interface BookingPaymentSummaryTravelCreditRedemptionRow extends Omit { source: "travel_credit_redemption"; invoiceId: null; invoiceNumber: null; invoiceType: null; } export type BookingPaymentsSummaryRow = BookingPaymentSummaryPaymentRow | BookingPaymentSummaryTravelCreditRedemptionRow; export interface BookingPaymentsSummaryProps { bookingId: string; /** * Which API surface to fetch from. The customer-portal uses * `"public"` (default — hits `/v1/public/finance/bookings/:id/payments`). * The operator dashboard must pass `"admin"` because the * `/v1/public/*` middleware enforces a non-staff actor guard, so * staff sessions get blocked from the public endpoint. */ variant?: "admin" | "public"; /** * Open the linked invoice in-place (typically a Sheet that renders * the invoice detail page). When omitted, the invoice number cell * renders as plain text. */ onInvoiceOpen?: (invoiceId: string, row: BookingPaymentsSummaryRow) => void; /** * Optional invoice href for hosts that navigate with route links * instead of an in-place invoice panel. */ getInvoiceHref?: (row: BookingPaymentsSummaryRow) => string; /** * Optional handler for the "View" action in the row menu. Consumers * typically call their router's navigate(). Middle-click isn't useful * on menu items, so this is a click handler rather than an href. */ onViewPayment?: (row: BookingPaymentsSummaryRow) => void; /** Convert a proforma invoice attached to the payment into a final invoice. */ onConvertProforma?: (row: BookingPaymentsSummaryRow) => Promise | unknown; /** Edit handler — typically opens a dialog pre-filled with the row. */ onEditPayment?: (row: BookingPaymentsSummaryRow) => void; /** * Delete handler. Must resolve when the deletion is complete (the * card closes the confirm dialog on resolve). Throw or reject to * keep the dialog open with an error. */ onDeletePayment?: (row: BookingPaymentsSummaryRow) => Promise | void; /** * Extra content rendered on the right of the card header (e.g. a * `Record payment` button). Keeps section-level actions co-located * with the section instead of floating at the top of the tab. */ headerAction?: React.ReactNode; } /** * Payment-centric view of the money movements recorded against a * booking's invoices. Sister card to `BookingInvoicesCard` (operator * template) which is invoice-centric — payments and invoices are * different concepts, so each gets its own table with its own lead * column. * * Column order here is operator-tested: * 1. **Suma** — what came in. Largest, bold, currency-formatted. * 2. **Metoda** — how (icon + label). * 3. **Status** — completed/pending/failed/refunded badge. * 4. **Data** — when. * 5. **Referinta** — provider tx id, capture id, etc. * 6. **Pentru** — which invoice this paid (secondary; shown last). * * The invoice number deliberately appears last as a "for" link, not * first as the primary identifier — that's the difference between * "list of payments" and "list of invoice line-items". */ export declare function BookingPaymentsSummary({ bookingId, variant, onInvoiceOpen, getInvoiceHref, onViewPayment, onConvertProforma, onEditPayment, onDeletePayment, headerAction, }: BookingPaymentsSummaryProps): React.JSX.Element;