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
readonlyactualHours: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
readonlyamountCents:number
Defined in: src/server/services/invoice/generate.ts:81
Line total in integer USD cents (round(billedHours × hourlyRateCents)).
assignmentId
readonlyassignmentId:string
Defined in: src/server/services/invoice/generate.ts:68
billedHours
readonlybilledHours: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
readonlycontractedHours:number
Defined in: src/server/services/invoice/generate.ts:74
Weekly contracted hours from the assignment (the default billing cap).
contractorId
readonlycontractorId:string
Defined in: src/server/services/invoice/generate.ts:67
contractorName
readonlycontractorName:string
Defined in: src/server/services/invoice/generate.ts:69
description
readonlydescription:string
Defined in: src/server/services/invoice/generate.ts:72
Human-readable line label (service type + contractor + period), as printed on the PDF.
hourlyRateCents
readonlyhourlyRateCents:number
Defined in: src/server/services/invoice/generate.ts:79
serviceType
readonlyserviceType:string|null
Defined in: src/server/services/invoice/generate.ts:70
varianceFlagged
readonlyvarianceFlagged: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
readonlyvariancePct:number
Defined in: src/server/services/invoice/generate.ts:83
Percent by which actual hours differ from contracted (used to drive varianceFlagged).