Skip to main content

Interface: InvoicePreviewLine

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

One service line of an InvoicePreview (mirrors a prospective invoice_line_items row), one per contractor (its latest/chosen assignment). Money is integer USD cents; hours are decimal.

Billing rule: billedHours = min(actualHours, contractedHours) and amountCents = round(billedHours × hourlyRateCents). If the line's overage was approved for this week, the cap is lifted and the full actualHours is billed instead (and varianceFlagged is suppressed).

Properties

actualHours

readonly actualHours: number

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

Hours actually worked this week, summed from payable time entries (rounded to 2 dp).


amountCents

readonly amountCents: number

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

Line total in integer USD cents (round(billedHours × hourlyRateCents)).


assignmentId

readonly assignmentId: string

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


billedHours

readonly billedHours: number

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

The quantity actually billed = min(actual, contracted), or full actual when overage is approved.


contractedHours

readonly contractedHours: number

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

Weekly contracted hours from the assignment (the default billing cap).


contractorId

readonly contractorId: string

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


contractorName

readonly contractorName: string

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


description

readonly description: string

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

Human-readable line label (service type + contractor + period), as printed on the PDF.


hourlyRateCents

readonly hourlyRateCents: number

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


serviceType

readonly serviceType: string | null

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


varianceFlagged

readonly varianceFlagged: boolean

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

True when variancePct exceeds the facility threshold and overage was NOT approved — a review signal, not a block.


variancePct

readonly variancePct: number

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

Percent by which actual hours differ from contracted (used to drive varianceFlagged).