Interface: CalculatePayInput
Defined in: src/lib/pay/index.ts:96
Everything calculateContractorPay needs to price one contractor for one bi-monthly period. Callers fetch time entries for the wider settling-week span (see settlingWeekRange), which may reach into the prior month for outsourced workers; in-house pay re-filters to in-period entries.
Properties
approvedOverageWeeks?
readonlyoptionalapprovedOverageWeeks?:ReadonlySet<string>
Defined in: src/lib/pay/index.ts:125
Outsourced only: ISO YYYY-MM-DD Monday week-starts whose overage has been APPROVED. A week in
this set is paid on its full worked hours (uncapped); otherwise hours over contracted are withheld
until approved. Keyed by the ISO week's Monday so it matches the settling-week boundary. The loaders
route approvals through overageApprovalWeekToPayWeek, which snaps each stored week_start forward to
its Monday (identity for new unified weeks, +1 for the legacy Sunday tail — ADR-0049).
assignmentEffectiveDate?
readonlyoptionalassignmentEffectiveDate?:CalendarDate
Defined in: src/lib/pay/index.ts:139
Outsourced only: the assignment's effective_date; refines the active-window START when an
assignment also begins mid-period (the rare start-and-end-in-one-period case).
assignmentEndDate?
readonlyoptionalassignmentEndDate?:CalendarDate
Defined in: src/lib/pay/index.ts:136
Outsourced only: the assignment's end_date. When it falls on or before the period end
(assignmentEndDate <= period.end), pay switches from whole-week settlement to day-proration of
the active window — rate × (activeDays/periodDays) × min(1, worked/FTE-for-active-days); an end
date before the period yields a zero-pay row (no active days). So the contractor's last
days are never dropped by the next run (which excludes the ended assignment) and they're paid for
the fraction of the period they were active (ADR-0044 §5). Omit/undefined for ongoing assignments.
bimonthlyRate
readonlybimonthlyRate:Centavos
Defined in: src/lib/pay/index.ts:113
The full bi-monthly (half-month) rate in integer PHP Centavos for a full-time worker. A
worker who renders their full-time expectation every settling week earns exactly this. Must be
>= 0, else validation fails with invalid_rate.
contractorType
readonlycontractorType:ContractorType
Defined in: src/lib/pay/index.ts:117
Selects the pricing model — see ContractorType.
holidaysConfig?
readonlyoptionalholidaysConfig?:HolidaysConfig
Defined in: src/lib/pay/index.ts:127
In-house only: which holidays the company observes (defaults to all standard holidays).
leaveRequests
readonlyleaveRequests: readonlyPayLeaveRequest[]
Defined in: src/lib/pay/index.ts:100
Leave requests; only approved 'holiday' PTO affects in-house pay (ignored for outsourced).
period
readonlyperiod:BiMonthlyPeriod
Defined in: src/lib/pay/index.ts:115
The bi-monthly half being paid (1st–15th or 16th–end). Defines settling weeks and proration.
timeEntries
readonlytimeEntries: readonlyPayTimeEntry[]
Defined in: src/lib/pay/index.ts:98
Logged work for the fetched span. Negative hours fail validation with invalid_hours.
weeklyContractedHours
readonlyweeklyContractedHours:number
Defined in: src/lib/pay/index.ts:107
Contracted hours per week (the per-week overage cap for outsourced). Must be > 0, else
validation fails with invalid_contracted_hours. Note pay is measured against the full-time
FULL_TIME_WEEKLY_HOURS denominator, NOT this value — a part-timer (e.g. 30h) caps their
paid hours here but still earns the worked fraction of 40h.