Skip to content

feat: add PolicyConfigurationForm functional component#1510

Open
krisxcrash wants to merge 1 commit intomainfrom
kw/feat/add-policy-configuration-form
Open

feat: add PolicyConfigurationForm functional component#1510
krisxcrash wants to merge 1 commit intomainfrom
kw/feat/add-policy-configuration-form

Conversation

@krisxcrash
Copy link
Copy Markdown
Contributor

@krisxcrash krisxcrash commented Apr 8, 2026

Summary

  • Add PolicyConfigurationForm functional component that wraps PolicyConfigurationFormPresentation with the BaseComponent/useBase() pattern
  • Integrates with useTimeOffPoliciesCreateMutation to create time-off policies via the embedded API
  • Maps 3 form-level accrual methods (hourly, fixed, unlimited) to all 8 API accrual method variants, per Gusto accrual methods docs
  • Converts numeric fields to API string format and formats policyResetDate as MM-DD
  • Emits TIME_OFF_POLICY_DETAILS_DONE with { policyId } on success, CANCEL on back
  • Exports the component and props type from the barrel index.ts

Accrual Method Mapping

Form selection API accrual_method
Unlimited unlimited
Hourly (default checkboxes) per_hour_worked_no_overtime
Hourly + include overtime per_hour_worked
Hourly + all paid hours per_hour_paid_no_overtime
Hourly + both checked per_hour_paid
Fixed + each pay period per_pay_period
Fixed + all at once + calendar year per_calendar_year
Fixed + all at once + anniversary per_anniversary_year

Test plan

  • Verify TypeScript compiles cleanly (npx tsc --noEmit)
  • Verify existing presentation tests still pass
  • Verify component renders in Storybook (no functional changes to presentation)
  • Review accrual method mapping logic against API docs

@krisxcrash krisxcrash force-pushed the kw/feat/policy-configuration-form-tests branch from 77d98df to 50c322c Compare April 8, 2026 22:35
Base automatically changed from kw/feat/policy-configuration-form-tests to main April 8, 2026 23:00
…ration

Wire PolicyConfigurationFormPresentation to the embedded API via
useTimeOffPoliciesCreateMutation. Maps form-level accrual method
selections (hourly/fixed/unlimited) to the 8 API accrual method
variants, converts numeric fields to strings, and formats
policy reset dates (MM-DD). Emits TIME_OFF_POLICY_DETAILS_DONE
on success and CANCEL on back.
@krisxcrash krisxcrash force-pushed the kw/feat/add-policy-configuration-form branch from 37e1142 to 0aed58f Compare April 8, 2026 23:25
@krisxcrash krisxcrash self-assigned this Apr 8, 2026
@krisxcrash krisxcrash marked this pull request as ready for review April 8, 2026 23:26
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