Skip to content

feat: fetch and display holiday pay policy in PolicyList#1522

Merged
krisxcrash merged 7 commits intomainfrom
kw/feat/get-holidays-policy-list
Apr 13, 2026
Merged

feat: fetch and display holiday pay policy in PolicyList#1522
krisxcrash merged 7 commits intomainfrom
kw/feat/get-holidays-policy-list

Conversation

@krisxcrash
Copy link
Copy Markdown
Contributor

Summary

  • Adds a GET /v1/companies/{company_uuid}/holiday_pay_policy call in the PolicyList component to fetch and display the company's holiday pay policy alongside regular time off policies
  • Gracefully handles 204 (no policy exists) and 404 responses without surfacing errors — if no holiday policy exists, it simply isn't shown
  • Wires up holiday-specific delete flow using useHolidayPayPoliciesDeleteMutation with a dedicated confirmation dialog

Test plan

  • Holiday policy appears in the list when the API returns one (200)
  • Holiday policy is not shown when the API returns 204 (no policy)
  • No error when the API returns 404
  • Enrolled count displays correctly for holiday policy employees
  • Clicking Edit on the holiday row emits TIME_OFF_VIEW_POLICY with policyType: 'holiday'
  • Deleting a holiday policy shows holiday-specific dialog text and calls the correct DELETE endpoint
  • Existing time off policy tests continue to pass (21/21 passing)
  • npm run format:check passes

@krisxcrash krisxcrash self-assigned this Apr 9, 2026
Base automatically changed from kw/chore/upgrade-api-client to main April 10, 2026 17:12
Include the company's holiday pay policy in the TimeOff PolicyList
by calling GET /v1/companies/{company_uuid}/holiday_pay_policy.
Gracefully handles 204 (no policy) and 404 responses without error.
Adds holiday-specific delete flow and confirmation dialog.
@krisxcrash krisxcrash force-pushed the kw/feat/get-holidays-policy-list branch from e50b581 to 1ebf081 Compare April 10, 2026 17:28
})
const timeOffPolicies = policiesData.timeOffPolicies ?? []

const { data: holidayData } = useHolidayPayPoliciesGet(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably need to deal with errors here as well - dashboard hooks use buildQueryErrorHandling utility for this. also, do we need to worry about isLoading?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a great callout!

Comment thread src/components/UNSTABLE_TimeOff/PolicyList/PolicyList.tsx Outdated
@krisxcrash krisxcrash enabled auto-merge (squash) April 13, 2026 21:26
@krisxcrash krisxcrash merged commit 55be239 into main Apr 13, 2026
13 of 14 checks passed
@krisxcrash krisxcrash deleted the kw/feat/get-holidays-policy-list branch April 13, 2026 21:28
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.

3 participants