Skip to main content

Interface: OutstandingInvoice

Defined in: src/lib/reconcile/index.ts:15

Pure check-to-invoice reconciliation (no I/O).

Allocates a received check across a facility's outstanding invoices in the given order (the caller passes them oldest-first), fully paying each until the check is exhausted; the final touched invoice may be partial. Corrections over the spec's matcher (build plan §3):

  • An invoice is fullyPaid iff the amount applied equals ITS outstanding balance — so a check that fully pays invoice #1 and partially pays #2 marks #1 paid and #2 partial (the spec's "applications.length === 1" heuristic got this wrong).
  • All math is in integer cents (no remaining > 0.01 float compares).
  • An empty invoice list is handled (whole check is leftover/credit). Reconciliation only SUGGESTS; an admin confirms before anything is applied.

Extended by

Properties

invoiceId

readonly invoiceId: string

Defined in: src/lib/reconcile/index.ts:16


outstandingCents

readonly outstandingCents: number

Defined in: src/lib/reconcile/index.ts:18

Remaining balance (invoice total − amount already paid), in cents; values ≤ 0 are skipped.