Skip to main content

Function: pickLatestPerContractor()

pickLatestPerContractor<T>(rows): T[]

Defined in: src/lib/invoice/assignments.ts:37

Latest overlapping assignment per contractor: newest effective_date, preferring the primary on a tie, then lowest id — a strict total order, so the result is input-order independent. Consistent with payroll's pickAssignmentsPerContractor and the weekly_billing_run SQL, so every surface bills the same assignment for a contractor.

Type Parameters​

T​

T extends AssignmentPickRow

Parameters​

rows​

readonly T[]

Returns​

T[]