fix: prepare transition payrolls without an employee roster - #2850
Draft
serikjensen wants to merge 2 commits into
Draft
serikjensen wants to merge 2 commits into
serikjensen wants to merge 2 commits into
Conversation
A transition payroll's roster is fixed by the pay-schedule transition, so the API rejects any employee_uuids sent to prepare. Detect the transition type from the payroll and omit the roster in that case, on both the payroll configuration screen and the edit-employee screens. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
When you open a transition payroll, the list of employees showed up empty. You could not see or edit anyone.
Why it happened
To load a payroll, the app calls a step called prepare. For a normal payroll, the app tells prepare which employees to include by sending a list of employee IDs.
A transition payroll is different. Its list of employees is set by the pay schedule change itself. You are not allowed to choose who is on it. So when the app sent a list of IDs, the server rejected the whole call:
Because prepare failed, no employees came back and the screen was empty.
What changed
The app now checks the payroll's type first. If it is a transition payroll, it calls prepare without a list of employee IDs, so the server returns the full roster it already decided on.
This happens in two places:
PayrollConfiguration).PayrollEditEmployee, and the shared form hook it uses).Normal (non-transition) payrolls are unchanged. They still send their list of IDs exactly as before.
On the single-employee edit screen, the app used to grab the first person in the returned list. Since a transition payroll returns everyone, it now picks the person you actually clicked by matching their ID. This is safe for normal payrolls too.
How the type is detected
The payroll is read directly (not guessed), and its type is derived from that. This is deterministic, not based on catching an error.
Outstanding work
Breadcrumb missing on transition edit-employee screen. The "Edit {employee name}" breadcrumb does not appear when editing an employee on a transition payroll.
Overtime workweek breakdown collapses after calculating. Steps to reproduce on a transition payroll with more than one workweek:
The separate workweek values appear to be merged into a single total when you return to editing. Needs investigation.
See
TRANSITION_PAYROLL_TASKS.mdfor the open question about whether the manual "create transition payroll" screen is still needed.Note on CI
The repo build is currently red because of the in-progress API version upgrade (unrelated
payPeriodnullable type changes across many payroll files). Those failures are not from this change.🤖 Generated with Claude Code