Skip to main content

Function: payForAssignment()

payForAssignment(inputs, period, contractorId, assignment, overrides?): AssignmentPay

Defined in: src/server/services/payInputs.ts:361

Price ONE assignment from a loaded bundle — the single assembly of the engine's inputs. Rules baked in here (shared by every caller):

  • Only PAYABLE_ENTRY_STATUSES entries feed the engine (drafts never pay).
  • Holidays belong to the contractor, not a facility — leave is credited only to an in_house_admin and only on their primary assignment, so a multi-assignment admin is never double-credited.
  • A contractor with no contractors row defaults to 'outsourced'.

Parameters​

inputs​

PayComputeInputs

period​

BiMonthlyPeriod

contractorId​

string

assignment​

PayAssignmentRow

overrides?​

PayOverrides

Returns​

AssignmentPay

Throws​

MoneyError (via centavos) if the stored bimonthly_rate_centavos is a non-integer or exceeds the safe-integer range (practically unreachable — the column is a bigint).