Skip to main content

Type Alias: StatementOutcome

StatementOutcome = { kind: "empty"; } | { kind: "no_recipient"; } | { error: string; kind: "error"; } | { 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[]; }

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​

readonly attachedNumbers: readonly string[]

balanceLabel​

readonly balanceLabel: string

Pre-formatted before the send: a formatting throw must never fire after the email is out.

kind​

readonly kind: "delivered"

lineCount​

readonly lineCount: number

missingPdfNumbers​

readonly missingPdfNumbers: readonly string[]

Selected invoices with no stored PDF — named so the operator can regenerate them.

notOnStatementNumbers​

readonly notOnStatementNumbers: readonly string[]

Selected invoices that are not lines on this statement (draft, void, paid, since-deleted).

pdfErrorNumbers​

readonly pdfErrorNumbers: readonly string[]

Selected invoices whose stored PDF would not download — a retry, not a regenerate.

recipients​

readonly recipients: readonly string[]

skipReason?​

readonly optional skipReason?: "unconfigured" | "disabled"

status​

readonly status: "sent" | "skipped" | "failed"

Provider outcome. Only 'sent' means the AP desk actually received it.

trimmedNumbers​

readonly trimmedNumbers: readonly string[]

Selected invoices dropped to stay under MAX_ATTACHMENT_BASE64_BYTES.