@gusto/embedded-react-sdk 0.44.2 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js +7 -7
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +24 -23
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +16 -14
- package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +8 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +38 -38
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +12 -9
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +25 -25
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +11 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Head.js +44 -39
- package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +26 -26
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -9
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Head.js +7 -6
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/Industry/Head.js +10 -9
- package/dist/components/Company/Industry/Head.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +22 -19
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Head.js +9 -8
- package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Head.js +11 -10
- package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -11
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +18 -18
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +7 -7
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Employee/Compensation/index.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +230 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/{Compensation.d.ts → onboarding/Compensation.d.ts} +3 -3
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +88 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -0
- package/dist/components/Employee/Compensation/{CompensationFlowComponents.d.ts → onboarding/CompensationFlowComponents.d.ts} +3 -3
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js +59 -0
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +21 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +249 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsList.d.ts +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +43 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.js +10 -10
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -0
- package/dist/components/Employee/Compensation/{compensationStateMachine.js → onboarding/compensationStateMachine.js} +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +9 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js +10 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +7 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +41 -35
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +24 -3
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +203 -188
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +16 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +21 -15
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +30 -3
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +138 -130
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +19 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +93 -47
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/CompensationCard.d.ts +13 -0
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +95 -109
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +19 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +137 -25
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.d.ts +11 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js +34 -20
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +9 -17
- package/dist/components/Employee/Dashboard/JobAndPayView.js +536 -135
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +8 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.d.ts +10 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js +64 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +19 -1
- package/dist/components/Employee/Dashboard/TaxesView.js +92 -56
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +7 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +238 -40
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +50 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +57 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.test.d.ts +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -18
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +26 -10
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +61 -38
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.d.ts +8 -0
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js +61 -0
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js.map +1 -0
- package/dist/components/Employee/Deductions/Deductions.d.ts +2 -8
- package/dist/components/Employee/Deductions/Deductions.js +25 -52
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.d.ts +9 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js +137 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +9 -5
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +97 -94
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.d.ts +18 -0
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +137 -0
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +10 -5
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +57 -77
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +5 -5
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +29 -39
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +8 -6
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/Deductions/{DeductionsComponents.d.ts → deductionsContextualComponents.d.ts} +7 -8
- package/dist/components/Employee/Deductions/deductionsContextualComponents.js +74 -0
- package/dist/components/Employee/Deductions/deductionsContextualComponents.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js +31 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js +10 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.test.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/index.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +63 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +64 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +36 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +39 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +4 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +62 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +208 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +63 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +52 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +25 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +36 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +4 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +64 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +203 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +22 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js +50 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +13 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js +17 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -0
- package/dist/components/Employee/Deductions/stateMachine.d.ts +4 -5
- package/dist/components/Employee/Deductions/stateMachine.js +67 -89
- package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +6 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js +60 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -0
- package/dist/components/Employee/Documents/management/index.d.ts +3 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.js +5 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.js +6 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.js +5 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.js +11 -11
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.js +13 -13
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.js +8 -8
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.d.ts +3 -3
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.js +6 -6
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +117 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.js +14 -14
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +89 -82
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +37 -35
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +38 -39
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +29 -27
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/management/ListView.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/management/ListView.js +138 -0
- package/dist/components/Employee/PaymentMethod/management/ListView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +11 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +49 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +23 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/index.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +75 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +66 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +9 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +168 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +11 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +44 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +23 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js +97 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +75 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +9 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js +31 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/index.d.ts +7 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +15 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +22 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +37 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +105 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +39 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js +26 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +13 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js +19 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js +9 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +31 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +94 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +31 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js +22 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +20 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +68 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js +9 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +48 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +46 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +65 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +209 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +53 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +93 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -0
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +88 -87
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +2 -2
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/FederalForm.js +27 -26
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalHead.js +13 -10
- package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.js +17 -14
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +75 -69
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +26 -26
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +4 -1
- package/dist/components/Employee/exports/employeeManagement.js +22 -18
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
- package/dist/components/Employee/exports/employeeOnboarding.js +4 -4
- package/dist/components/Employee/index.d.ts +4 -4
- package/dist/components/Employee/index.js +5 -5
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +35 -35
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +84 -82
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +49 -48
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +1 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +39 -37
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +31 -31
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +1 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js +27 -27
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +50 -50
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js +66 -41
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +78 -55
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +3 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +34 -33
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +3 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +69 -61
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +119 -75
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +72 -61
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +103 -84
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +51 -49
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +78 -59
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +8 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js.map +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +6 -2
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +209 -154
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +3 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +36 -34
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +136 -134
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js +6 -6
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +63 -65
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +1 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +50 -49
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +4 -4
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +66 -55
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +33 -39
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +17 -0
- package/dist/contexts/ApiProvider/createSdkQueryClient.js +14 -0
- package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -0
- package/dist/helpers/formattedStrings.d.ts +12 -0
- package/dist/helpers/formattedStrings.js +55 -33
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useClientPagination/useClientPagination.d.ts +44 -0
- package/dist/hooks/useClientPagination/useClientPagination.js +69 -0
- package/dist/hooks/useClientPagination/useClientPagination.js.map +1 -0
- package/dist/hooks/useClientPagination/useClientPagination.test.d.ts +1 -0
- package/dist/i18n/I18n.js +6 -5
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +22 -20
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +8 -6
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +9 -9
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js +6 -4
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +10 -8
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -1
- package/dist/i18n/en/Employee.Compensation.json.js +48 -44
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +16 -12
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +104 -76
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +12 -0
- package/dist/i18n/en/Employee.DocumentManager.json.js.map +1 -0
- package/dist/i18n/en/Employee.PaymentMethod.json.js +76 -64
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +14 -0
- package/dist/i18n/en/common.json.js +19 -17
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +138 -112
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +2 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +20 -18
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +10 -2
- package/dist/shared/constants.js +30 -26
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/assertions.d.ts +16 -0
- package/dist/types/i18next.d.ts +161 -5
- package/dist/types/sdkError.js +58 -47
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +980 -1170
- package/package.json +29 -21
- package/dist/components/Employee/Compensation/Compensation.js +0 -87
- package/dist/components/Employee/Compensation/Compensation.js.map +0 -1
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js +0 -61
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.d.ts +0 -14
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js +0 -128
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.d.ts +0 -17
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js +0 -224
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/index.d.ts +0 -5
- package/dist/components/Employee/Compensation/JobsList/JobsList.js +0 -47
- package/dist/components/Employee/Compensation/JobsList/JobsList.js.map +0 -1
- package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js.map +0 -1
- package/dist/components/Employee/Compensation/compensationSchema.d.ts +0 -29
- package/dist/components/Employee/Compensation/compensationSchema.js +0 -63
- package/dist/components/Employee/Compensation/compensationSchema.js.map +0 -1
- package/dist/components/Employee/Compensation/compensationStateMachine.js.map +0 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.d.ts +0 -15
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js +0 -27
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js.map +0 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.d.ts +0 -13
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js +0 -26
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js.map +0 -1
- package/dist/components/Employee/Deductions/Actions.d.ts +0 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js +0 -31
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +0 -39
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -237
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -22
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -162
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +0 -34
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +0 -168
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +0 -1
- package/dist/components/Employee/Deductions/Head.d.ts +0 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +0 -30
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/stateMachine.js.map +0 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js.map +0 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +0 -115
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Actions.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +0 -20
- package/dist/components/Employee/PaymentMethod/Actions.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +0 -13
- package/dist/components/Employee/PaymentMethod/BankAccount.js +0 -13
- package/dist/components/Employee/PaymentMethod/BankAccount.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +0 -58
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +0 -51
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Head.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Head.js +0 -13
- package/dist/components/Employee/PaymentMethod/Head.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +0 -9
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +0 -183
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +0 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +0 -38
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Split.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Split.js +0 -175
- package/dist/components/Employee/PaymentMethod/Split.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +0 -54
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +0 -68
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +0 -1
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.d.ts +0 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/index.d.ts +0 -0
- package/dist/components/Employee/Compensation/{compensationStateMachine.d.ts → onboarding/compensationStateMachine.d.ts} +0 -0
- package/dist/components/Employee/{DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts → Compensation/shared/derivePrimaryFlsaStatus.test.d.ts} +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.js +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.js +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/index.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js.map +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/index.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.d.ts +0 -0
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocumentsPresentation.d.ts +0 -0
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/index.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.d.ts +0 -0
- package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.js +1 -1
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.js +0 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { useMemo as u, useRef as Z, useEffect as q } from "react";
|
|
2
|
+
import { useForm as ee, useWatch as te } from "react-hook-form";
|
|
3
|
+
import { zodResolver as re } from "@hookform/resolvers/zod";
|
|
4
|
+
import { PaymentPeriod as r } from "@gusto/embedded-api/models/components/garnishmentchildsupport";
|
|
5
|
+
import { useGarnishmentsCreateMutation as oe } from "@gusto/embedded-api/react-query/garnishmentsCreate";
|
|
6
|
+
import { useGarnishmentsUpdateMutation as ie } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
|
|
7
|
+
import { useGarnishmentsList as ne } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
8
|
+
import { useGarnishmentsGetChildSupportData as ae } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
|
|
9
|
+
import { createChildSupportGarnishmentFormSchema as se, getRequiredAttrKeys as ue } from "./childSupportGarnishmentFormSchema.js";
|
|
10
|
+
import { PaymentPeriodField as me, AmountField as de, PayPeriodMaximumField as ce, RemittanceNumberField as le, OrderNumberField as pe, CaseNumberField as he, FipsCodeField as be, StateField as fe } from "./fields.js";
|
|
11
|
+
import { useDeriveFieldsMetadata as ye } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
|
|
12
|
+
import { useHookFormInternals as Pe } from "../../../../../partner-hook-utils/form/useHookFormInternals.js";
|
|
13
|
+
import { createGetFormSubmissionValues as Ne } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
|
|
14
|
+
import { withOptions as M } from "../../../../../partner-hook-utils/form/withOptions.js";
|
|
15
|
+
import { composeErrorHandler as ge } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
16
|
+
import { useBaseSubmit as Se } from "../../../../Base/useBaseSubmit.js";
|
|
17
|
+
import { SDKInternalError as k } from "../../../../../types/sdkError.js";
|
|
18
|
+
const Me = [
|
|
19
|
+
{ value: r.EveryWeek, label: r.EveryWeek },
|
|
20
|
+
{ value: r.EveryOtherWeek, label: r.EveryOtherWeek },
|
|
21
|
+
{ value: r.TwicePerMonth, label: r.TwicePerMonth },
|
|
22
|
+
{ value: r.Monthly, label: r.Monthly }
|
|
23
|
+
], Ce = [
|
|
24
|
+
r.EveryWeek,
|
|
25
|
+
r.EveryOtherWeek,
|
|
26
|
+
r.TwicePerMonth,
|
|
27
|
+
r.Monthly
|
|
28
|
+
];
|
|
29
|
+
function He({
|
|
30
|
+
employeeId: C,
|
|
31
|
+
garnishmentId: P,
|
|
32
|
+
defaultValues: i,
|
|
33
|
+
validationMode: V = "onSubmit",
|
|
34
|
+
shouldFocusError: W = !0
|
|
35
|
+
}) {
|
|
36
|
+
const o = !P, v = o ? "create" : "update", d = ae({}), p = u(
|
|
37
|
+
() => d.data?.childSupportData?.agencies ?? [],
|
|
38
|
+
[d.data]
|
|
39
|
+
), h = ne({ employeeId: C }, { enabled: !o }), t = u(() => o ? null : h.data?.garnishments?.find((e) => e.uuid === P) ?? null, [o, P, h.data]), F = u(
|
|
40
|
+
() => ({
|
|
41
|
+
state: t?.childSupport?.state ?? i?.state ?? "",
|
|
42
|
+
fipsCode: t?.childSupport?.fipsCode ?? i?.fipsCode ?? "",
|
|
43
|
+
caseNumber: t?.childSupport?.caseNumber ?? i?.caseNumber ?? "",
|
|
44
|
+
orderNumber: t?.childSupport?.orderNumber ?? i?.orderNumber ?? "",
|
|
45
|
+
remittanceNumber: t?.childSupport?.remittanceNumber ?? i?.remittanceNumber ?? "",
|
|
46
|
+
amount: t?.amount ? Number(t.amount) : i?.amount ?? 0,
|
|
47
|
+
payPeriodMaximum: t?.payPeriodMaximum ? Number(t.payPeriodMaximum) : i?.payPeriodMaximum ?? 0,
|
|
48
|
+
paymentPeriod: t?.childSupport?.paymentPeriod ?? i?.paymentPeriod ?? r.Monthly
|
|
49
|
+
}),
|
|
50
|
+
[t, i]
|
|
51
|
+
), [E, L] = u(
|
|
52
|
+
() => se({ mode: v }),
|
|
53
|
+
[v]
|
|
54
|
+
), n = ee({
|
|
55
|
+
resolver: re(E),
|
|
56
|
+
mode: V,
|
|
57
|
+
shouldFocusError: W,
|
|
58
|
+
defaultValues: F,
|
|
59
|
+
values: F,
|
|
60
|
+
resetOptions: { keepDirtyValues: !0 }
|
|
61
|
+
}), c = te({ control: n.control, name: "state" }), m = u(
|
|
62
|
+
() => p.find((e) => e.state === c) ?? null,
|
|
63
|
+
[p, c]
|
|
64
|
+
), R = Z(null);
|
|
65
|
+
q(() => {
|
|
66
|
+
const e = R.current;
|
|
67
|
+
R.current = c, e !== null && e !== "" && e !== c && (n.setValue("caseNumber", ""), n.setValue("orderNumber", ""), n.setValue("remittanceNumber", ""));
|
|
68
|
+
}, [c]);
|
|
69
|
+
const N = m?.fipsCodes ?? [], b = N.length === 1 && !N[0]?.county?.length ? N[0]?.code ?? null : null;
|
|
70
|
+
q(() => {
|
|
71
|
+
b && n.setValue("fipsCode", b);
|
|
72
|
+
}, [b]);
|
|
73
|
+
const O = oe(), w = ie(), T = O.isPending || w.isPending, {
|
|
74
|
+
baseSubmitHandler: _,
|
|
75
|
+
error: I,
|
|
76
|
+
setError: H
|
|
77
|
+
} = Se("ChildSupportGarnishmentForm"), g = ge(
|
|
78
|
+
o ? [d] : [d, h],
|
|
79
|
+
{ submitError: I, setSubmitError: H }
|
|
80
|
+
), S = u(
|
|
81
|
+
() => p.map((e) => ({
|
|
82
|
+
state: e.state ?? "",
|
|
83
|
+
name: e.name ?? e.state ?? "",
|
|
84
|
+
manualPaymentRequired: e.manualPaymentRequired ?? !1
|
|
85
|
+
})),
|
|
86
|
+
[p]
|
|
87
|
+
), l = u(
|
|
88
|
+
() => (m?.fipsCodes ?? []).filter((e) => typeof e.code == "string").map((e) => ({ fipsCode: e.code, county: e.county ?? null })),
|
|
89
|
+
[m]
|
|
90
|
+
), f = u(
|
|
91
|
+
() => ue(m),
|
|
92
|
+
[m]
|
|
93
|
+
), K = l.length > 1 || l.length === 1 && b == null, s = ye(L, n.control), B = S.map((e) => ({ value: e.state, label: e.name })), D = l.map((e) => ({
|
|
94
|
+
value: e.fipsCode,
|
|
95
|
+
label: e.county ?? e.fipsCode
|
|
96
|
+
})), Q = {
|
|
97
|
+
state: M(s.state, B, S),
|
|
98
|
+
fipsCode: M(s.fipsCode, D, l),
|
|
99
|
+
caseNumber: s.caseNumber,
|
|
100
|
+
orderNumber: s.orderNumber,
|
|
101
|
+
remittanceNumber: s.remittanceNumber,
|
|
102
|
+
payPeriodMaximum: s.payPeriodMaximum,
|
|
103
|
+
amount: s.amount,
|
|
104
|
+
paymentPeriod: M(
|
|
105
|
+
s.paymentPeriod,
|
|
106
|
+
[...Me],
|
|
107
|
+
[...Ce]
|
|
108
|
+
)
|
|
109
|
+
}, Y = async () => {
|
|
110
|
+
let e;
|
|
111
|
+
return await new Promise((x) => {
|
|
112
|
+
n.handleSubmit(
|
|
113
|
+
async (U) => {
|
|
114
|
+
await _(U, async (a) => {
|
|
115
|
+
const A = {
|
|
116
|
+
state: a.state,
|
|
117
|
+
paymentPeriod: a.paymentPeriod,
|
|
118
|
+
fipsCode: a.fipsCode,
|
|
119
|
+
// Empty strings collapse to null so the API persists "no value
|
|
120
|
+
// declared" rather than an empty case number.
|
|
121
|
+
caseNumber: a.caseNumber || null,
|
|
122
|
+
orderNumber: a.orderNumber || null,
|
|
123
|
+
remittanceNumber: a.remittanceNumber || null
|
|
124
|
+
}, $ = `Child Support - ${A.caseNumber ?? ""}`, j = String(a.amount), J = a.payPeriodMaximum > 0 ? String(a.payPeriodMaximum) : null, G = {
|
|
125
|
+
active: !0,
|
|
126
|
+
amount: j,
|
|
127
|
+
description: $,
|
|
128
|
+
courtOrdered: !0,
|
|
129
|
+
garnishmentType: "child_support",
|
|
130
|
+
times: null,
|
|
131
|
+
deductAsPercentage: !0,
|
|
132
|
+
payPeriodMaximum: J,
|
|
133
|
+
recurring: !0,
|
|
134
|
+
childSupport: A
|
|
135
|
+
};
|
|
136
|
+
let y;
|
|
137
|
+
if (o)
|
|
138
|
+
y = (await O.mutateAsync({
|
|
139
|
+
request: { employeeId: C, garnishmentRequest: G }
|
|
140
|
+
})).garnishment;
|
|
141
|
+
else {
|
|
142
|
+
if (!t)
|
|
143
|
+
throw new k(
|
|
144
|
+
"Cannot update child-support deduction: no matching garnishment on file"
|
|
145
|
+
);
|
|
146
|
+
y = (await w.mutateAsync({
|
|
147
|
+
request: {
|
|
148
|
+
garnishmentId: t.uuid,
|
|
149
|
+
updateGarnishmentRequest: {
|
|
150
|
+
...G,
|
|
151
|
+
version: t.version
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
})).garnishment;
|
|
155
|
+
}
|
|
156
|
+
if (!y)
|
|
157
|
+
throw new k(
|
|
158
|
+
o ? "Child-support deduction creation failed" : "Child-support deduction update failed"
|
|
159
|
+
);
|
|
160
|
+
e = {
|
|
161
|
+
mode: o ? "create" : "update",
|
|
162
|
+
data: y
|
|
163
|
+
};
|
|
164
|
+
}), x();
|
|
165
|
+
},
|
|
166
|
+
() => {
|
|
167
|
+
x();
|
|
168
|
+
}
|
|
169
|
+
)();
|
|
170
|
+
}), e;
|
|
171
|
+
}, z = Pe(n);
|
|
172
|
+
return d.isLoading ? { isLoading: !0, errorHandling: g } : !o && h.isLoading ? { isLoading: !0, errorHandling: g } : {
|
|
173
|
+
isLoading: !1,
|
|
174
|
+
data: {
|
|
175
|
+
agencies: S,
|
|
176
|
+
counties: l,
|
|
177
|
+
deduction: t
|
|
178
|
+
},
|
|
179
|
+
status: {
|
|
180
|
+
isPending: T,
|
|
181
|
+
mode: o ? "create" : "update",
|
|
182
|
+
selectedAgency: m,
|
|
183
|
+
isManualPaymentRequired: m?.manualPaymentRequired ?? !1,
|
|
184
|
+
requiredAttrKeys: f
|
|
185
|
+
},
|
|
186
|
+
actions: { onSubmit: Y },
|
|
187
|
+
errorHandling: g,
|
|
188
|
+
form: {
|
|
189
|
+
Fields: {
|
|
190
|
+
State: fe,
|
|
191
|
+
FipsCode: K ? be : void 0,
|
|
192
|
+
CaseNumber: f.has("case_number") ? he : void 0,
|
|
193
|
+
OrderNumber: f.has("order_number") ? pe : void 0,
|
|
194
|
+
RemittanceNumber: f.has("remittance_number") ? le : void 0,
|
|
195
|
+
PayPeriodMaximum: ce,
|
|
196
|
+
Amount: de,
|
|
197
|
+
PaymentPeriod: me
|
|
198
|
+
},
|
|
199
|
+
fieldsMetadata: Q,
|
|
200
|
+
hookFormInternals: z,
|
|
201
|
+
getFormSubmissionValues: Ne(n, E)
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
He as useChildSupportGarnishmentForm
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=useChildSupportGarnishmentForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChildSupportGarnishmentForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n type Garnishment,\n type GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useGarnishmentsList } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportData } from '@gusto/embedded-api/react-query/garnishmentsGetChildSupportData'\nimport {\n createChildSupportGarnishmentFormSchema,\n getRequiredAttrKeys,\n type ChildSupportGarnishmentFormData,\n type ChildSupportGarnishmentFormOutputs,\n type SupportedRequiredAttrKey,\n} from './childSupportGarnishmentFormSchema'\nimport {\n StateField,\n FipsCodeField,\n CaseNumberField,\n OrderNumberField,\n RemittanceNumberField,\n PayPeriodMaximumField,\n AmountField,\n PaymentPeriodField,\n type CountyEntry,\n type StateFieldEntry,\n} from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\n\nconst PAYMENT_PERIOD_OPTIONS = [\n { value: PaymentPeriod.EveryWeek, label: PaymentPeriod.EveryWeek },\n { value: PaymentPeriod.EveryOtherWeek, label: PaymentPeriod.EveryOtherWeek },\n { value: PaymentPeriod.TwicePerMonth, label: PaymentPeriod.TwicePerMonth },\n { value: PaymentPeriod.Monthly, label: PaymentPeriod.Monthly },\n] as const\n\nconst PAYMENT_PERIOD_ENTRIES = [\n PaymentPeriod.EveryWeek,\n PaymentPeriod.EveryOtherWeek,\n PaymentPeriod.TwicePerMonth,\n PaymentPeriod.Monthly,\n] as const\n\nexport interface UseChildSupportGarnishmentFormProps {\n employeeId: string\n /**\n * When set, loads that garnishment via the list query and updates it (PUT).\n * When omitted, the form is in create mode (POST).\n */\n garnishmentId?: string\n defaultValues?: Partial<ChildSupportGarnishmentFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport interface ChildSupportGarnishmentFormFields {\n State: typeof StateField\n /** Only available when the selected agency has more than one fips code, or the\n * sole code is county-scoped (not an \"all counties\" auto-pick). */\n FipsCode: typeof FipsCodeField | undefined\n /** Only available when the selected agency requires `case_number`. */\n CaseNumber: typeof CaseNumberField | undefined\n /** Only available when the selected agency requires `order_number`. */\n OrderNumber: typeof OrderNumberField | undefined\n /** Only available when the selected agency requires `remittance_number`. */\n RemittanceNumber: typeof RemittanceNumberField | undefined\n PayPeriodMaximum: typeof PayPeriodMaximumField\n Amount: typeof AmountField\n PaymentPeriod: typeof PaymentPeriodField\n}\n\nexport interface UseChildSupportGarnishmentFormReady extends BaseFormHookReady<\n FieldsMetadata,\n ChildSupportGarnishmentFormData,\n ChildSupportGarnishmentFormFields\n> {\n data: {\n /** Agencies offered as `State` options; raw entries the consumer can use\n * with `getOptionLabel` for translated names. */\n agencies: StateFieldEntry[]\n /** Counties for the currently selected state. Empty array when no state\n * is selected. */\n counties: CountyEntry[]\n /** The garnishment loaded for update; `null` in create mode. */\n deduction: Garnishment | null\n }\n status: {\n isPending: boolean\n mode: 'create' | 'update'\n /** The agency record matching the currently selected `state`. */\n selectedAgency: Agencies | null\n /** Mirrors `selectedAgency.manualPaymentRequired`; convenient for showing\n * a warning alert. */\n isManualPaymentRequired: boolean\n /** Which `required_attributes` keys the selected agency declares. */\n requiredAttrKeys: ReadonlySet<SupportedRequiredAttrKey>\n }\n actions: {\n onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>\n }\n}\n\nexport type UseChildSupportGarnishmentFormResult =\n | HookLoadingResult\n | UseChildSupportGarnishmentFormReady\n\nexport function useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseChildSupportGarnishmentFormProps): UseChildSupportGarnishmentFormResult {\n const isCreateMode = !garnishmentId\n const schemaMode = isCreateMode ? 'create' : 'update'\n\n // Agencies + their required-attributes / fips codes come from a single GET.\n const agencyDataQuery = useGarnishmentsGetChildSupportData({})\n const agencyList = useMemo(\n () => agencyDataQuery.data?.childSupportData?.agencies ?? [],\n [agencyDataQuery.data],\n )\n\n // Update mode reads the row from the list endpoint (the garnishments API\n // has no single-row GET).\n const garnishmentsListQuery = useGarnishmentsList({ employeeId }, { enabled: !isCreateMode })\n const fetchedDeduction = useMemo(() => {\n if (isCreateMode) return null\n return garnishmentsListQuery.data?.garnishments?.find(g => g.uuid === garnishmentId) ?? null\n }, [isCreateMode, garnishmentId, garnishmentsListQuery.data])\n\n const resolvedDefaults: ChildSupportGarnishmentFormData = useMemo(\n () => ({\n state: fetchedDeduction?.childSupport?.state ?? partnerDefaults?.state ?? '',\n fipsCode: fetchedDeduction?.childSupport?.fipsCode ?? partnerDefaults?.fipsCode ?? '',\n caseNumber: fetchedDeduction?.childSupport?.caseNumber ?? partnerDefaults?.caseNumber ?? '',\n orderNumber:\n fetchedDeduction?.childSupport?.orderNumber ?? partnerDefaults?.orderNumber ?? '',\n remittanceNumber:\n fetchedDeduction?.childSupport?.remittanceNumber ?? partnerDefaults?.remittanceNumber ?? '',\n amount: fetchedDeduction?.amount\n ? Number(fetchedDeduction.amount)\n : (partnerDefaults?.amount ?? 0),\n payPeriodMaximum: fetchedDeduction?.payPeriodMaximum\n ? Number(fetchedDeduction.payPeriodMaximum)\n : (partnerDefaults?.payPeriodMaximum ?? 0),\n paymentPeriod:\n (fetchedDeduction?.childSupport?.paymentPeriod as PaymentPeriod | undefined) ??\n partnerDefaults?.paymentPeriod ??\n PaymentPeriod.Monthly,\n }),\n [fetchedDeduction, partnerDefaults],\n )\n\n // The schema is built statically here. The agency-attribute fields\n // (`caseNumber`, `orderNumber`, `remittanceNumber`) are kept optional in the\n // schema and surfaced as `isRequired` at the metadata level when the\n // selected agency declares them in `required_attributes`. This matches the\n // legacy ChildSupportForm, which also used a static schema and relied on the\n // API to enforce missing-attribute validation. The hook's `requiredAttrKeys`\n // status flag tells consumers which UI fields to mark required.\n const [schema, metadataConfig] = useMemo(\n () => createChildSupportGarnishmentFormSchema({ mode: schemaMode }),\n [schemaMode],\n )\n\n const formMethods = useForm<\n ChildSupportGarnishmentFormData,\n unknown,\n ChildSupportGarnishmentFormOutputs\n >({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const liveWatchedState = useWatch({ control: formMethods.control, name: 'state' })\n const liveSelectedAgency = useMemo(\n () => agencyList.find(a => a.state === liveWatchedState) ?? null,\n [agencyList, liveWatchedState],\n )\n\n // The agency-attribute fields stay in sync with the chosen state: when the\n // user switches states, the previous attribute values would otherwise carry\n // over and potentially submit alongside the wrong agency. The ref tracks\n // the previous value so the wipe only fires on user-driven transitions —\n // NOT on the initial sync when an existing garnishment loads (state moves\n // from '' to e.g. 'AK' as a side effect of `values` updating, which would\n // otherwise clobber the loaded case/order/remittance values).\n const previousWatchedStateRef = useRef<string | null>(null)\n useEffect(() => {\n const previous = previousWatchedStateRef.current\n previousWatchedStateRef.current = liveWatchedState\n // First render (no previous value) → skip the wipe.\n if (previous === null) return\n // Server-side load: previous was '' (initial defaults before the row\n // arrived), now it's the loaded state. That's a sync, not a user toggle.\n if (previous === '') return\n if (previous === liveWatchedState) return\n formMethods.setValue('caseNumber', '')\n formMethods.setValue('orderNumber', '')\n formMethods.setValue('remittanceNumber', '')\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [liveWatchedState])\n\n // When the selected agency has a single \"all counties\" fips code, auto-fill\n // the field so the consumer doesn't have to render the county select.\n const fipsCodes = liveSelectedAgency?.fipsCodes ?? []\n const singleAllCountiesFipsCode =\n fipsCodes.length === 1 && !fipsCodes[0]?.county?.length ? (fipsCodes[0]?.code ?? null) : null\n useEffect(() => {\n if (singleAllCountiesFipsCode) {\n formMethods.setValue('fipsCode', singleAllCountiesFipsCode)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [singleAllCountiesFipsCode])\n\n const createGarnishmentMutation = useGarnishmentsCreateMutation()\n const updateGarnishmentMutation = useGarnishmentsUpdateMutation()\n const isPending = createGarnishmentMutation.isPending || updateGarnishmentMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('ChildSupportGarnishmentForm')\n\n const errorHandling = composeErrorHandler(\n isCreateMode ? [agencyDataQuery] : [agencyDataQuery, garnishmentsListQuery],\n { submitError, setSubmitError },\n )\n\n // ── Derived data exposed on the ready branch ─────────────────────────\n\n const agencies: StateFieldEntry[] = useMemo(\n () =>\n agencyList.map(a => ({\n state: a.state ?? '',\n name: a.name ?? a.state ?? '',\n manualPaymentRequired: a.manualPaymentRequired ?? false,\n })),\n [agencyList],\n )\n\n const counties: CountyEntry[] = useMemo(\n () =>\n (liveSelectedAgency?.fipsCodes ?? [])\n .filter(f => typeof f.code === 'string')\n .map(f => ({ fipsCode: f.code as string, county: f.county ?? null })),\n [liveSelectedAgency],\n )\n\n const requiredAttrKeys = useMemo(\n () => getRequiredAttrKeys(liveSelectedAgency),\n [liveSelectedAgency],\n )\n\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n // ── Metadata + field-options wiring ─────────────────────────────────\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const stateOptions = agencies.map(a => ({ value: a.state, label: a.name }))\n const countyOptions = counties.map(c => ({\n value: c.fipsCode,\n label: c.county ?? c.fipsCode,\n }))\n\n const fieldsMetadata = {\n state: withOptions(baseMetadata.state, stateOptions, agencies),\n fipsCode: withOptions(baseMetadata.fipsCode, countyOptions, counties),\n caseNumber: baseMetadata.caseNumber,\n orderNumber: baseMetadata.orderNumber,\n remittanceNumber: baseMetadata.remittanceNumber,\n payPeriodMaximum: baseMetadata.payPeriodMaximum,\n amount: baseMetadata.amount,\n paymentPeriod: withOptions(\n baseMetadata.paymentPeriod,\n [...PAYMENT_PERIOD_OPTIONS],\n [...PAYMENT_PERIOD_ENTRIES],\n ),\n }\n\n // ── Submit ───────────────────────────────────────────────────────────\n\n const onSubmit = async (): Promise<HookSubmitResult<Garnishment> | undefined> => {\n let submitResult: HookSubmitResult<Garnishment> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: ChildSupportGarnishmentFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const childSupport = {\n state: payload.state,\n paymentPeriod: payload.paymentPeriod,\n fipsCode: payload.fipsCode,\n // Empty strings collapse to null so the API persists \"no value\n // declared\" rather than an empty case number.\n caseNumber: payload.caseNumber || null,\n orderNumber: payload.orderNumber || null,\n remittanceNumber: payload.remittanceNumber || null,\n }\n\n const description = `Child Support - ${childSupport.caseNumber ?? ''}`\n const amountStr = String(payload.amount)\n const payPeriodMaximumStr =\n payload.payPeriodMaximum > 0 ? String(payload.payPeriodMaximum) : null\n\n const requestBody = {\n active: true,\n amount: amountStr,\n description,\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true,\n payPeriodMaximum: payPeriodMaximumStr,\n recurring: true,\n childSupport,\n }\n\n let updated: Garnishment | undefined\n\n if (isCreateMode) {\n const result = await createGarnishmentMutation.mutateAsync({\n request: { employeeId, garnishmentRequest: requestBody },\n })\n updated = result.garnishment\n } else {\n if (!fetchedDeduction) {\n throw new SDKInternalError(\n 'Cannot update child-support deduction: no matching garnishment on file',\n )\n }\n const result = await updateGarnishmentMutation.mutateAsync({\n request: {\n garnishmentId: fetchedDeduction.uuid,\n updateGarnishmentRequest: {\n ...requestBody,\n version: fetchedDeduction.version as string,\n },\n },\n })\n updated = result.garnishment\n }\n\n if (!updated) {\n throw new SDKInternalError(\n isCreateMode\n ? 'Child-support deduction creation failed'\n : 'Child-support deduction update failed',\n )\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updated,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (agencyDataQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n if (!isCreateMode && garnishmentsListQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n agencies,\n counties,\n deduction: fetchedDeduction,\n },\n status: {\n isPending,\n mode: isCreateMode ? 'create' : 'update',\n selectedAgency: liveSelectedAgency,\n isManualPaymentRequired: liveSelectedAgency?.manualPaymentRequired ?? false,\n requiredAttrKeys,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n State: StateField,\n FipsCode: hasSelectableCounties ? FipsCodeField : undefined,\n CaseNumber: requiredAttrKeys.has('case_number') ? CaseNumberField : undefined,\n OrderNumber: requiredAttrKeys.has('order_number') ? OrderNumberField : undefined,\n RemittanceNumber: requiredAttrKeys.has('remittance_number')\n ? RemittanceNumberField\n : undefined,\n PayPeriodMaximum: PayPeriodMaximumField,\n Amount: AmountField,\n PaymentPeriod: PaymentPeriodField,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type ChildSupportGarnishmentFormFieldsMetadata =\n UseChildSupportGarnishmentFormReady['form']['fieldsMetadata']\nexport type ChildSupportGarnishmentFormFieldsType =\n UseChildSupportGarnishmentFormReady['form']['Fields']\n"],"names":["PAYMENT_PERIOD_OPTIONS","PaymentPeriod","PAYMENT_PERIOD_ENTRIES","useChildSupportGarnishmentForm","employeeId","garnishmentId","partnerDefaults","validationMode","shouldFocusError","isCreateMode","schemaMode","agencyDataQuery","useGarnishmentsGetChildSupportData","agencyList","useMemo","garnishmentsListQuery","useGarnishmentsList","fetchedDeduction","g","resolvedDefaults","schema","metadataConfig","createChildSupportGarnishmentFormSchema","formMethods","useForm","zodResolver","liveWatchedState","useWatch","liveSelectedAgency","a","previousWatchedStateRef","useRef","useEffect","previous","fipsCodes","singleAllCountiesFipsCode","createGarnishmentMutation","useGarnishmentsCreateMutation","updateGarnishmentMutation","useGarnishmentsUpdateMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","agencies","counties","f","requiredAttrKeys","getRequiredAttrKeys","hasSelectableCounties","baseMetadata","useDeriveFieldsMetadata","stateOptions","countyOptions","c","fieldsMetadata","withOptions","onSubmit","submitResult","resolve","data","payload","childSupport","description","amountStr","payPeriodMaximumStr","requestBody","updated","SDKInternalError","hookFormInternals","useHookFormInternals","StateField","FipsCodeField","CaseNumberField","OrderNumberField","RemittanceNumberField","PayPeriodMaximumField","AmountField","PaymentPeriodField","createGetFormSubmissionValues"],"mappings":"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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OptionalFieldsToRequire } from '../../../../../partner-hook-utils/form/buildFormSchema';
|
|
3
|
+
export declare const DeductionFormErrorCodes: {
|
|
4
|
+
readonly REQUIRED: "REQUIRED";
|
|
5
|
+
readonly NEGATIVE_AMOUNT: "NEGATIVE_AMOUNT";
|
|
6
|
+
};
|
|
7
|
+
export type DeductionFormErrorCode = (typeof DeductionFormErrorCodes)[keyof typeof DeductionFormErrorCodes];
|
|
8
|
+
declare const fieldValidators: {
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
recurring: z.ZodPipe<z.ZodTransform<boolean | undefined, unknown>, z.ZodBoolean>;
|
|
11
|
+
deductAsPercentage: z.ZodPipe<z.ZodTransform<boolean | undefined, unknown>, z.ZodBoolean>;
|
|
12
|
+
amount: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
13
|
+
totalAmount: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
14
|
+
annualMaximum: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
15
|
+
garnishmentType: z.ZodEnum<{
|
|
16
|
+
readonly ChildSupport: "child_support";
|
|
17
|
+
readonly FederalTaxLien: "federal_tax_lien";
|
|
18
|
+
readonly StateTaxLien: "state_tax_lien";
|
|
19
|
+
readonly StudentLoan: "student_loan";
|
|
20
|
+
readonly CreditorGarnishment: "creditor_garnishment";
|
|
21
|
+
readonly FederalLoan: "federal_loan";
|
|
22
|
+
readonly OtherGarnishment: "other_garnishment";
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
export type DeductionFormField = keyof typeof fieldValidators;
|
|
26
|
+
export type DeductionFormData = {
|
|
27
|
+
[K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>;
|
|
28
|
+
};
|
|
29
|
+
export type DeductionFormOutputs = DeductionFormData;
|
|
30
|
+
declare const requiredFieldsConfig: {
|
|
31
|
+
totalAmount: "never";
|
|
32
|
+
annualMaximum: "never";
|
|
33
|
+
};
|
|
34
|
+
export type DeductionFormOptionalFieldsToRequire = OptionalFieldsToRequire<typeof requiredFieldsConfig>;
|
|
35
|
+
interface DeductionFormSchemaOptions {
|
|
36
|
+
mode?: 'create' | 'update';
|
|
37
|
+
/**
|
|
38
|
+
* Court-ordered garnishments require `garnishmentType` (Federal Tax Lien,
|
|
39
|
+
* Student Loan, etc.). Non-court-ordered "custom" deductions don't carry a
|
|
40
|
+
* type — the field is excluded from the schema entirely, matching the legacy
|
|
41
|
+
* GarnishmentForm vs CustomDeductionForm split.
|
|
42
|
+
*/
|
|
43
|
+
courtOrdered: boolean;
|
|
44
|
+
optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire;
|
|
45
|
+
}
|
|
46
|
+
export declare function createDeductionFormSchema(options: DeductionFormSchemaOptions): import('../../../../../partner-hook-utils/form/buildFormSchema').BuildFormSchemaResult<{
|
|
47
|
+
description: z.ZodString;
|
|
48
|
+
recurring: z.ZodPipe<z.ZodTransform<boolean | undefined, unknown>, z.ZodBoolean>;
|
|
49
|
+
deductAsPercentage: z.ZodPipe<z.ZodTransform<boolean | undefined, unknown>, z.ZodBoolean>;
|
|
50
|
+
amount: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
51
|
+
totalAmount: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
52
|
+
annualMaximum: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
53
|
+
garnishmentType: z.ZodEnum<{
|
|
54
|
+
readonly ChildSupport: "child_support";
|
|
55
|
+
readonly FederalTaxLien: "federal_tax_lien";
|
|
56
|
+
readonly StateTaxLien: "state_tax_lien";
|
|
57
|
+
readonly StudentLoan: "student_loan";
|
|
58
|
+
readonly CreditorGarnishment: "creditor_garnishment";
|
|
59
|
+
readonly FederalLoan: "federal_loan";
|
|
60
|
+
readonly OtherGarnishment: "other_garnishment";
|
|
61
|
+
}>;
|
|
62
|
+
}>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { GarnishmentType as a } from "@gusto/embedded-api/models/components/garnishment";
|
|
3
|
+
import { buildFormSchema as c } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
|
|
4
|
+
import { coerceNaN as o, coerceStringBoolean as n } from "../../../../../partner-hook-utils/form/preprocessors.js";
|
|
5
|
+
const r = {
|
|
6
|
+
REQUIRED: "REQUIRED",
|
|
7
|
+
NEGATIVE_AMOUNT: "NEGATIVE_AMOUNT"
|
|
8
|
+
}, u = {
|
|
9
|
+
description: e.string(),
|
|
10
|
+
// Radio groups deliver `'true'`/`'false'` strings; coerce to boolean for the
|
|
11
|
+
// submit payload. Matches the useJobForm pattern.
|
|
12
|
+
recurring: e.preprocess(n, e.boolean()),
|
|
13
|
+
deductAsPercentage: e.preprocess(n, e.boolean()),
|
|
14
|
+
// Currency / percent input. NumberInputField writes `number | undefined`;
|
|
15
|
+
// coerce to a numeric so .min(0) runs reliably. The number-to-string
|
|
16
|
+
// conversion the garnishment API expects happens inside the hook's onSubmit,
|
|
17
|
+
// so the form value stays a number end-to-end (input === output).
|
|
18
|
+
amount: e.preprocess(
|
|
19
|
+
o(0),
|
|
20
|
+
e.number().min(0, { message: r.NEGATIVE_AMOUNT })
|
|
21
|
+
),
|
|
22
|
+
// Optional caps. The hook drops them to `null` on the wire when 0 — matches
|
|
23
|
+
// the legacy DeductionSchema's "0 means no cap" behavior.
|
|
24
|
+
totalAmount: e.preprocess(
|
|
25
|
+
o(0),
|
|
26
|
+
e.number().min(0, { message: r.NEGATIVE_AMOUNT })
|
|
27
|
+
),
|
|
28
|
+
annualMaximum: e.preprocess(
|
|
29
|
+
o(0),
|
|
30
|
+
e.number().min(0, { message: r.NEGATIVE_AMOUNT })
|
|
31
|
+
),
|
|
32
|
+
// Only used when `courtOrdered: true` — see `excludeFields` below.
|
|
33
|
+
garnishmentType: e.enum(a)
|
|
34
|
+
}, p = {
|
|
35
|
+
totalAmount: "never",
|
|
36
|
+
annualMaximum: "never"
|
|
37
|
+
};
|
|
38
|
+
function A(m) {
|
|
39
|
+
const { mode: t = "create", courtOrdered: i, optionalFieldsToRequire: s } = m;
|
|
40
|
+
return c(u, {
|
|
41
|
+
requiredFieldsConfig: p,
|
|
42
|
+
requiredErrorCode: r.REQUIRED,
|
|
43
|
+
mode: t,
|
|
44
|
+
optionalFieldsToRequire: s,
|
|
45
|
+
excludeFields: i ? [] : ["garnishmentType"]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
r as DeductionFormErrorCodes,
|
|
50
|
+
A as createDeductionFormSchema
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=deductionFormSchema.js.map
|
package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deductionFormSchema.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport { GarnishmentType } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceStringBoolean } from '@/partner-hook-utils/form/preprocessors'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const DeductionFormErrorCodes = {\n REQUIRED: 'REQUIRED',\n NEGATIVE_AMOUNT: 'NEGATIVE_AMOUNT',\n} as const\n\nexport type DeductionFormErrorCode =\n (typeof DeductionFormErrorCodes)[keyof typeof DeductionFormErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n description: z.string(),\n // Radio groups deliver `'true'`/`'false'` strings; coerce to boolean for the\n // submit payload. Matches the useJobForm pattern.\n recurring: z.preprocess(coerceStringBoolean, z.boolean()),\n deductAsPercentage: z.preprocess(coerceStringBoolean, z.boolean()),\n // Currency / percent input. NumberInputField writes `number | undefined`;\n // coerce to a numeric so .min(0) runs reliably. The number-to-string\n // conversion the garnishment API expects happens inside the hook's onSubmit,\n // so the form value stays a number end-to-end (input === output).\n amount: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Optional caps. The hook drops them to `null` on the wire when 0 — matches\n // the legacy DeductionSchema's \"0 means no cap\" behavior.\n totalAmount: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n annualMaximum: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Only used when `courtOrdered: true` — see `excludeFields` below.\n garnishmentType: z.enum(GarnishmentType),\n}\n\nexport type DeductionFormField = keyof typeof fieldValidators\n\nexport type DeductionFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nexport type DeductionFormOutputs = DeductionFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n//\n// `description`, `recurring`, `deductAsPercentage`, `amount` are required by\n// default. `garnishmentType` is required only when present in the shape\n// (court-ordered branch). `totalAmount` and `annualMaximum` are caps the\n// partner can leave blank.\n\nconst requiredFieldsConfig = {\n totalAmount: 'never',\n annualMaximum: 'never',\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nexport type DeductionFormOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\ninterface DeductionFormSchemaOptions {\n mode?: 'create' | 'update'\n /**\n * Court-ordered garnishments require `garnishmentType` (Federal Tax Lien,\n * Student Loan, etc.). Non-court-ordered \"custom\" deductions don't carry a\n * type — the field is excluded from the schema entirely, matching the legacy\n * GarnishmentForm vs CustomDeductionForm split.\n */\n courtOrdered: boolean\n optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire\n}\n\nexport function createDeductionFormSchema(options: DeductionFormSchemaOptions) {\n const { mode = 'create', courtOrdered, optionalFieldsToRequire } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: DeductionFormErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: courtOrdered ? [] : ['garnishmentType'],\n })\n}\n"],"names":["DeductionFormErrorCodes","fieldValidators","z","coerceStringBoolean","coerceNaN","GarnishmentType","requiredFieldsConfig","createDeductionFormSchema","options","mode","courtOrdered","optionalFieldsToRequire","buildFormSchema"],"mappings":";;;;AAWO,MAAMA,IAA0B;AAAA,EACrC,UAAU;AAAA,EACV,iBAAiB;AACnB,GAOMC,IAAkB;AAAA,EACtB,aAAaC,EAAE,OAAA;AAAA;AAAA;AAAA,EAGf,WAAWA,EAAE,WAAWC,GAAqBD,EAAE,SAAS;AAAA,EACxD,oBAAoBA,EAAE,WAAWC,GAAqBD,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjE,QAAQA,EAAE;AAAA,IACRE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA;AAAA,EAIxE,aAAaE,EAAE;AAAA,IACbE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA,EAExE,eAAeE,EAAE;AAAA,IACfE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA,EAGxE,iBAAiBE,EAAE,KAAKG,CAAe;AACzC,GAiBMC,IAAuB;AAAA,EAC3B,aAAa;AAAA,EACb,eAAe;AACjB;AAkBO,SAASC,EAA0BC,GAAqC;AAC7E,QAAM,EAAE,MAAAC,IAAO,UAAU,cAAAC,GAAc,yBAAAC,MAA4BH;AAEnE,SAAOI,EAAgBX,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAAwB;AAAA,IAC3C,MAAAS;AAAA,IACA,yBAAAE;AAAA,IACA,eAAeD,IAAe,CAAA,IAAK,CAAC,iBAAiB;AAAA,EAAA,CACtD;AACH;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GarnishmentType } from '@gusto/embedded-api/models/components/garnishment';
|
|
2
|
+
import { DeductionFormErrorCodes } from './deductionFormSchema';
|
|
3
|
+
import { TextInputHookFieldProps } from '../../../../../partner-hook-utils/form/fields/TextInputHookField';
|
|
4
|
+
import { NumberInputHookFieldProps } from '../../../../../partner-hook-utils/form/fields/NumberInputHookField';
|
|
5
|
+
import { RadioGroupHookFieldProps } from '../../../../../partner-hook-utils/form/fields/RadioGroupHookField';
|
|
6
|
+
import { SelectHookFieldProps } from '../../../../../partner-hook-utils/form/fields/SelectHookField';
|
|
7
|
+
import { HookFieldProps } from '../../../../../partner-hook-utils/types';
|
|
8
|
+
export type RequiredValidation = typeof DeductionFormErrorCodes.REQUIRED;
|
|
9
|
+
export type NegativeAmountValidation = typeof DeductionFormErrorCodes.NEGATIVE_AMOUNT;
|
|
10
|
+
export type AmountValidation = RequiredValidation | NegativeAmountValidation;
|
|
11
|
+
export type CapValidation = NegativeAmountValidation;
|
|
12
|
+
export type DescriptionFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>;
|
|
13
|
+
export declare function DescriptionField(props: DescriptionFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type RecurringFieldProps = HookFieldProps<RadioGroupHookFieldProps<RequiredValidation, boolean>>;
|
|
15
|
+
export declare function RecurringField(props: RecurringFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export type DeductAsPercentageFieldProps = HookFieldProps<RadioGroupHookFieldProps<RequiredValidation, boolean>>;
|
|
17
|
+
export declare function DeductAsPercentageField(props: DeductAsPercentageFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>;
|
|
19
|
+
export declare function AmountField(props: AmountFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export type TotalAmountFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>;
|
|
21
|
+
export declare function TotalAmountField(props: TotalAmountFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export type AnnualMaximumFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>;
|
|
23
|
+
export declare function AnnualMaximumField(props: AnnualMaximumFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type GarnishmentTypeFieldProps = HookFieldProps<SelectHookFieldProps<RequiredValidation, GarnishmentType>>;
|
|
25
|
+
export declare function GarnishmentTypeField(props: GarnishmentTypeFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { TextInputHookField as o } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
3
|
+
import { SelectHookField as i } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
4
|
+
import { NumberInputHookField as t } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
5
|
+
import { RadioGroupHookField as r } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
6
|
+
function l(n) {
|
|
7
|
+
return /* @__PURE__ */ e(o, { ...n, name: "description" });
|
|
8
|
+
}
|
|
9
|
+
function p(n) {
|
|
10
|
+
return /* @__PURE__ */ e(r, { ...n, name: "recurring" });
|
|
11
|
+
}
|
|
12
|
+
function f(n) {
|
|
13
|
+
return /* @__PURE__ */ e(r, { ...n, name: "deductAsPercentage" });
|
|
14
|
+
}
|
|
15
|
+
function F(n) {
|
|
16
|
+
return /* @__PURE__ */ e(t, { ...n, name: "amount" });
|
|
17
|
+
}
|
|
18
|
+
function s(n) {
|
|
19
|
+
return /* @__PURE__ */ e(t, { ...n, name: "totalAmount" });
|
|
20
|
+
}
|
|
21
|
+
function A(n) {
|
|
22
|
+
return /* @__PURE__ */ e(t, { ...n, name: "annualMaximum" });
|
|
23
|
+
}
|
|
24
|
+
function g(n) {
|
|
25
|
+
return /* @__PURE__ */ e(i, { ...n, name: "garnishmentType" });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
F as AmountField,
|
|
29
|
+
A as AnnualMaximumField,
|
|
30
|
+
f as DeductAsPercentageField,
|
|
31
|
+
l as DescriptionField,
|
|
32
|
+
g as GarnishmentTypeField,
|
|
33
|
+
p as RecurringField,
|
|
34
|
+
s as TotalAmountField
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/fields.tsx"],"sourcesContent":["import type { GarnishmentType } from '@gusto/embedded-api/models/components/garnishment'\nimport type { DeductionFormErrorCodes } from './deductionFormSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { RadioGroupHookFieldProps } from '@/partner-hook-utils/form/fields/RadioGroupHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport {\n TextInputHookField,\n NumberInputHookField,\n RadioGroupHookField,\n SelectHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\nexport type RequiredValidation = typeof DeductionFormErrorCodes.REQUIRED\nexport type NegativeAmountValidation = typeof DeductionFormErrorCodes.NEGATIVE_AMOUNT\n\nexport type AmountValidation = RequiredValidation | NegativeAmountValidation\nexport type CapValidation = NegativeAmountValidation\n\n// ── Description ────────────────────────────────────────────────────────\n\nexport type DescriptionFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\nexport function DescriptionField(props: DescriptionFieldProps) {\n return <TextInputHookField {...props} name=\"description\" />\n}\n\n// ── Recurring (radio: boolean) ─────────────────────────────────────────\n\nexport type RecurringFieldProps = HookFieldProps<\n RadioGroupHookFieldProps<RequiredValidation, boolean>\n>\n\nexport function RecurringField(props: RecurringFieldProps) {\n return <RadioGroupHookField {...props} name=\"recurring\" />\n}\n\n// ── DeductAsPercentage (radio: boolean) ────────────────────────────────\n\nexport type DeductAsPercentageFieldProps = HookFieldProps<\n RadioGroupHookFieldProps<RequiredValidation, boolean>\n>\n\nexport function DeductAsPercentageField(props: DeductAsPercentageFieldProps) {\n return <RadioGroupHookField {...props} name=\"deductAsPercentage\" />\n}\n\n// ── Amount (currency or percent depending on deductAsPercentage) ───────\n\nexport type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>\n\nexport function AmountField(props: AmountFieldProps) {\n return <NumberInputHookField {...props} name=\"amount\" />\n}\n\n// ── TotalAmount (optional cap — only meaningful when recurring) ────────\n\nexport type TotalAmountFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>\n\nexport function TotalAmountField(props: TotalAmountFieldProps) {\n return <NumberInputHookField {...props} name=\"totalAmount\" />\n}\n\n// ── AnnualMaximum (optional annual cap — only meaningful when recurring) ─\n\nexport type AnnualMaximumFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>\n\nexport function AnnualMaximumField(props: AnnualMaximumFieldProps) {\n return <NumberInputHookField {...props} name=\"annualMaximum\" />\n}\n\n// ── GarnishmentType (court-ordered only) ───────────────────────────────\n\nexport type GarnishmentTypeFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, GarnishmentType>\n>\n\nexport function GarnishmentTypeField(props: GarnishmentTypeFieldProps) {\n return <SelectHookField {...props} name=\"garnishmentType\" />\n}\n"],"names":["DescriptionField","props","jsx","TextInputHookField","RecurringField","RadioGroupHookField","DeductAsPercentageField","AmountField","NumberInputHookField","TotalAmountField","AnnualMaximumField","GarnishmentTypeField","SelectHookField"],"mappings":";;;;;AAwBO,SAASA,EAAiBC,GAA8B;AAC7D,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,eAAc;AAC3D;AAQO,SAASG,EAAeH,GAA4B;AACzD,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,aAAY;AAC1D;AAQO,SAASK,EAAwBL,GAAqC;AAC3E,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,sBAAqB;AACnE;AAMO,SAASM,EAAYN,GAAyB;AACnD,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,UAAS;AACxD;AAMO,SAASQ,EAAiBR,GAA8B;AAC7D,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,eAAc;AAC7D;AAMO,SAASS,EAAmBT,GAAgC;AACjE,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,iBAAgB;AAC/D;AAQO,SAASU,EAAqBV,GAAkC;AACrE,SAAO,gBAAAC,EAACU,GAAA,EAAiB,GAAGX,GAAO,MAAK,mBAAkB;AAC5D;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { useDeductionForm, type UseDeductionFormProps, type UseDeductionFormResult, type UseDeductionFormReady, type DeductionFormFields, type DeductionFormFieldsMetadata, type DeductionFormFieldsType, type DeductionFormOptionalFieldsToRequire, } from './useDeductionForm';
|
|
3
|
+
export { createDeductionFormSchema, DeductionFormErrorCodes, type DeductionFormErrorCode, type DeductionFormData, type DeductionFormOutputs, type DeductionFormField, } from './deductionFormSchema';
|
|
4
|
+
export type { RequiredValidation as DeductionFormRequiredValidation, NegativeAmountValidation as DeductionFormNegativeAmountValidation, AmountValidation as DeductionFormAmountValidation, CapValidation as DeductionFormCapValidation, DescriptionFieldProps, RecurringFieldProps, DeductAsPercentageFieldProps, AmountFieldProps, TotalAmountFieldProps, AnnualMaximumFieldProps, GarnishmentTypeFieldProps, } from './fields';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { UseFormProps } from 'react-hook-form';
|
|
2
|
+
import { Garnishment } from '@gusto/embedded-api/models/components/garnishment';
|
|
3
|
+
import { DeductionFormData, DeductionFormOptionalFieldsToRequire } from './deductionFormSchema';
|
|
4
|
+
import { DescriptionField, RecurringField, DeductAsPercentageField, AmountField, TotalAmountField, AnnualMaximumField, GarnishmentTypeField } from './fields';
|
|
5
|
+
import { BaseFormHookReady, FieldsMetadata, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
|
|
6
|
+
export type { DeductionFormOptionalFieldsToRequire } from './deductionFormSchema';
|
|
7
|
+
export interface UseDeductionFormProps {
|
|
8
|
+
employeeId: string;
|
|
9
|
+
/**
|
|
10
|
+
* When set, loads that garnishment via the list query and updates it (PUT).
|
|
11
|
+
* When omitted, the form is in create mode (POST).
|
|
12
|
+
*/
|
|
13
|
+
garnishmentId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Court-ordered deductions are stored as garnishments with `courtOrdered:
|
|
16
|
+
* true` and require a `garnishmentType` (Federal Tax Lien, Student Loan,
|
|
17
|
+
* etc.). When `false`, the form is for a "custom" post-tax deduction —
|
|
18
|
+
* `garnishmentType` is excluded from the schema and submit payload.
|
|
19
|
+
*
|
|
20
|
+
* Note: this hook does NOT handle `garnishmentType: 'child_support'`. Use
|
|
21
|
+
* `useChildSupportGarnishmentForm` for child-support agency-keyed payloads.
|
|
22
|
+
*/
|
|
23
|
+
courtOrdered: boolean;
|
|
24
|
+
optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire;
|
|
25
|
+
defaultValues?: Partial<DeductionFormData>;
|
|
26
|
+
validationMode?: UseFormProps['mode'];
|
|
27
|
+
shouldFocusError?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface DeductionFormFields {
|
|
30
|
+
Description: typeof DescriptionField;
|
|
31
|
+
Recurring: typeof RecurringField;
|
|
32
|
+
DeductAsPercentage: typeof DeductAsPercentageField;
|
|
33
|
+
Amount: typeof AmountField;
|
|
34
|
+
/** Only available when `status.isRecurring` is true. */
|
|
35
|
+
TotalAmount: typeof TotalAmountField | undefined;
|
|
36
|
+
/** Only available when `status.isRecurring` is true. */
|
|
37
|
+
AnnualMaximum: typeof AnnualMaximumField | undefined;
|
|
38
|
+
/** Only available when `courtOrdered: true`. */
|
|
39
|
+
GarnishmentType: typeof GarnishmentTypeField | undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface UseDeductionFormReady extends BaseFormHookReady<FieldsMetadata, DeductionFormData, DeductionFormFields> {
|
|
42
|
+
data: {
|
|
43
|
+
/** The garnishment loaded for update; `null` in create mode. */
|
|
44
|
+
deduction: Garnishment | null;
|
|
45
|
+
};
|
|
46
|
+
status: {
|
|
47
|
+
isPending: boolean;
|
|
48
|
+
mode: 'create' | 'update';
|
|
49
|
+
/**
|
|
50
|
+
* Mirrors the watched `recurring` value. Cap fields (`TotalAmount`,
|
|
51
|
+
* `AnnualMaximum`) are only included on `Fields` when this is true — the
|
|
52
|
+
* consumer can render them unconditionally and the gating happens in the
|
|
53
|
+
* hook.
|
|
54
|
+
*/
|
|
55
|
+
isRecurring: boolean;
|
|
56
|
+
};
|
|
57
|
+
actions: {
|
|
58
|
+
onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export type UseDeductionFormResult = HookLoadingResult | UseDeductionFormReady;
|
|
62
|
+
export declare function useDeductionForm({ employeeId, garnishmentId, courtOrdered, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseDeductionFormProps): UseDeductionFormResult;
|
|
63
|
+
export type DeductionFormFieldsMetadata = UseDeductionFormReady['form']['fieldsMetadata'];
|
|
64
|
+
export type DeductionFormFieldsType = UseDeductionFormReady['form']['Fields'];
|