import { FetchStateAndError, ID } from '../../../commonStateTypes/common'; import { InvoicingListSort } from '../invoicingApiHelper'; export interface InvoicingTransactionFilters { customerId?: ID; search?: string; status?: string; } export declare const ALL_INVOICING_TRANSACTION_SORT_KEYS: readonly ["transaction", "customer", "method", "date", "type", "gateway", "status", "amount"]; export declare const toInvoicingTransactionSortKey: (v: string) => "type" | "date" | "status" | "amount" | "customer" | "transaction" | "method" | "gateway"; export type InvoicingTransactionSortKey = ReturnType; /** * Structural column descriptor owned by CES so the payments-list column set, * ordering and sortability live next to the `InvoicingTransaction` model rather * than being hardcoded in web-components. Header labels, cell rendering and * layout (alignment, widths) stay in the view layer; this only carries the * column set, order and sort metadata. */ export interface InvoicingTransactionColumnConfig { key: InvoicingTransactionSortKey; sortable: boolean; } export declare const INVOICING_TRANSACTION_COLUMNS: InvoicingTransactionColumnConfig[]; export declare const ALL_INVOICING_TRANSACTION_TAB_IDS: readonly ["all", "payment", "refund", "authorization", "payment_reversal", "excess_transfer"]; export declare const toInvoicingTransactionTabId: (v: string) => "payment" | "refund" | "authorization" | "payment_reversal" | "excess_transfer" | "all"; export type InvoicingTransactionTabId = ReturnType; /** * Per-tab cache slice. Each `type` tab is a separate server query (the backend * filters by `type`), so its loaded ids, pagination cursor and fetch state are * cached independently. Mirrors the `userListByType` per-key cache pattern. */ export interface InvoicingTransactionTabState extends FetchStateAndError { ids: ID[]; nextCursor: string | null; } /** * Per-tab cache. `Partial` because the tab set comes from `/1.0/config`: a type * the backend added that this build's tab-id union does not know still renders a * tab, and its entry is created on first use rather than pre-seeded. */ export type InvoicingTransactionIdsByTab = Partial>; export interface InvoicingTransactionListViewState { /** Selected type tab (CES-owned so it persists across page revisits). */ activeTab: InvoicingTransactionTabId; /** Per-tab cached ids + cursor + fetch state. */ byTab: InvoicingTransactionIdsByTab; /** Base query shared across tabs (search / customer / status). */ filters: InvoicingTransactionFilters; /** Active server-side sort (undefined = backend default order). */ sort?: InvoicingListSort; } export declare const makeInvoicingTransactionTabState: () => InvoicingTransactionTabState; /** The cache entry for a tab, created on first use. */ export declare const invoicingTransactionTabStateFor: (byTab: InvoicingTransactionIdsByTab, tabId: InvoicingTransactionTabId) => InvoicingTransactionTabState; export declare const makeInvoicingTransactionIdsByTab: () => InvoicingTransactionIdsByTab;