Type Alias: StatementOutcome
StatementOutcome = {
kind:"empty"; } | {kind:"no_recipient"; } | {error:string;kind:"error"; } | {attachedNumbers: readonlystring[];balanceLabel:string;kind:"delivered";lineCount:number;missingPdfNumbers: readonlystring[];notOnStatementNumbers: readonlystring[];pdfErrorNumbers: readonlystring[];recipients: readonlystring[];skipReason?:"unconfigured"|"disabled";status:"sent"|"skipped"|"failed";trimmedNumbers: readonlystring[]; }
Defined in: src/server/services/ar/statement.ts:42
Union Members
Type Literal
{ kind: "empty"; }
Nothing is owed — there is no statement to send.
Type Literal
{ kind: "no_recipient"; }
No active billing/admin contact with an email; the facility record needs one first.
Type Literal
{ error: string; kind: "error"; }
Type Literal
{ attachedNumbers: readonly string[]; balanceLabel: string; kind: "delivered"; lineCount: number; missingPdfNumbers: readonly string[]; notOnStatementNumbers: readonly string[]; pdfErrorNumbers: readonly string[]; recipients: readonly string[]; skipReason?: "unconfigured" | "disabled"; status: "sent" | "skipped" | "failed"; trimmedNumbers: readonly string[]; }
attachedNumbers
readonlyattachedNumbers: readonlystring[]
balanceLabel
readonlybalanceLabel:string
Pre-formatted before the send: a formatting throw must never fire after the email is out.
kind
readonlykind:"delivered"
lineCount
readonlylineCount:number
missingPdfNumbers
readonlymissingPdfNumbers: readonlystring[]
Selected invoices with no stored PDF — named so the operator can regenerate them.
notOnStatementNumbers
readonlynotOnStatementNumbers: readonlystring[]
Selected invoices that are not lines on this statement (draft, void, paid, since-deleted).
pdfErrorNumbers
readonlypdfErrorNumbers: readonlystring[]
Selected invoices whose stored PDF would not download — a retry, not a regenerate.
recipients
readonlyrecipients: readonlystring[]
skipReason?
readonlyoptionalskipReason?:"unconfigured"|"disabled"
status
readonlystatus:"sent"|"skipped"|"failed"
Provider outcome. Only 'sent' means the AP desk actually received it.
trimmedNumbers
readonlytrimmedNumbers: readonlystring[]
Selected invoices dropped to stay under MAX_ATTACHMENT_BASE64_BYTES.