Skip to content

fix: preserve carry-over balances when adding employees to policy#1907

Draft
krisxcrash wants to merge 1 commit into
mainfrom
kw/timeoff-preserve-carry-over-balance
Draft

fix: preserve carry-over balances when adding employees to policy#1907
krisxcrash wants to merge 1 commit into
mainfrom
kw/timeoff-preserve-carry-over-balance

Conversation

@krisxcrash
Copy link
Copy Markdown
Contributor

Summary

  • Exposes eligibleEmployees (the full unfiltered list) from useSelectEmployeesData.
  • Computes carry-over balances from all eligible employees instead of only the currently filtered/paginated page.
  • Ensures balances persist when users search or navigate pages.

Fixes bug: time off starting balances are zeroed out when employees paginate out of view.

Test plan

  • All SelectEmployees tests pass (79/79)
  • Manually verify: select employees on page 1 → navigate to page 2 → return to page 1 → balances preserved
  • Manually verify: add employee with existing balance → balance shown in input, not zeroed

Carry-over balances were computed from the currently visible/filtered
page only. When employees paginated out of view, their balances were
lost from the display. Now computes carry-over from all eligible
employees so balances persist across search and pagination.
@krisxcrash krisxcrash self-assigned this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant