Skip to main content

Interface: InvoicePreview

Defined in: src/server/services/invoice/generate.ts:96

A computed-but-unpersisted invoice for one facility and one billing week, returned by buildInvoicePreview for the review/confirm UI. All money is integer USD cents.

The billing week is Sunday-anchored: period.start is the Sunday weekStart and period.end is weekStart + 6 (inclusive), both as ISO YYYY-MM-DD strings. Each line bills the lesser of actual vs contracted hours unless that line's overage was approved (see InvoicePreviewLine).

Properties

anyVarianceFlagged

readonly anyVarianceFlagged: boolean

Defined in: src/server/services/invoice/generate.ts:105


dueDateLabel

readonly dueDateLabel: string

Defined in: src/server/services/invoice/generate.ts:102


existingInvoice

readonly existingInvoice: { number: string; status: string; } | null

Defined in: src/server/services/invoice/generate.ts:108

Set when a non-void invoice already exists for this facility+week.


facilityId

readonly facilityId: string

Defined in: src/server/services/invoice/generate.ts:97


facilityName

readonly facilityName: string

Defined in: src/server/services/invoice/generate.ts:98


issueDateLabel

readonly issueDateLabel: string

Defined in: src/server/services/invoice/generate.ts:101


lines

readonly lines: InvoicePreviewLine[]

Defined in: src/server/services/invoice/generate.ts:103


period

readonly period: object

Defined in: src/server/services/invoice/generate.ts:100

Sunday-anchored billing week as inclusive ISO YYYY-MM-DD bounds: start = Sunday, end = Sunday + 6.

end

end: string

start

start: string


thresholdPct

readonly thresholdPct: number

Defined in: src/server/services/invoice/generate.ts:106


totalCents

readonly totalCents: number

Defined in: src/server/services/invoice/generate.ts:104