import { Amount } from '../../../commonStateTypes/amount'; import { FetchedState, ID } from '../../../commonStateTypes/common'; export interface CreateCreditNoteLineItemDraft { description: string; quantity: string; /** Unset until entered, so a blank field is distinguishable from a real 0. */ unitAmount?: Amount; } export interface CreateCreditNoteFormLocalData { customerId: string; lineItems: CreateCreditNoteLineItemDraft[]; reasonCode: string; referenceInvoiceId: string; /** * Credit-note type code from `credit_note_type_options`. Empty until the user * picks one; the payload then omits it and lets the backend default, rather * than the client asserting `adjustment` for every credit note as it used to. */ type: string; } export interface CreateCreditNoteState extends FetchedState { draft: CreateCreditNoteFormLocalData; createdCreditNoteId?: ID; }