Skip to main content

Type Alias: RunStatus

RunStatus = "sent" | "gap" | "review" | "none" | "ready"

Defined in: src/lib/invoice/run.ts:20

Per-facility status for one weekly billing run, derived in SQL by weekly_billing_run().

  • ready — billable, clean, and ready to invoice (in flight, not yet sent).
  • review — billable but flagged for human review: an assignment is missing a billing rate, the facility has no billing contact, or some logged hours are still unapproved; still counted toward billable-in-flight. (varianceFlagged is informational only and does NOT affect this status.)
  • gap — a coverage gap exists; not billable as-is and excluded from billable totals.
  • sent — an invoice already exists/was sent for this facility this week.
  • none — nothing to bill (no logged hours / no active assignments).

Note: counts toward RunKpis differ by status — see aggregateKpis.