Skip to main content

Function: pickAssignmentPerContractor()

pickAssignmentPerContractor(rows): Map<string, PayAssignmentRow>

Defined in: src/lib/payroll/index.ts:117

Choose one assignment per contractor for a period: the version with the latest effective_date, preferring is_primary on a tie, and finally the lowest id so the choice is FULLY deterministic — preview and close (separate queries) must pick the same assignment and thus the same rate. The pay engine assumes a single rate per period (mid-period rate change is a documented limitation).

Parameters

rows

readonly PayAssignmentRow[]

Returns

Map<string, PayAssignmentRow>