import { Amount } from '../../../commonStateTypes/amount'; import { FetchedState, ID } from '../../../commonStateTypes/common'; /** * Draft form state for the Record Payment form. Held in CES so the form flows * its data from here (mirrors the customer form pattern). Record payment is * create-only, so there is a single draft (no per-id edit tree). The date is an * ISO `YYYY-MM-DD` string; the amount as an `Amount` (as on the invoice entity). */ export interface RecordPaymentFormLocalData { comment: string; customerId: string; date: string; gateway: string; invoiceToLink: string; paymentMethod: string; referenceNumber: string; transactionId: string; /** Unset until entered, so a blank field is distinguishable from a real 0. */ amount?: Amount; } export interface RecordPaymentState extends FetchedState { newPaymentDraft: RecordPaymentFormLocalData; /** Set when the form is opened from an invoice (invoice-level record payment). */ contextInvoiceId?: ID; recordedInvoiceId?: ID; recordedTransactionId?: ID; }