Snapshot payroll row date in payroll history
Objective
- Preserve the original inspection date shown on a payroll history row so historical payroll remains trustworthy for audit and review.
- Prevent a valid payroll from appearing out of range after an inspection is rescheduled.
Background
- A payroll history report for the date range 5/11/2026–5/24/2026 showed an inspection at 159 Tyvola Dr with a displayed inspection date of 5/29/2026.
- That inspection was later confirmed to have been rescheduled on 5/27 from 5/24 to 5/29.
- This makes the historical payroll look incorrect even if the inspection was within range when payroll was originally saved.
- The current behavior suggests payroll history is displaying the inspection's current scheduled date rather than the date associated with the payroll at publish time.
Scope
Backend
- Payroll history filtering in
src/routes/payrollData.tsis based on the payroll record's stored pay-period header fields, not each line item's inspection date. - Payroll line items are created in
src/util/functions/payroll/savePayrollHistoryPublished.ts. - Payroll history enrichment in
src/util/functions/payroll/enrichPayrollHistoryLineItems.tsreads live inspection data and can overwrite the displayed inspection datetime for historical rows. - The requirement is that payroll history preserve the original inspection date that should be shown for the saved payroll row, rather than drifting when the inspection is rescheduled later.
- Decision needed: whether the saved payroll row should render entirely from snapshotted values or use live inspection data with a payroll-time fallback for display fields.
References
- Repro example: payroll history for 5/11/2026–5/24/2026 showing 159 Tyvola Dr with a displayed date of 5/29/2026 after a reschedule from 5/24/2026 on 5/27/2026.
- Key backend entry points:
src/routes/payrollData.ts,src/util/functions/payroll/savePayrollHistoryPublished.ts,src/util/functions/payroll/enrichPayrollHistoryLineItems.ts
Status: Planned
Log in to comment and vote
No comments yet
Be the first to share your thoughts.