import { InvoicingNamedOption, RecordPaymentFormLocalData } from '@zeniai/client-epic-state'; /** * Web-components glue for the Record Payment form. CES owns the draft `LocalData` * and the payment-method / gateway value sets; this module maps those (plus the * connector-supplied customer list) to the form's UI value shapes and back. */ export interface InvoicingRecordPaymentCustomerOption { id: string; name: string; } export interface InvoicingRecordPaymentInvoiceOption { amountDue: string; amountDueValue: number; id: string; label: string; } export interface PickerValue { allOptions: { label: string; value: string; }[]; selectedOption?: string; } /** * Form-values shape reuses the CES localData field names verbatim — only the * fields whose *shape* differs on the form (customer/gateway/payment-method * pickers, the date picker) are overridden. Every plain field (amount, comment, * referenceNumber, transactionId) flows through by identity. */ export type RecordPaymentFormValues = Omit & { /** Held as a float by `returnValueType: "floatValue"`; `null` when cleared. */ amount: number | null; customerId: PickerValue; date: Date | undefined; gateway: PickerValue; invoiceToLink: PickerValue; paymentMethod: PickerValue; }; export interface RecordPaymentFormOptions { customers: InvoicingRecordPaymentCustomerOption[]; gatewayOptions: InvoicingNamedOption[]; paymentMethodOptions: InvoicingNamedOption[]; invoiceOptions?: InvoicingRecordPaymentInvoiceOption[]; } export declare const buildInvoiceOptions: (invoiceOptions: InvoicingRecordPaymentInvoiceOption[]) => { label: string; value: string; }[]; export declare const localDataToRecordPaymentFormValues: (localData: RecordPaymentFormLocalData, options: RecordPaymentFormOptions) => RecordPaymentFormValues; export declare const recordPaymentFormValuesToLocalData: (values: RecordPaymentFormValues) => RecordPaymentFormLocalData; export declare const getSelectedInvoiceAmountDue: (invoiceOptions: InvoicingRecordPaymentInvoiceOption[], invoiceId: string | undefined) => number | undefined;