import { FetchStateAndError, ID } from '../../../commonStateTypes/common'; import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport'; import { InvoicingInvoice } from '../../../entity/invoicing/invoice/invoiceState'; import { InvoicingFieldHelpByCode, InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload'; import { RootState } from '../../../rootStateTypes'; import { IssueCreditNoteFormLocalData } from './issueCreditNoteState'; /** * Everything the issue-credit-note screen renders, in one view: the invoice being * credited, the form draft and the submit run-state. `fetchState`/`error` track * the invoice load (what gates the page); the submit action is exposed separately * as `submitState` so a save failure can't be mistaken for a load failure. */ export interface IssueCreditNoteView extends SelectorView { /** * Backend help copy for this screen's field group, keyed by field code. * Folded in here so the screen never reaches for the config view itself. */ fieldHelp: InvoicingFieldHelpByCode; /** * True once the invoice has loaded and the draft for *this* invoice has line * items to credit. */ isPageReady: boolean; localData: IssueCreditNoteFormLocalData; reasonCodeOptions: InvoicingNamedOption[]; submitState: FetchStateAndError; typeOptions: InvoicingNamedOption[]; invoice?: InvoicingInvoice; issuedCreditNoteId?: ID; } /** * The draft is a single global slice, so a draft seeded for a previously opened * invoice can still be in state when another invoice's screen mounts. Anything * that would render that stale draft next to this invoice is dropped until the * screen re-seeds it for `invoiceId`. */ export declare const getIssueCreditNoteView: (state: RootState, invoiceId: ID) => IssueCreditNoteView;