@gusto/embedded-react-sdk 0.44.0 → 0.44.2

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.
Files changed (170) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/Base/useBaseSubmit.js +6 -6
  3. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  4. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
  5. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +1 -1
  6. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  7. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +1 -1
  8. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  9. package/dist/components/Company/AssignSignatory/TitleSelect.js +1 -1
  10. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  11. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +1 -1
  12. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  13. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +1 -1
  14. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +1 -1
  15. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +1 -1
  16. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -9
  17. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  18. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  19. package/dist/components/Company/FederalTaxes/Actions.js +1 -1
  20. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  21. package/dist/components/Company/Industry/Actions.js +1 -1
  22. package/dist/components/Company/Industry/Context.js +1 -1
  23. package/dist/components/Company/Industry/Edit.js +1 -1
  24. package/dist/components/Company/Locations/LocationForm/Actions.js +1 -1
  25. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  26. package/dist/components/Company/Locations/LocationsList/Actions.js +1 -1
  27. package/dist/components/Company/Locations/LocationsList/List.js +1 -1
  28. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  29. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  30. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
  31. package/dist/components/Company/PaySchedule/PaySchedule.js +6 -6
  32. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  33. package/dist/components/Company/PaySchedule/PayScheduleList.js +8 -8
  34. package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
  35. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +3 -3
  36. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +12 -12
  37. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
  38. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +1 -1
  39. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  40. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +1 -1
  41. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  42. package/dist/components/Contractor/Address/Address.js +16 -16
  43. package/dist/components/Contractor/Address/Address.js.map +1 -1
  44. package/dist/components/Contractor/Address/Form.js +4 -4
  45. package/dist/components/Contractor/Address/useAddress.js +1 -1
  46. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +8 -8
  47. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  48. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
  49. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +5 -5
  50. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  51. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  52. package/dist/components/Contractor/Submit/Submit.js +22 -20
  53. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  54. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +1 -1
  55. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +6 -6
  56. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  57. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +3 -3
  58. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
  59. package/dist/components/Employee/Deductions/Deductions.js +7 -7
  60. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  61. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +24 -24
  62. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  63. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -9
  64. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  65. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -2
  66. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  67. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +1 -2
  68. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +17 -17
  69. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  70. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +30 -30
  71. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  72. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +1 -1
  73. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -8
  74. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  75. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  76. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +1 -1
  77. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  78. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +12 -12
  79. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  80. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +1 -1
  81. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  82. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +1 -1
  83. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +1 -1
  84. package/dist/components/Employee/PaymentMethod/Actions.js +1 -1
  85. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
  86. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +1 -1
  87. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +14 -14
  88. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  89. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  90. package/dist/components/Employee/PaymentMethod/Split.js +1 -1
  91. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  92. package/dist/components/Employee/Profile/management/Profile.js +1 -1
  93. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +1 -1
  94. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
  95. package/dist/components/Employee/StateTaxes/management/StateTaxes.js +1 -1
  96. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +1 -1
  97. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +19 -17
  98. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
  99. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.module.scss.js +8 -0
  100. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.module.scss.js.map +1 -0
  101. package/dist/components/Employee/Taxes/Actions.js +1 -1
  102. package/dist/components/Employee/Taxes/FederalForm.js +1 -1
  103. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  104. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +11 -11
  105. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  106. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +3 -3
  107. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
  108. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +40 -45
  109. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  110. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +1 -1
  111. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  112. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +17 -17
  113. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  114. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +7 -7
  115. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
  116. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +1 -1
  117. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
  118. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -1
  119. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +1 -1
  120. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +10 -10
  121. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  122. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -2
  123. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +21 -25
  124. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  125. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
  126. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  127. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
  128. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
  129. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  130. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +4 -4
  131. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  132. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
  133. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  134. package/dist/components/Payroll/PayrollList/PayrollList.js +4 -4
  135. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  136. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -2
  137. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  138. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +5 -5
  139. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  140. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -1
  141. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  142. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +7 -7
  143. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  144. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +1 -1
  145. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +70 -53
  146. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  147. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +1 -1
  148. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
  149. package/dist/components/Payroll/helpers.d.ts +1 -1
  150. package/dist/components/Payroll/helpers.js.map +1 -1
  151. package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
  152. package/dist/components/Payroll/usePreparedPayrollData.js +10 -10
  153. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  154. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +1 -1
  155. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +41 -41
  156. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  157. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +1 -1
  158. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +1 -1
  159. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
  160. package/dist/helpers/dateFormatting.js +52 -56
  161. package/dist/helpers/dateFormatting.js.map +1 -1
  162. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +1 -1
  163. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +1 -1
  164. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +1 -1
  165. package/dist/partner-hook-utils/form/fields/SelectHookField.js +1 -1
  166. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +1 -1
  167. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +1 -1
  168. package/dist/style.css +1 -1
  169. package/dist/test-utils/assertions.d.ts +4 -0
  170. package/package.json +13 -10
@@ -13,7 +13,7 @@ import { useBase as Q } from "../../Base/useBase.js";
13
13
  import "@gusto/embedded-api/models/errors/apierror";
14
14
  import "@gusto/embedded-api/models/errors/gustoembeddederror";
15
15
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
16
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
16
+ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
17
17
  import { SDKInternalError as Y } from "../../../types/sdkError.js";
18
18
  import { ContractorSelfOnboardingStatuses as x, componentEvents as b, ContractorOnboardingStatus as ee } from "../../../shared/constants.js";
19
19
  import "classnames";
@@ -1,4 +1,4 @@
1
- import { jsx as t, jsxs as r } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { useContractorsUpdateOnboardingStatusMutation as v } from "@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus";
4
4
  import { useContractorsGetOnboardingStatusSuspense as B } from "@gusto/embedded-api/react-query/contractorsGetOnboardingStatus";
@@ -16,16 +16,18 @@ import { firstLastName as G } from "../../../helpers/formattedStrings.js";
16
16
  function nt(n) {
17
17
  return /* @__PURE__ */ t(j, { ...n, children: /* @__PURE__ */ t(w, { ...n, children: n.children }) });
18
18
  }
19
- const w = ({ contractorId: n, selfOnboarding: d, dictionary: o }) => {
20
- y("Contractor.Submit"), L("Contractor.Submit", o);
21
- const { Alert: l, Box: C, BoxHeader: i, Button: O, Text: s, Heading: D, UnorderedList: S } = f(), { t: e } = p("Contractor.Submit"), { onEvent: a, baseSubmitHandler: T } = q(), g = Object.values(e("warningItems", { returnObjects: !0 })), { data: N } = B({
19
+ const w = ({ contractorId: n, selfOnboarding: d, dictionary: r }) => {
20
+ y("Contractor.Submit"), L("Contractor.Submit", r);
21
+ const { Alert: l, Box: C, BoxHeader: i, Button: O, Text: s, Heading: S, UnorderedList: D } = f(), { t: e } = p("Contractor.Submit"), { onEvent: a, baseSubmitHandler: T } = q(), g = Object.values(e("warningItems", { returnObjects: !0 })), { data: N } = B({
22
22
  contractorUuid: n
23
23
  }), h = N.contractorOnboardingStatus?.onboardingStatus, { mutateAsync: R } = v(), _ = async () => {
24
24
  await T(null, async () => {
25
25
  const c = await R({
26
26
  request: {
27
27
  contractorUuid: n,
28
- requestBody: { onboardingStatus: b.ONBOARDING_COMPLETED }
28
+ contractorOnboardingStatusUpdateRequestBody: {
29
+ onboardingStatus: b.ONBOARDING_COMPLETED
30
+ }
29
31
  }
30
32
  });
31
33
  a(
@@ -43,8 +45,8 @@ const w = ({ contractorId: n, selfOnboarding: d, dictionary: o }) => {
43
45
  message: e("submitDone.successMessage")
44
46
  });
45
47
  };
46
- return h === b.ONBOARDING_COMPLETED ? /* @__PURE__ */ t(I, { onDone: A }) : h === b.SELF_ONBOARDING_NOT_INVITED && d ? /* @__PURE__ */ t(H, { onSubmit: x, contractorId: n }) : /* @__PURE__ */ r(m, { flexDirection: "column", gap: 24, children: [
47
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(D, { as: "h2", children: e("heading") }) }),
48
+ return h === b.ONBOARDING_COMPLETED ? /* @__PURE__ */ t(I, { onDone: A }) : h === b.SELF_ONBOARDING_NOT_INVITED && d ? /* @__PURE__ */ t(H, { onSubmit: x, contractorId: n }) : /* @__PURE__ */ o(m, { flexDirection: "column", gap: 24, children: [
49
+ /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(S, { as: "h2", children: e("heading") }) }),
48
50
  /* @__PURE__ */ t(
49
51
  C,
50
52
  {
@@ -55,8 +57,8 @@ const w = ({ contractorId: n, selfOnboarding: d, dictionary: o }) => {
55
57
  description: e("documentRequirements.description")
56
58
  }
57
59
  ),
58
- children: /* @__PURE__ */ r(m, { flexDirection: "column", gap: 16, children: [
59
- Object.values(e("documentRequirements.items", { returnObjects: !0 })).map((c) => /* @__PURE__ */ r("div", { children: [
60
+ children: /* @__PURE__ */ o(m, { flexDirection: "column", gap: 16, children: [
61
+ Object.values(e("documentRequirements.items", { returnObjects: !0 })).map((c) => /* @__PURE__ */ o("div", { children: [
60
62
  /* @__PURE__ */ t(s, { weight: "medium", children: c.title }),
61
63
  /* @__PURE__ */ t(s, { variant: "supporting", children: c.description })
62
64
  ] }, c.title)),
@@ -64,8 +66,8 @@ const w = ({ contractorId: n, selfOnboarding: d, dictionary: o }) => {
64
66
  ] })
65
67
  }
66
68
  ),
67
- /* @__PURE__ */ r(m, { flexDirection: "column", gap: 8, children: [
68
- /* @__PURE__ */ t(l, { status: "warning", label: e("title"), children: /* @__PURE__ */ t(S, { items: g }) }),
69
+ /* @__PURE__ */ o(m, { flexDirection: "column", gap: 8, children: [
70
+ /* @__PURE__ */ t(l, { status: "warning", label: e("title"), children: /* @__PURE__ */ t(D, { items: g }) }),
69
71
  /* @__PURE__ */ t(M, { justifyContent: "end", children: /* @__PURE__ */ t(O, { title: e("submitCta"), onClick: _, children: e("submitCta") }) })
70
72
  ] })
71
73
  ] });
@@ -73,24 +75,24 @@ const w = ({ contractorId: n, selfOnboarding: d, dictionary: o }) => {
73
75
  onSubmit: n,
74
76
  contractorId: d
75
77
  }) => {
76
- const { t: o } = p("Contractor.Submit", { keyPrefix: "inviteContractor" }), { Button: l, Heading: C, Text: i } = f(), { data: O } = E({ contractorUuid: d }), s = O.contractor;
77
- return /* @__PURE__ */ r(m, { flexDirection: "column", children: [
78
- /* @__PURE__ */ t(C, { as: "h2", children: o("title") }),
79
- /* @__PURE__ */ t(i, { children: o("description") }),
80
- /* @__PURE__ */ r(m, { flexDirection: "column", children: [
81
- /* @__PURE__ */ r("div", { children: [
78
+ const { t: r } = p("Contractor.Submit", { keyPrefix: "inviteContractor" }), { Button: l, Heading: C, Text: i } = f(), { data: O } = E({ contractorUuid: d }), s = O.contractor;
79
+ return /* @__PURE__ */ o(m, { flexDirection: "column", children: [
80
+ /* @__PURE__ */ t(C, { as: "h2", children: r("title") }),
81
+ /* @__PURE__ */ t(i, { children: r("description") }),
82
+ /* @__PURE__ */ o(m, { flexDirection: "column", children: [
83
+ /* @__PURE__ */ o("div", { children: [
82
84
  /* @__PURE__ */ t(i, { children: G({
83
85
  first_name: s?.firstName,
84
86
  last_name: s?.lastName
85
87
  }) }),
86
88
  /* @__PURE__ */ t(i, { children: s?.email })
87
89
  ] }),
88
- /* @__PURE__ */ r("div", { children: [
89
- /* @__PURE__ */ t(i, { children: o("startDateLabel") }),
90
+ /* @__PURE__ */ o("div", { children: [
91
+ /* @__PURE__ */ t(i, { children: r("startDateLabel") }),
90
92
  /* @__PURE__ */ t(i, { children: s?.startDate })
91
93
  ] })
92
94
  ] }),
93
- /* @__PURE__ */ t(l, { title: o("inviteCta"), onClick: n, children: o("inviteCta") })
95
+ /* @__PURE__ */ t(l, { title: r("inviteCta"), onClick: n, children: r("inviteCta") })
94
96
  ] });
95
97
  };
96
98
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Submit.js","sources":["../../../../src/components/Contractor/Submit/Submit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractorsGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/contractorsGetOnboardingStatus'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport { SubmitDone } from './SubmitDone'\nimport { ActionsLayout, Flex, FlexItem } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { componentEvents, ContractorOnboardingStatus } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\nexport interface ContractorSubmitProps extends CommonComponentInterface<'Contractor.Submit'> {\n contractorId: string\n selfOnboarding?: boolean\n}\n\nexport function ContractorSubmit(props: ContractorSubmitProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ contractorId, selfOnboarding, dictionary }: ContractorSubmitProps) => {\n useI18n('Contractor.Submit')\n useComponentDictionary('Contractor.Submit', dictionary)\n const { Alert, Box, BoxHeader, Button, Text, Heading, UnorderedList } = useComponentContext()\n const { t } = useTranslation('Contractor.Submit')\n const { onEvent, baseSubmitHandler } = useBase()\n const items = Object.values(t('warningItems', { returnObjects: true }))\n\n const { data } = useContractorsGetOnboardingStatusSuspense({\n contractorUuid: contractorId,\n })\n const onboardingStatus = data.contractorOnboardingStatus?.onboardingStatus\n\n const { mutateAsync } = useContractorsUpdateOnboardingStatusMutation()\n\n const onSubmit = async () => {\n await baseSubmitHandler(null, async () => {\n const response = await mutateAsync({\n request: {\n contractorUuid: contractorId,\n requestBody: { onboardingStatus: ContractorOnboardingStatus.ONBOARDING_COMPLETED },\n },\n })\n onEvent(\n componentEvents.CONTRACTOR_ONBOARDING_STATUS_UPDATED,\n response.contractorOnboardingStatus,\n )\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, { message: t('submitDone.successMessage') })\n })\n }\n const handleInviteContractor = () => {\n onEvent(componentEvents.CONTRACTOR_INVITE_CONTRACTOR, { contractorId })\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n message: t('inviteContractor.successMessage'),\n })\n }\n\n const handleSubmitDone = () => {\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n onboardingStatus,\n message: t('submitDone.successMessage'),\n })\n }\n\n if (onboardingStatus === ContractorOnboardingStatus.ONBOARDING_COMPLETED) {\n return <SubmitDone onDone={handleSubmitDone} />\n }\n if (\n onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_NOT_INVITED &&\n selfOnboarding\n ) {\n return <InviteContractor onSubmit={handleInviteContractor} contractorId={contractorId} />\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">{t('heading')}</Heading>\n </FlexItem>\n\n <Box\n header={\n <BoxHeader\n title={t('documentRequirements.title')}\n description={t('documentRequirements.description')}\n />\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Object.values(t('documentRequirements.items', { returnObjects: true })).map(item => (\n <div key={item.title}>\n <Text weight=\"medium\">{item.title}</Text>\n <Text variant=\"supporting\">{item.description}</Text>\n </div>\n ))}\n <Alert status=\"info\" label={t('documentRequirements.alertLabel')}></Alert>\n </Flex>\n </Box>\n <Flex flexDirection=\"column\" gap={8}>\n <Alert status=\"warning\" label={t('title')}>\n <UnorderedList items={items} />\n </Alert>\n <ActionsLayout justifyContent=\"end\">\n <Button title={t('submitCta')} onClick={onSubmit}>\n {t('submitCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n )\n}\n\nconst InviteContractor = ({\n onSubmit,\n contractorId,\n}: {\n onSubmit: () => void\n contractorId: string\n}) => {\n const { t } = useTranslation('Contractor.Submit', { keyPrefix: 'inviteContractor' })\n const { Button, Heading, Text } = useComponentContext()\n\n const { data: contractorData } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const contractor = contractorData.contractor\n\n return (\n <Flex flexDirection=\"column\">\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>{t('description')}</Text>\n <Flex flexDirection=\"column\">\n <div>\n <Text>\n {firstLastName({\n first_name: contractor?.firstName,\n last_name: contractor?.lastName,\n })}\n </Text>\n <Text>{contractor?.email}</Text>\n </div>\n <div>\n <Text>{t('startDateLabel')}</Text>\n <Text>{contractor?.startDate}</Text>\n </div>\n </Flex>\n <Button title={t('inviteCta')} onClick={onSubmit}>\n {t('inviteCta')}\n </Button>\n </Flex>\n )\n}\n"],"names":["ContractorSubmit","props","jsx","BaseComponent","Root","contractorId","selfOnboarding","dictionary","useI18n","useComponentDictionary","Alert","Box","BoxHeader","Button","Text","Heading","UnorderedList","useComponentContext","t","useTranslation","onEvent","baseSubmitHandler","useBase","items","data","useContractorsGetOnboardingStatusSuspense","onboardingStatus","mutateAsync","useContractorsUpdateOnboardingStatusMutation","onSubmit","response","ContractorOnboardingStatus","componentEvents","handleInviteContractor","handleSubmitDone","SubmitDone","InviteContractor","jsxs","Flex","FlexItem","item","ActionsLayout","contractorData","useContractorsGetSuspense","contractor","firstLastName"],"mappings":";;;;;;;;;;;;;;;AA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AC3B;AAAA,wBACC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAA1C,EAACY,GAAA,EAAM,UAAAI,EAAE,gBAAgB,EAAA,CAAE;AAAA,QAC3B,gBAAAhB,EAACY,GAAA,EAAM,UAAA8B,GAAY,UAAA,CAAU;AAAA,MAAA,EAAA,CAC/B;AAAA,IAAA,GACF;AAAA,IACA,gBAAA1C,EAACW,GAAA,EAAO,OAAOK,EAAE,WAAW,GAAG,SAASW,GACrC,UAAAX,EAAE,WAAW,EAAA,CAChB;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Submit.js","sources":["../../../../src/components/Contractor/Submit/Submit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractorsGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/contractorsGetOnboardingStatus'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport { SubmitDone } from './SubmitDone'\nimport { ActionsLayout, Flex, FlexItem } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { componentEvents, ContractorOnboardingStatus } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\nexport interface ContractorSubmitProps extends CommonComponentInterface<'Contractor.Submit'> {\n contractorId: string\n selfOnboarding?: boolean\n}\n\nexport function ContractorSubmit(props: ContractorSubmitProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ contractorId, selfOnboarding, dictionary }: ContractorSubmitProps) => {\n useI18n('Contractor.Submit')\n useComponentDictionary('Contractor.Submit', dictionary)\n const { Alert, Box, BoxHeader, Button, Text, Heading, UnorderedList } = useComponentContext()\n const { t } = useTranslation('Contractor.Submit')\n const { onEvent, baseSubmitHandler } = useBase()\n const items = Object.values(t('warningItems', { returnObjects: true }))\n\n const { data } = useContractorsGetOnboardingStatusSuspense({\n contractorUuid: contractorId,\n })\n const onboardingStatus = data.contractorOnboardingStatus?.onboardingStatus\n\n const { mutateAsync } = useContractorsUpdateOnboardingStatusMutation()\n\n const onSubmit = async () => {\n await baseSubmitHandler(null, async () => {\n const response = await mutateAsync({\n request: {\n contractorUuid: contractorId,\n contractorOnboardingStatusUpdateRequestBody: {\n onboardingStatus: ContractorOnboardingStatus.ONBOARDING_COMPLETED,\n },\n },\n })\n onEvent(\n componentEvents.CONTRACTOR_ONBOARDING_STATUS_UPDATED,\n response.contractorOnboardingStatus,\n )\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, { message: t('submitDone.successMessage') })\n })\n }\n const handleInviteContractor = () => {\n onEvent(componentEvents.CONTRACTOR_INVITE_CONTRACTOR, { contractorId })\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n message: t('inviteContractor.successMessage'),\n })\n }\n\n const handleSubmitDone = () => {\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n onboardingStatus,\n message: t('submitDone.successMessage'),\n })\n }\n\n if (onboardingStatus === ContractorOnboardingStatus.ONBOARDING_COMPLETED) {\n return <SubmitDone onDone={handleSubmitDone} />\n }\n if (\n onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_NOT_INVITED &&\n selfOnboarding\n ) {\n return <InviteContractor onSubmit={handleInviteContractor} contractorId={contractorId} />\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">{t('heading')}</Heading>\n </FlexItem>\n\n <Box\n header={\n <BoxHeader\n title={t('documentRequirements.title')}\n description={t('documentRequirements.description')}\n />\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Object.values(t('documentRequirements.items', { returnObjects: true })).map(item => (\n <div key={item.title}>\n <Text weight=\"medium\">{item.title}</Text>\n <Text variant=\"supporting\">{item.description}</Text>\n </div>\n ))}\n <Alert status=\"info\" label={t('documentRequirements.alertLabel')}></Alert>\n </Flex>\n </Box>\n <Flex flexDirection=\"column\" gap={8}>\n <Alert status=\"warning\" label={t('title')}>\n <UnorderedList items={items} />\n </Alert>\n <ActionsLayout justifyContent=\"end\">\n <Button title={t('submitCta')} onClick={onSubmit}>\n {t('submitCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n )\n}\n\nconst InviteContractor = ({\n onSubmit,\n contractorId,\n}: {\n onSubmit: () => void\n contractorId: string\n}) => {\n const { t } = useTranslation('Contractor.Submit', { keyPrefix: 'inviteContractor' })\n const { Button, Heading, Text } = useComponentContext()\n\n const { data: contractorData } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const contractor = contractorData.contractor\n\n return (\n <Flex flexDirection=\"column\">\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>{t('description')}</Text>\n <Flex flexDirection=\"column\">\n <div>\n <Text>\n {firstLastName({\n first_name: contractor?.firstName,\n last_name: contractor?.lastName,\n })}\n </Text>\n <Text>{contractor?.email}</Text>\n </div>\n <div>\n <Text>{t('startDateLabel')}</Text>\n <Text>{contractor?.startDate}</Text>\n </div>\n </Flex>\n <Button title={t('inviteCta')} onClick={onSubmit}>\n {t('inviteCta')}\n </Button>\n </Flex>\n )\n}\n"],"names":["ContractorSubmit","props","jsx","BaseComponent","Root","contractorId","selfOnboarding","dictionary","useI18n","useComponentDictionary","Alert","Box","BoxHeader","Button","Text","Heading","UnorderedList","useComponentContext","t","useTranslation","onEvent","baseSubmitHandler","useBase","items","data","useContractorsGetOnboardingStatusSuspense","onboardingStatus","mutateAsync","useContractorsUpdateOnboardingStatusMutation","onSubmit","response","ContractorOnboardingStatus","componentEvents","handleInviteContractor","handleSubmitDone","SubmitDone","InviteContractor","jsxs","Flex","FlexItem","item","ActionsLayout","contractorData","useContractors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1C,EAACY,GAAA,EAAM,UAAA8B,GAAY,MAAA,CAAM;AAAA,MAAA,GAC3B;AAAA,wBACC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAA1C,EAACY,GAAA,EAAM,UAAAI,EAAE,gBAAgB,EAAA,CAAE;AAAA,QAC3B,gBAAAhB,EAACY,GAAA,EAAM,UAAA8B,GAAY,UAAA,CAAU;AAAA,MAAA,EAAA,CAC/B;AAAA,IAAA,GACF;AAAA,IACA,gBAAA1C,EAACW,GAAA,EAAO,OAAOK,EAAE,WAAW,GAAG,SAASW,GACrC,UAAAX,EAAE,WAAW,EAAA,CAChB;AAAA,EAAA,GACF;AAEJ;"}
@@ -5,7 +5,7 @@ import { GetV1EmployeesEmployeeIdBankAccountsResponse } from '@gusto/embedded-ap
5
5
  import { GetV1EmployeesEmployeeUuidPayStubsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeuuidpaystubs';
6
6
  import { HookLoadingResult, BaseHookReady } from '../../../../partner-hook-utils/types';
7
7
  import { PaginationControlProps } from '../../../Common/PaginationControl/PaginationControlTypes';
8
- type EmployeeBankAccount = NonNullable<GetV1EmployeesEmployeeIdBankAccountsResponse['employeeBankAccountList']>[number];
8
+ type EmployeeBankAccount = NonNullable<GetV1EmployeesEmployeeIdBankAccountsResponse['employeeBankAccounts']>[number];
9
9
  type EmployeePayStub = NonNullable<GetV1EmployeesEmployeeUuidPayStubsResponse['employeePayStubsList']>[number];
10
10
  export interface UseEmployeeCompensationProps {
11
11
  employeeId: string;
@@ -1,5 +1,5 @@
1
1
  import { useMemo as u } from "react";
2
- import { useEmployeesGetSuspense as F } from "@gusto/embedded-api/react-query/employeesGet";
2
+ import { useEmployeesGetSuspense as L } from "@gusto/embedded-api/react-query/employeesGet";
3
3
  import { useEmployeePaymentMethodGetSuspense as k } from "@gusto/embedded-api/react-query/employeePaymentMethodGet";
4
4
  import { useEmployeePaymentMethodsGetBankAccountsSuspense as A } from "@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts";
5
5
  import { useGarnishmentsListSuspense as E } from "@gusto/embedded-api/react-query/garnishmentsList";
@@ -11,21 +11,21 @@ function w({
11
11
  }) {
12
12
  const { currentPage: h, itemsPerPage: d, getPaginationProps: p } = j({
13
13
  defaultItemsPerPage: 10
14
- }), s = F({ employeeId: e }), n = k({ employeeId: e }), o = A({ employeeId: e }), a = E({ employeeId: e }), t = G({
14
+ }), s = L({ employeeId: e }), n = k({ employeeId: e }), o = A({ employeeId: e }), a = E({ employeeId: e }), t = G({
15
15
  employeeId: e,
16
16
  page: h,
17
17
  per: d
18
- }), r = s.data.employee, P = n.data.employeePaymentMethod, c = o.data, l = a.data.garnishmentList, i = t.data, b = u(() => r?.jobs?.find((m) => m.primary === !0), [r?.jobs]), f = u(() => c.employeeBankAccountList || [], [c]), S = i.employeePayStubsList || [], L = u(() => {
18
+ }), r = s.data.employee, P = n.data.employeePaymentMethod, c = o.data, l = a.data.garnishments, i = t.data, b = u(() => r?.jobs?.find((m) => m.primary === !0), [r?.jobs]), f = u(() => c.employeeBankAccounts || [], [c]), S = i.employeePayStubsList || [], M = u(() => {
19
19
  const m = i.httpMeta.response.headers;
20
20
  return p(m, t.isFetching);
21
- }, [i.httpMeta.response.headers, t.isFetching, p]), y = s.isFetching || n.isFetching || o.isFetching || a.isFetching || t.isFetching, M = !r && y, g = Q([
21
+ }, [i.httpMeta.response.headers, t.isFetching, p]), y = s.isFetching || n.isFetching || o.isFetching || a.isFetching || t.isFetching, F = !r && y, g = Q([
22
22
  s,
23
23
  n,
24
24
  o,
25
25
  a,
26
26
  t
27
27
  ]);
28
- return M ? {
28
+ return F ? {
29
29
  isLoading: !0,
30
30
  errorHandling: g
31
31
  } : {
@@ -41,7 +41,7 @@ function w({
41
41
  isPending: y
42
42
  },
43
43
  pagination: {
44
- payStubs: L
44
+ payStubs: M
45
45
  },
46
46
  errorHandling: g
47
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useEmployeeCompensation.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeCompensation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeePaymentMethodGetSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodGet'\nimport { useEmployeePaymentMethodsGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { usePayrollsGetPayStubsSuspense } from '@gusto/embedded-api/react-query/payrollsGetPayStubs'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { GetV1EmployeesEmployeeIdPaymentMethodResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidpaymentmethod'\nimport type { GetV1EmployeesEmployeeIdBankAccountsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidbankaccounts'\nimport type { GetV1EmployeesEmployeeUuidPayStubsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeuuidpaystubs'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\nimport type { HookLoadingResult, BaseHookReady } from '@/partner-hook-utils/types'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\n// Derive types from operations responses\ntype EmployeeBankAccount = NonNullable<\n GetV1EmployeesEmployeeIdBankAccountsResponse['employeeBankAccountList']\n>[number]\ntype EmployeePayStub = NonNullable<\n GetV1EmployeesEmployeeUuidPayStubsResponse['employeePayStubsList']\n>[number]\n\nexport interface UseEmployeeCompensationProps {\n employeeId: string\n}\n\ninterface UseEmployeeCompensationReady extends BaseHookReady<\n {\n primaryJob?: Job\n employeePaymentMethod?: NonNullable<\n GetV1EmployeesEmployeeIdPaymentMethodResponse['employeePaymentMethod']\n >\n bankAccounts: EmployeeBankAccount[]\n garnishmentList: Garnishment[]\n payStubs: EmployeePayStub[]\n },\n { isPending: boolean }\n> {\n pagination: {\n payStubs?: PaginationControlProps\n }\n}\n\nexport type UseEmployeeCompensationResult = HookLoadingResult | UseEmployeeCompensationReady\n\nexport function useEmployeeCompensation({\n employeeId,\n}: UseEmployeeCompensationProps): UseEmployeeCompensationResult {\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination({\n defaultItemsPerPage: 10,\n })\n\n const employeeQuery = useEmployeesGetSuspense({ employeeId })\n const paymentMethodQuery = useEmployeePaymentMethodGetSuspense({ employeeId })\n const bankAccountsQuery = useEmployeePaymentMethodsGetBankAccountsSuspense({ employeeId })\n const garnishmentsQuery = useGarnishmentsListSuspense({ employeeId })\n const payStubsQuery = usePayrollsGetPayStubsSuspense({\n employeeId,\n page: currentPage,\n per: itemsPerPage,\n })\n\n const employee = employeeQuery.data.employee\n const employeePaymentMethod = paymentMethodQuery.data.employeePaymentMethod\n const bankAccountsData = bankAccountsQuery.data\n const garnishmentList = garnishmentsQuery.data.garnishmentList\n const payStubsData = payStubsQuery.data\n\n // Derive primary job\n const primaryJob = useMemo(() => {\n return employee?.jobs?.find(job => job.primary === true)\n }, [employee?.jobs])\n\n // Derive bank accounts\n const bankAccounts = useMemo(() => {\n return bankAccountsData.employeeBankAccountList || []\n }, [bankAccountsData])\n\n // Extract paystubs from response\n const payStubs = payStubsData.employeePayStubsList || []\n\n // Extract pagination from API response headers\n const payStubsPagination = useMemo(() => {\n const headers = payStubsData.httpMeta.response.headers\n return getPaginationProps(headers, payStubsQuery.isFetching)\n }, [payStubsData.httpMeta.response.headers, payStubsQuery.isFetching, getPaginationProps])\n\n const isPending =\n employeeQuery.isFetching ||\n paymentMethodQuery.isFetching ||\n bankAccountsQuery.isFetching ||\n garnishmentsQuery.isFetching ||\n payStubsQuery.isFetching\n\n const isLoading = !employee && isPending\n\n const errorHandling = composeErrorHandler([\n employeeQuery,\n paymentMethodQuery,\n bankAccountsQuery,\n garnishmentsQuery,\n payStubsQuery,\n ])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n primaryJob,\n employeePaymentMethod: employeePaymentMethod || undefined,\n bankAccounts,\n garnishmentList: garnishmentList || [],\n payStubs,\n },\n status: {\n isPending,\n },\n pagination: {\n payStubs: payStubsPagination,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeCompensation","employeeId","currentPage","itemsPerPage","getPaginationProps","usePagination","employeeQuery","useEmployeesGetSuspense","paymentMethodQuery","useEmployeePaymentMethodGetSuspense","bankAccountsQuery","useEmployeePaymentMethodsGetBankAccountsSuspense","garnishmentsQuery","useGarnishmentsListSuspense","payStubsQuery","usePayrollsGetPayStubsSuspense","employee","employeePaymentMethod","bankAccountsData","garnishmentList","payStubsData","primaryJob","useMemo","job","bankAccounts","payStubs","payStubsPagination","headers","isPending","isLoading","errorHandling","composeErrorHandler"],"mappings":";;;;;;;;AA+CO,SAASA,EAAwB;AAAA,EACtC,YAAAC;AACF,GAAgE;AAC9D,QAAM,EAAE,aAAAC,GAAa,cAAAC,GAAc,oBAAAC,EAAA,IAAuBC,EAAc;AAAA,IACtE,qBAAqB;AAAA,EAAA,CACtB,GAEKC,IAAgBC,EAAwB,EAAE,YAAAN,GAAY,GACtDO,IAAqBC,EAAoC,EAAE,YAAAR,GAAY,GACvES,IAAoBC,EAAiD,EAAE,YAAAV,GAAY,GACnFW,IAAoBC,EAA4B,EAAE,YAAAZ,GAAY,GAC9Da,IAAgBC,EAA+B;AAAA,IACnD,YAAAd;AAAA,IACA,MAAMC;AAAA,IACN,KAAKC;AAAA,EAAA,CACN,GAEKa,IAAWV,EAAc,KAAK,UAC9BW,IAAwBT,EAAmB,KAAK,uBAChDU,IAAmBR,EAAkB,MACrCS,IAAkBP,EAAkB,KAAK,iBACzCQ,IAAeN,EAAc,MAG7BO,IAAaC,EAAQ,MAClBN,GAAU,MAAM,KAAK,CAAAO,MAAOA,EAAI,YAAY,EAAI,GACtD,CAACP,GAAU,IAAI,CAAC,GAGbQ,IAAeF,EAAQ,MACpBJ,EAAiB,2BAA2B,CAAA,GAClD,CAACA,CAAgB,CAAC,GAGfO,IAAWL,EAAa,wBAAwB,CAAA,GAGhDM,IAAqBJ,EAAQ,MAAM;AACvC,UAAMK,IAAUP,EAAa,SAAS,SAAS;AAC/C,WAAOhB,EAAmBuB,GAASb,EAAc,UAAU;AAAA,EAC7D,GAAG,CAACM,EAAa,SAAS,SAAS,SAASN,EAAc,YAAYV,CAAkB,CAAC,GAEnFwB,IACJtB,EAAc,cACdE,EAAmB,cACnBE,EAAkB,cAClBE,EAAkB,cAClBE,EAAc,YAEVe,IAAY,CAACb,KAAYY,GAEzBE,IAAgBC,EAAoB;AAAA,IACxCzB;AAAA,IACAE;AAAA,IACAE;AAAA,IACAE;AAAA,IACAE;AAAA,EAAA,CACD;AAED,SAAIe,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,YAAAT;AAAA,MACA,uBAAuBJ,KAAyB;AAAA,MAChD,cAAAO;AAAA,MACA,iBAAiBL,KAAmB,CAAA;AAAA,MACpC,UAAAM;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAG;AAAA,IAAA;AAAA,IAEF,YAAY;AAAA,MACV,UAAUF;AAAA,IAAA;AAAA,IAEZ,eAAAI;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useEmployeeCompensation.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeCompensation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeePaymentMethodGetSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodGet'\nimport { useEmployeePaymentMethodsGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { usePayrollsGetPayStubsSuspense } from '@gusto/embedded-api/react-query/payrollsGetPayStubs'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { GetV1EmployeesEmployeeIdPaymentMethodResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidpaymentmethod'\nimport type { GetV1EmployeesEmployeeIdBankAccountsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidbankaccounts'\nimport type { GetV1EmployeesEmployeeUuidPayStubsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeuuidpaystubs'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\nimport type { HookLoadingResult, BaseHookReady } from '@/partner-hook-utils/types'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\n// Derive types from operations responses\ntype EmployeeBankAccount = NonNullable<\n GetV1EmployeesEmployeeIdBankAccountsResponse['employeeBankAccounts']\n>[number]\ntype EmployeePayStub = NonNullable<\n GetV1EmployeesEmployeeUuidPayStubsResponse['employeePayStubsList']\n>[number]\n\nexport interface UseEmployeeCompensationProps {\n employeeId: string\n}\n\ninterface UseEmployeeCompensationReady extends BaseHookReady<\n {\n primaryJob?: Job\n employeePaymentMethod?: NonNullable<\n GetV1EmployeesEmployeeIdPaymentMethodResponse['employeePaymentMethod']\n >\n bankAccounts: EmployeeBankAccount[]\n garnishmentList: Garnishment[]\n payStubs: EmployeePayStub[]\n },\n { isPending: boolean }\n> {\n pagination: {\n payStubs?: PaginationControlProps\n }\n}\n\nexport type UseEmployeeCompensationResult = HookLoadingResult | UseEmployeeCompensationReady\n\nexport function useEmployeeCompensation({\n employeeId,\n}: UseEmployeeCompensationProps): UseEmployeeCompensationResult {\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination({\n defaultItemsPerPage: 10,\n })\n\n const employeeQuery = useEmployeesGetSuspense({ employeeId })\n const paymentMethodQuery = useEmployeePaymentMethodGetSuspense({ employeeId })\n const bankAccountsQuery = useEmployeePaymentMethodsGetBankAccountsSuspense({ employeeId })\n const garnishmentsQuery = useGarnishmentsListSuspense({ employeeId })\n const payStubsQuery = usePayrollsGetPayStubsSuspense({\n employeeId,\n page: currentPage,\n per: itemsPerPage,\n })\n\n const employee = employeeQuery.data.employee\n const employeePaymentMethod = paymentMethodQuery.data.employeePaymentMethod\n const bankAccountsData = bankAccountsQuery.data\n const garnishmentList = garnishmentsQuery.data.garnishments\n const payStubsData = payStubsQuery.data\n\n // Derive primary job\n const primaryJob = useMemo(() => {\n return employee?.jobs?.find(job => job.primary === true)\n }, [employee?.jobs])\n\n // Derive bank accounts\n const bankAccounts = useMemo(() => {\n return bankAccountsData.employeeBankAccounts || []\n }, [bankAccountsData])\n\n // Extract paystubs from response\n const payStubs = payStubsData.employeePayStubsList || []\n\n // Extract pagination from API response headers\n const payStubsPagination = useMemo(() => {\n const headers = payStubsData.httpMeta.response.headers\n return getPaginationProps(headers, payStubsQuery.isFetching)\n }, [payStubsData.httpMeta.response.headers, payStubsQuery.isFetching, getPaginationProps])\n\n const isPending =\n employeeQuery.isFetching ||\n paymentMethodQuery.isFetching ||\n bankAccountsQuery.isFetching ||\n garnishmentsQuery.isFetching ||\n payStubsQuery.isFetching\n\n const isLoading = !employee && isPending\n\n const errorHandling = composeErrorHandler([\n employeeQuery,\n paymentMethodQuery,\n bankAccountsQuery,\n garnishmentsQuery,\n payStubsQuery,\n ])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n primaryJob,\n employeePaymentMethod: employeePaymentMethod || undefined,\n bankAccounts,\n garnishmentList: garnishmentList || [],\n payStubs,\n },\n status: {\n isPending,\n },\n pagination: {\n payStubs: payStubsPagination,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeCompensation","employeeId","currentPage","itemsPerPage","getPaginationProps","usePagination","employeeQuery","useEmployeesGetSuspense","paymentMethodQuery","useEmployeePaymentMethodGetSuspense","bankAccountsQuery","useEmployeePaymentMethodsGetBankAccountsSuspense","garnishmentsQuery","useGarnishmentsListSuspense","payStubsQuery","usePayrollsGetPayStubsSuspense","employee","employeePaymentMethod","bankAccountsData","garnishmentList","payStubsData","primaryJob","useMemo","job","bankAccounts","payStubs","payStubsPagination","headers","isPending","isLoading","errorHandling","composeErrorHandler"],"mappings":";;;;;;;;AA+CO,SAASA,EAAwB;AAAA,EACtC,YAAAC;AACF,GAAgE;AAC9D,QAAM,EAAE,aAAAC,GAAa,cAAAC,GAAc,oBAAAC,EAAA,IAAuBC,EAAc;AAAA,IACtE,qBAAqB;AAAA,EAAA,CACtB,GAEKC,IAAgBC,EAAwB,EAAE,YAAAN,GAAY,GACtDO,IAAqBC,EAAoC,EAAE,YAAAR,GAAY,GACvES,IAAoBC,EAAiD,EAAE,YAAAV,GAAY,GACnFW,IAAoBC,EAA4B,EAAE,YAAAZ,GAAY,GAC9Da,IAAgBC,EAA+B;AAAA,IACnD,YAAAd;AAAA,IACA,MAAMC;AAAA,IACN,KAAKC;AAAA,EAAA,CACN,GAEKa,IAAWV,EAAc,KAAK,UAC9BW,IAAwBT,EAAmB,KAAK,uBAChDU,IAAmBR,EAAkB,MACrCS,IAAkBP,EAAkB,KAAK,cACzCQ,IAAeN,EAAc,MAG7BO,IAAaC,EAAQ,MAClBN,GAAU,MAAM,KAAK,CAAAO,MAAOA,EAAI,YAAY,EAAI,GACtD,CAACP,GAAU,IAAI,CAAC,GAGbQ,IAAeF,EAAQ,MACpBJ,EAAiB,wBAAwB,CAAA,GAC/C,CAACA,CAAgB,CAAC,GAGfO,IAAWL,EAAa,wBAAwB,CAAA,GAGhDM,IAAqBJ,EAAQ,MAAM;AACvC,UAAMK,IAAUP,EAAa,SAAS,SAAS;AAC/C,WAAOhB,EAAmBuB,GAASb,EAAc,UAAU;AAAA,EAC7D,GAAG,CAACM,EAAa,SAAS,SAAS,SAASN,EAAc,YAAYV,CAAkB,CAAC,GAEnFwB,IACJtB,EAAc,cACdE,EAAmB,cACnBE,EAAkB,cAClBE,EAAkB,cAClBE,EAAc,YAEVe,IAAY,CAACb,KAAYY,GAEzBE,IAAgBC,EAAoB;AAAA,IACxCzB;AAAA,IACAE;AAAA,IACAE;AAAA,IACAE;AAAA,IACAE;AAAA,EAAA,CACD;AAED,SAAIe,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,YAAAT;AAAA,MACA,uBAAuBJ,KAAyB;AAAA,MAChD,cAAAO;AAAA,MACA,iBAAiBL,KAAmB,CAAA;AAAA,MACpC,UAAAM;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAG;AAAA,IAAA;AAAA,IAEF,YAAY;AAAA,MACV,UAAUF;AAAA,IAAA;AAAA,IAEZ,eAAAI;AAAA,EAAA;AAEJ;"}
@@ -1,8 +1,8 @@
1
- import { useEmployeeFormsListSuspense as n } from "@gusto/embedded-api/react-query/employeeFormsList";
1
+ import { useEmployeeFormsListSuspense as i } from "@gusto/embedded-api/react-query/employeeFormsList";
2
2
  import { composeErrorHandler as m } from "../../../../partner-hook-utils/composeErrorHandler.js";
3
3
  function u({ employeeId: e }) {
4
- const o = n({ employeeId: e }), s = o.data.formList, r = o.isFetching, i = !s && r, t = m([o]);
5
- return i ? {
4
+ const o = i({ employeeId: e }), s = o.data.forms, r = o.isFetching, n = !s && r, t = m([o]);
5
+ return n ? {
6
6
  isLoading: !0,
7
7
  errorHandling: t
8
8
  } : {
@@ -1 +1 @@
1
- {"version":3,"file":"useEmployeeForms.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeForms.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { HookLoadingResult, BaseHookReady } from '@/partner-hook-utils/types'\n\nexport interface UseEmployeeFormsProps {\n employeeId: string\n}\n\ntype UseEmployeeFormsReady = BaseHookReady<{ formList: Form[] }, { isPending: boolean }>\n\nexport type UseEmployeeFormsResult = HookLoadingResult | UseEmployeeFormsReady\n\nexport function useEmployeeForms({ employeeId }: UseEmployeeFormsProps): UseEmployeeFormsResult {\n const formsQuery = useEmployeeFormsListSuspense({ employeeId })\n\n const formList = formsQuery.data.formList\n\n const isPending = formsQuery.isFetching\n const isLoading = !formList && isPending\n\n const errorHandling = composeErrorHandler([formsQuery])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n formList: formList || [],\n },\n status: {\n isPending,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeForms","employeeId","formsQuery","useEmployeeFormsListSuspense","formList","isPending","isLoading","errorHandling","composeErrorHandler"],"mappings":";;AAaO,SAASA,EAAiB,EAAE,YAAAC,KAA6D;AAC9F,QAAMC,IAAaC,EAA6B,EAAE,YAAAF,GAAY,GAExDG,IAAWF,EAAW,KAAK,UAE3BG,IAAYH,EAAW,YACvBI,IAAY,CAACF,KAAYC,GAEzBE,IAAgBC,EAAoB,CAACN,CAAU,CAAC;AAEtD,SAAII,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,UAAUH,KAAY,CAAA;AAAA,IAAC;AAAA,IAEzB,QAAQ;AAAA,MACN,WAAAC;AAAA,IAAA;AAAA,IAEF,eAAAE;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useEmployeeForms.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeForms.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { HookLoadingResult, BaseHookReady } from '@/partner-hook-utils/types'\n\nexport interface UseEmployeeFormsProps {\n employeeId: string\n}\n\ntype UseEmployeeFormsReady = BaseHookReady<{ formList: Form[] }, { isPending: boolean }>\n\nexport type UseEmployeeFormsResult = HookLoadingResult | UseEmployeeFormsReady\n\nexport function useEmployeeForms({ employeeId }: UseEmployeeFormsProps): UseEmployeeFormsResult {\n const formsQuery = useEmployeeFormsListSuspense({ employeeId })\n\n const formList = formsQuery.data.forms\n\n const isPending = formsQuery.isFetching\n const isLoading = !formList && isPending\n\n const errorHandling = composeErrorHandler([formsQuery])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n formList: formList || [],\n },\n status: {\n isPending,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeForms","employeeId","formsQuery","useEmployeeFormsListSuspense","formList","isPending","isLoading","errorHandling","composeErrorHandler"],"mappings":";;AAaO,SAASA,EAAiB,EAAE,YAAAC,KAA6D;AAC9F,QAAMC,IAAaC,EAA6B,EAAE,YAAAF,GAAY,GAExDG,IAAWF,EAAW,KAAK,OAE3BG,IAAYH,EAAW,YACvBI,IAAY,CAACF,KAAYC,GAEzBE,IAAgBC,EAAoB,CAACN,CAAU,CAAC;AAEtD,SAAII,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,UAAUH,KAAY,CAAA;AAAA,IAAC;AAAA,IAEzB,QAAQ;AAAA,MACN,WAAAC;AAAA,IAAA;AAAA,IAEF,eAAAE;AAAA,EAAA;AAEJ;"}
@@ -9,13 +9,13 @@ import { DeductionsForm as C } from "./DeductionsForm/DeductionsForm.js";
9
9
  import { DeductionsList as F } from "./DeductionsList/DeductionsList.js";
10
10
  import { IncludeDeductions as g } from "./IncludeDeductions/IncludeDeductions.js";
11
11
  import { Flow as v } from "../../Flow/Flow.js";
12
- import { BaseComponent as L } from "../../Base/Base.js";
12
+ import { BaseComponent as E } from "../../Base/Base.js";
13
13
  import "../../Base/useBase.js";
14
- import { useComponentDictionary as E } from "../../../i18n/I18n.js";
15
- import { useFlow as I } from "../../Flow/useFlow.js";
14
+ import { useComponentDictionary as I } from "../../../i18n/I18n.js";
15
+ import { useFlow as L } from "../../Flow/useFlow.js";
16
16
  function M({ employeeId: o, onEvent: i, dictionary: r }) {
17
- E("Employee.Deductions", r);
18
- const { data: a } = f({ employeeId: o }), c = a.garnishmentList.filter((s) => s.active), t = d(
17
+ I("Employee.Deductions", r);
18
+ const { data: a } = f({ employeeId: o }), c = a.garnishments.filter((s) => s.active), t = d(
19
19
  () => c.length > 0,
20
20
  [c.length]
21
21
  ), m = t ? "viewDeductions" : "includeDeductions", u = t ? h : w, p = d(
@@ -35,10 +35,10 @@ function M({ employeeId: o, onEvent: i, dictionary: r }) {
35
35
  return /* @__PURE__ */ n(v, { machine: p, onEvent: i });
36
36
  }
37
37
  function e(o) {
38
- return /* @__PURE__ */ n(L, { ...o, children: /* @__PURE__ */ n(M, { ...o }) });
38
+ return /* @__PURE__ */ n(E, { ...o, children: /* @__PURE__ */ n(M, { ...o }) });
39
39
  }
40
40
  const N = () => {
41
- const { employeeId: o, onEvent: i } = I(), { t: r } = l("common");
41
+ const { employeeId: o, onEvent: i } = L(), { t: r } = l("common");
42
42
  if (!o)
43
43
  throw new Error(
44
44
  r("errors.missingParamsOrContext", {
@@ -1 +1 @@
1
- {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { createMachine } from 'robot3'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n IncludeDeductionsFormContextual,\n type DeductionsContextInterface,\n DeductionsListContextual,\n} from './DeductionsComponents'\nimport { deductionsStateMachine } from './stateMachine'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { IncludeDeductions } from './IncludeDeductions/IncludeDeductions'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\nfunction DeductionsFlow({ employeeId, onEvent, dictionary }: DeductionsProps) {\n useComponentDictionary('Employee.Deductions', dictionary)\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const hasExistingDeductions = useMemo(\n () => activeDeductions.length > 0,\n [activeDeductions.length],\n )\n\n // Determine initial state based on existing deductions\n const initialState: 'includeDeductions' | 'viewDeductions' = hasExistingDeductions\n ? 'viewDeductions'\n : 'includeDeductions'\n\n const initialComponent: React.ComponentType = hasExistingDeductions\n ? DeductionsListContextual\n : IncludeDeductionsFormContextual\n\n const manageDeductions = useMemo(\n () =>\n createMachine(\n initialState,\n deductionsStateMachine,\n (initialContext: DeductionsContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n employeeId,\n currentDeductionId: null,\n hasExistingDeductions,\n }),\n ),\n [initialState, initialComponent, employeeId, hasExistingDeductions],\n )\n\n return <Flow machine={manageDeductions} onEvent={onEvent} />\n}\n\nexport function Deductions(props: DeductionsProps) {\n return (\n <BaseComponent {...props}>\n <DeductionsFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n\nDeductions.IncludeDeductions = IncludeDeductions\nDeductions.DeductionsForm = DeductionsForm\nDeductions.DeductionsList = DeductionsList\n"],"names":["DeductionsFlow","employeeId","onEvent","dictionary","useComponentDictionary","data","useGarnishmentsListSuspense","activeDeductions","deduction","hasExistingDeductions","useMemo","initialState","initialComponent","DeductionsListContextual","IncludeDeductionsFormContextual","manageDeductions","createMachine","deductionsStateMachine","initialContext","jsx","Flow","Deductions","props","BaseComponent","DeductionsContextual","useFlow","t","useTranslation","IncludeDeductions","DeductionsForm","DeductionsList"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAASA,EAAe,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,KAA+B;AAC5E,EAAAC,EAAuB,uBAAuBD,CAAU;AACxD,QAAM,EAAE,MAAAE,EAAA,IAASC,EAA4B,EAAE,YAAAL,GAAY,GAErDM,IADaF,EAAK,gBACY,OAAO,CAAAG,MAAaA,EAAU,MAAM,GAClEC,IAAwBC;AAAA,IAC5B,MAAMH,EAAiB,SAAS;AAAA,IAChC,CAACA,EAAiB,MAAM;AAAA,EAAA,GAIpBI,IAAuDF,IACzD,mBACA,qBAEEG,IAAwCH,IAC1CI,IACAC,GAEEC,IAAmBL;AAAA,IACvB,MACEM;AAAA,MACEL;AAAA,MACAM;AAAA,MACA,CAACC,OAAgD;AAAA,QAC/C,GAAGA;AAAA,QACH,WAAWN;AAAA,QACX,YAAAX;AAAA,QACA,oBAAoB;AAAA,QACpB,uBAAAQ;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACE,GAAcC,GAAkBX,GAAYQ,CAAqB;AAAA,EAAA;AAGpE,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAASL,GAAkB,SAAAb,EAAA,CAAkB;AAC5D;AAEO,SAASmB,EAAWC,GAAwB;AACjD,SACE,gBAAAH,EAACI,KAAe,GAAGD,GACjB,4BAACtB,GAAA,EAAgB,GAAGsB,GAAO,EAAA,CAC7B;AAEJ;AAEO,MAAME,IAAuB,MAAM;AACxC,QAAM,EAAE,YAAAvB,GAAY,SAAAC,EAAA,IAAYuB,EAAA,GAC1B,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAAC1B;AACH,UAAM,IAAI;AAAA,MACRyB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAAP,EAACE,GAAA,EAAW,YAAApB,GAAwB,SAAAC,EAAA,CAAkB;AAC/D;AAEAmB,EAAW,oBAAoBO;AAC/BP,EAAW,iBAAiBQ;AAC5BR,EAAW,iBAAiBS;"}
1
+ {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { createMachine } from 'robot3'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n IncludeDeductionsFormContextual,\n type DeductionsContextInterface,\n DeductionsListContextual,\n} from './DeductionsComponents'\nimport { deductionsStateMachine } from './stateMachine'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { IncludeDeductions } from './IncludeDeductions/IncludeDeductions'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\nfunction DeductionsFlow({ employeeId, onEvent, dictionary }: DeductionsProps) {\n useComponentDictionary('Employee.Deductions', dictionary)\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishments!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const hasExistingDeductions = useMemo(\n () => activeDeductions.length > 0,\n [activeDeductions.length],\n )\n\n // Determine initial state based on existing deductions\n const initialState: 'includeDeductions' | 'viewDeductions' = hasExistingDeductions\n ? 'viewDeductions'\n : 'includeDeductions'\n\n const initialComponent: React.ComponentType = hasExistingDeductions\n ? DeductionsListContextual\n : IncludeDeductionsFormContextual\n\n const manageDeductions = useMemo(\n () =>\n createMachine(\n initialState,\n deductionsStateMachine,\n (initialContext: DeductionsContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n employeeId,\n currentDeductionId: null,\n hasExistingDeductions,\n }),\n ),\n [initialState, initialComponent, employeeId, hasExistingDeductions],\n )\n\n return <Flow machine={manageDeductions} onEvent={onEvent} />\n}\n\nexport function Deductions(props: DeductionsProps) {\n return (\n <BaseComponent {...props}>\n <DeductionsFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n\nDeductions.IncludeDeductions = IncludeDeductions\nDeductions.DeductionsForm = DeductionsForm\nDeductions.DeductionsList = DeductionsList\n"],"names":["DeductionsFlow","employeeId","onEvent","dictionary","useComponentDictionary","data","useGarnishmentsListSuspense","activeDeductions","deduction","hasExistingDeductions","useMemo","initialState","initialComponent","DeductionsListContextual","IncludeDeductionsFormContextual","manageDeductions","createMachine","deductionsStateMachine","initialContext","jsx","Flow","Deductions","props","BaseComponent","DeductionsContextual","useFlow","t","useTranslation","IncludeDeductions","DeductionsForm","DeductionsList"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAASA,EAAe,EAAE,YAAAC,GAAY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AW,iBAAiBS;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as n, jsxs as p } from "react/jsx-runtime";
2
- import { useTranslation as W } from "react-i18next";
3
- import { useForm as j, useWatch as H, FormProvider as V } from "react-hook-form";
2
+ import { useTranslation as j } from "react-i18next";
3
+ import { useForm as B, useWatch as H, FormProvider as V } from "react-hook-form";
4
4
  import { useMemo as K, useEffect as y } from "react";
5
5
  import { z as o } from "zod";
6
6
  import { zodResolver as z } from "@hookform/resolvers/zod";
@@ -19,7 +19,7 @@ import { useBase as re } from "../../../Base/useBase.js";
19
19
  import "@gusto/embedded-api/models/errors/apierror";
20
20
  import "@gusto/embedded-api/models/errors/gustoembeddederror";
21
21
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
22
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
22
+ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
23
23
  import "@gusto/embedded-api/models/errors/httpclienterrors";
24
24
  import "dompurify";
25
25
  import "../../../../contexts/LocaleProvider/useLocale.js";
@@ -27,27 +27,27 @@ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
27
27
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
28
28
  import { TextInputField as te } from "../../../Common/Fields/TextInputField/TextInputField.js";
29
29
  import { NumberInputField as D } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
30
- const ne = 0, oe = 0, ie = 100, _ = "Number must be greater than or equal to 0", me = o.enum(X), ae = o.object({
30
+ const ne = 0, oe = 0, ie = 100, R = "Number must be greater than or equal to 0", me = o.enum(X), ae = o.object({
31
31
  state: o.string(),
32
32
  fipsCode: o.string(),
33
33
  caseNumber: o.string().nullable(),
34
34
  orderNumber: o.string().nullable(),
35
35
  remittanceNumber: o.string().nullable(),
36
- amount: o.number().min(0, { error: _ }).transform(String),
37
- payPeriodMaximum: o.number().min(0, { error: _ }).transform((r) => r > 0 ? r.toString() : null).nullable(),
36
+ amount: o.number().min(0, { error: R }).transform(String),
37
+ payPeriodMaximum: o.number().min(0, { error: R }).transform((r) => r > 0 ? r.toString() : null).nullable(),
38
38
  paymentPeriod: me
39
39
  });
40
40
  function Ue({
41
41
  deduction: r,
42
- handleStateAgencySelect: A,
43
- stateAgencies: R,
42
+ handleStateAgencySelect: _,
43
+ stateAgencies: A,
44
44
  counties: l,
45
45
  singleAllCountiesFipsCode: u,
46
46
  employeeId: x,
47
47
  selectedAgency: N,
48
48
  onCancel: T
49
49
  }) {
50
- const { onEvent: E, baseSubmitHandler: v } = re(), { t: e } = W("Employee.Deductions"), s = Q(), g = {
50
+ const { onEvent: E, baseSubmitHandler: q } = re(), { t: e } = j("Employee.Deductions"), s = Q(), g = {
51
51
  case_number: {
52
52
  name: "caseNumber",
53
53
  description: e("caseNumberDescription")
@@ -60,7 +60,7 @@ function Ue({
60
60
  name: "remittanceNumber",
61
61
  description: e("remittanceNumberDescription")
62
62
  }
63
- }, q = N?.requiredAttributes?.map((t) => {
63
+ }, v = N?.requiredAttributes?.map((t) => {
64
64
  if (!t.key || !Object.prototype.hasOwnProperty.call(g, t.key))
65
65
  return null;
66
66
  const a = t.key, i = g[a];
@@ -78,7 +78,7 @@ function Ue({
78
78
  orderNumber: r?.childSupport?.orderNumber || null,
79
79
  remittanceNumber: r?.childSupport?.remittanceNumber || null,
80
80
  paymentPeriod: r?.childSupport?.paymentPeriod
81
- }), [r]), d = j({
81
+ }), [r]), d = B({
82
82
  resolver: z(ae),
83
83
  defaultValues: c
84
84
  }), { reset: S, setValue: m, control: F } = d, b = H({ control: F, name: "state" });
@@ -89,7 +89,7 @@ function Ue({
89
89
  }, [b, m]), y(() => {
90
90
  typeof u == "string" && m("fipsCode", u);
91
91
  }, [u, m]);
92
- const Y = async (t) => {
92
+ const G = async (t) => {
93
93
  const a = {
94
94
  state: t.state,
95
95
  paymentPeriod: t.paymentPeriod,
@@ -98,7 +98,7 @@ function Ue({
98
98
  orderNumber: t.orderNumber,
99
99
  remittanceNumber: t.remittanceNumber
100
100
  };
101
- await v(t, async (i) => {
101
+ await q(t, async (i) => {
102
102
  const C = {
103
103
  active: !0,
104
104
  amount: i.amount,
@@ -117,7 +117,7 @@ function Ue({
117
117
  const { garnishment: h } = await k({
118
118
  request: {
119
119
  garnishmentId: r.uuid,
120
- requestBody: {
120
+ updateGarnishmentRequest: {
121
121
  ...C,
122
122
  version: r.version
123
123
  }
@@ -128,16 +128,16 @@ function Ue({
128
128
  const { garnishment: h } = await I({
129
129
  request: {
130
130
  employeeId: x,
131
- requestBody: C
131
+ garnishmentRequest: C
132
132
  }
133
133
  });
134
134
  E(M.EMPLOYEE_DEDUCTION_CREATED, h);
135
135
  }
136
136
  });
137
- }, B = () => {
137
+ }, Y = () => {
138
138
  T();
139
- }, G = N?.manualPaymentRequired, L = l.length > 1 || l.length === 1 && u == null;
140
- return /* @__PURE__ */ n(V, { ...d, children: /* @__PURE__ */ n(Z, { onSubmit: d.handleSubmit(Y), children: /* @__PURE__ */ p(P, { flexDirection: "column", gap: 32, children: [
139
+ }, L = N?.manualPaymentRequired, W = l.length > 1 || l.length === 1 && u == null;
140
+ return /* @__PURE__ */ n(V, { ...d, children: /* @__PURE__ */ n(Z, { onSubmit: d.handleSubmit(G), children: /* @__PURE__ */ p(P, { flexDirection: "column", gap: 32, children: [
141
141
  /* @__PURE__ */ n(s.Heading, { as: "h3", children: e("childSupportTitle") }),
142
142
  /* @__PURE__ */ p(P, { flexDirection: "column", gap: 20, children: [
143
143
  /* @__PURE__ */ n(
@@ -146,14 +146,14 @@ function Ue({
146
146
  name: "state",
147
147
  label: e("agency"),
148
148
  description: e("agencyDescription"),
149
- options: R,
150
- onChange: A,
149
+ options: A,
150
+ onChange: _,
151
151
  isRequired: !0
152
152
  }
153
153
  ),
154
- G && /* @__PURE__ */ n(s.Alert, { status: "warning", label: e("manualPaymentRequired") }),
154
+ L && /* @__PURE__ */ n(s.Alert, { status: "warning", label: e("manualPaymentRequired") }),
155
155
  b && /* @__PURE__ */ p(P, { flexDirection: "column", gap: 20, children: [
156
- L && /* @__PURE__ */ n(
156
+ W && /* @__PURE__ */ n(
157
157
  f,
158
158
  {
159
159
  name: "fipsCode",
@@ -163,7 +163,7 @@ function Ue({
163
163
  isRequired: !0
164
164
  }
165
165
  ),
166
- q.map(({ name: t, label: a, description: i }) => /* @__PURE__ */ n(
166
+ v.map(({ name: t, label: a, description: i }) => /* @__PURE__ */ n(
167
167
  te,
168
168
  {
169
169
  name: t,
@@ -226,7 +226,7 @@ function Ue({
226
226
  ] })
227
227
  ] }),
228
228
  /* @__PURE__ */ p(ee, { children: [
229
- /* @__PURE__ */ n(s.Button, { variant: "secondary", onClick: B, children: e("cancelCta") }),
229
+ /* @__PURE__ */ n(s.Button, { variant: "secondary", onClick: Y, children: e("cancelCta") }),
230
230
  b && /* @__PURE__ */ n(s.Button, { type: "submit", isLoading: U, children: e("saveCta") })
231
231
  ] })
232
232
  ] }) }) });
@@ -1 +1 @@
1
- {"version":3,"file":"ChildSupportForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/ChildSupportForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, SelectField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst MINIMUM_PAY_PERIOD_AMOUNT = 0\nconst MINIMUM_PAYCHECK_PERCENTAGE = 0\nconst MAXIMUM_PAYCHECK_PERCENTAGE = 100\n\nconst NON_NEGATIVE_ERROR = 'Number must be greater than or equal to 0'\n\nconst ChildSupportPaymentPeriodSchema = z.enum(PaymentPeriod)\n\nconst ChildSupportSchema = z.object({\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string().nullable(),\n orderNumber: z.string().nullable(),\n remittanceNumber: z.string().nullable(),\n amount: z.number().min(0, { error: NON_NEGATIVE_ERROR }).transform(String),\n payPeriodMaximum: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n paymentPeriod: ChildSupportPaymentPeriodSchema,\n})\n\nexport type ChildSupportInputs = z.input<typeof ChildSupportSchema>\nexport type ChildSupportPayload = z.output<typeof ChildSupportSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n handleStateAgencySelect: (stateAgency: string) => void\n stateAgencies: { label: string; value: string }[]\n counties: { label: string; value: string }[]\n singleAllCountiesFipsCode: string | null | undefined\n selectedAgency?: Agencies\n onCancel: () => void\n}\n\nfunction ChildSupportForm({\n deduction,\n handleStateAgencySelect,\n stateAgencies,\n counties,\n singleAllCountiesFipsCode,\n employeeId,\n selectedAgency,\n onCancel,\n}: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER = {\n case_number: {\n name: 'caseNumber',\n description: t('caseNumberDescription'),\n },\n order_number: {\n name: 'orderNumber',\n description: t('orderNumberDescription'),\n },\n remittance_number: {\n name: 'remittanceNumber',\n description: t('remittanceNumberDescription'),\n },\n } as const\n\n const requiredSelectedAgencyAttributes =\n selectedAgency?.requiredAttributes\n ?.map(attr => {\n if (!attr.key) {\n return null\n }\n if (!Object.prototype.hasOwnProperty.call(ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER, attr.key)) {\n return null\n }\n const key = attr.key as keyof typeof ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER\n const mappedAttr = ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER[key]\n return {\n name: mappedAttr.name,\n label: attr.label as string,\n description: mappedAttr.description,\n }\n })\n .filter((attr): attr is NonNullable<typeof attr> => attr !== null) || []\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultChildSupportValues: ChildSupportInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n state: deduction?.childSupport?.state || '',\n fipsCode: deduction?.childSupport?.fipsCode || '',\n caseNumber: deduction?.childSupport?.caseNumber || null,\n orderNumber: deduction?.childSupport?.orderNumber || null,\n remittanceNumber: deduction?.childSupport?.remittanceNumber || null,\n paymentPeriod: deduction?.childSupport?.paymentPeriod as PaymentPeriod,\n }\n }, [deduction])\n\n const childSupportFormMethods = useForm<ChildSupportInputs, unknown, ChildSupportPayload>({\n resolver: zodResolver(ChildSupportSchema),\n defaultValues: defaultChildSupportValues,\n })\n const { reset: resetChildSupportForm, setValue, control } = childSupportFormMethods\n const watchedStateAgency = useWatch({ control, name: 'state' })\n\n useEffect(() => {\n resetChildSupportForm(defaultChildSupportValues)\n }, [deduction, defaultChildSupportValues, resetChildSupportForm])\n\n // if in edit mode and user elects to change state agency, reset the required attribute values\n // as new selected agency might require different payload inputs, e.g. OH requires case number + order number\n useEffect(() => {\n setValue('caseNumber', null)\n setValue('orderNumber', null)\n setValue('remittanceNumber', null)\n }, [watchedStateAgency, setValue])\n\n useEffect(() => {\n if (typeof singleAllCountiesFipsCode === 'string') {\n setValue('fipsCode', singleAllCountiesFipsCode)\n }\n }, [singleAllCountiesFipsCode, setValue])\n\n const onChildSupportSubmit: SubmitHandler<ChildSupportPayload> = async data => {\n const childSupport = {\n state: data.state,\n paymentPeriod: data.paymentPeriod,\n fipsCode: data.fipsCode,\n caseNumber: data.caseNumber,\n orderNumber: data.orderNumber,\n remittanceNumber: data.remittanceNumber,\n }\n\n await baseSubmitHandler(data, async payload => {\n const requestBody = {\n active: true,\n amount: payload.amount,\n description: `Child Support - ${childSupport.caseNumber}`, // child support description follows prefix type + case number convention\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true, // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled\n payPeriodMaximum: payload.payPeriodMaximum,\n recurring: true,\n childSupport,\n }\n\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId,\n requestBody,\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...requestBody,\n version: deduction.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n const isManualPaymentRequired = selectedAgency?.manualPaymentRequired\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n return (\n <FormProvider {...childSupportFormMethods}>\n <Form onSubmit={childSupportFormMethods.handleSubmit(onChildSupportSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('childSupportTitle')}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <SelectField\n name=\"state\"\n label={t('agency')}\n description={t('agencyDescription')}\n options={stateAgencies}\n onChange={handleStateAgencySelect}\n isRequired\n />\n\n {isManualPaymentRequired && (\n <Components.Alert status=\"warning\" label={t('manualPaymentRequired')} />\n )}\n\n {watchedStateAgency && (\n <Flex flexDirection=\"column\" gap={20}>\n {hasSelectableCounties && (\n <SelectField\n name=\"fipsCode\"\n label={t('county')}\n description={t('countyDescription')}\n options={counties}\n isRequired\n />\n )}\n {/* render required inputs for respective agency, e.g. OH requires case number + order number */}\n {requiredSelectedAgencyAttributes.map(({ name, label, description }) => (\n <TextInputField\n key={name}\n name={name}\n label={label}\n description={description}\n isRequired\n />\n ))}\n <NumberInputField\n name=\"payPeriodMaximum\"\n label={t('totalAmountWithheld')}\n description={t('totalAmountWithheldDescription')}\n min={MINIMUM_PAY_PERIOD_AMOUNT}\n adornmentStart=\"$\"\n isRequired\n />\n <NumberInputField\n name=\"amount\"\n label={t('maxPaycheckPercentage')}\n description={t('maxPaycheckPercentageDescription')}\n isRequired\n min={MINIMUM_PAYCHECK_PERCENTAGE}\n max={MAXIMUM_PAYCHECK_PERCENTAGE}\n adornmentEnd=\"%\"\n />\n <SelectField\n name=\"paymentPeriod\"\n label={t('per')}\n description={t('perDescription')}\n options={[\n {\n label: t('everyWeek'),\n value: 'Every week',\n },\n {\n label: t('everyOtherWeek'),\n value: 'Every other week',\n },\n {\n label: t('twicePerMonth'),\n value: 'Twice per month',\n },\n {\n label: t('monthly'),\n value: 'Monthly',\n },\n ]}\n isRequired\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n {watchedStateAgency && (\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default ChildSupportForm\n"],"names":["MINIMUM_PAY_PERIOD_AMOUNT","MINIMUM_PAYCHECK_PERCENTAGE","MAXIMUM_PAYCHECK_PERCENTAGE","NON_NEGATIVE_ERROR","ChildSupportPaymentPeriodSchema","z","PaymentPeriod","ChildSupportSchema","val","ChildSupportForm","deduction","handleStateAgencySelect","stateAgencies","counties","singleAllCountiesFipsCode","employeeId","selectedAgency","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER","requiredSelectedAgencyAttributes","attr","key","mappedAttr","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultChildSupportValues","useMemo","childSupportFormMethods","useForm","zodResolver","resetChildSupportForm","setValue","control","watchedStateAgency","useWatch","useEffect","onChildSupportSubmit","data","childSupport","payload","requestBody","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","isManualPaymentRequired","hasSelectableCounties","FormProvider","jsx","Form","jsxs","Flex","SelectField","name","label","description","TextInputField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,KAA4B,GAC5BC,KAA8B,GAC9BC,KAA8B,KAE9BC,IAAqB,6CAErBC,KAAkCC,EAAE,KAAKC,CAAa,GAEtDC,KAAqBF,EAAE,OAAO;AAAA,EAClC,OAAOA,EAAE,OAAA;AAAA,EACT,UAAUA,EAAE,OAAA;AAAA,EACZ,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,aAAaA,EAAE,OAAA,EAAS,SAAA;AAAA,EACxB,kBAAkBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC7B,QAAQA,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,OAAOF,EAAA,CAAoB,EAAE,UAAU,MAAM;AAAA,EACzE,kBAAkBE,EACf,SACA,IAAI,GAAG,EAAE,OAAOF,GAAoB,EACpC,UAAU,CAAAK,M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AAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,OAAO3C,EAAE,KAAK;AAAA,YACd,aAAaA,EAAE,gBAAgB;AAAA,YAC/B,SAAS;AAAA,cACP;AAAA,gBACE,OAAOA,EAAE,WAAW;AAAA,gBACpB,OAAO;AAAA,cAAA;AAAA,cAET;AAAA,gBACE,OAAOA,EAAE,gBAAgB;AAAA,gBACzB,OAAO;AAAA,cAAA;AAAA,cAET;AAAA,gBACE,OAAOA,EAAE,eAAe;AAAA,gBACxB,OAAO;AAAA,cAAA;AAAA,cAET;AAAA,gBACE,OAAOA,EAAE,SAAS;AAAA,gBAClB,OAAO;AAAA,cAAA;AAAA,YACT;AAAA,YAEF,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCiD,IAAA,EACC,UAAA;AAAA,MAAA,gBAAAV,EAACrC,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASiC,GAC7C,UAAAnC,EAAE,WAAW,EAAA,CAChB;AAAA,MACCwB,KACC,gBAAAe,EAACrC,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWa,GACzC,UAAAf,EAAE,SAAS,EAAA,CACd;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"ChildSupportForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/ChildSupportForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport {\n type Garnishment,\n type GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, SelectField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst MINIMUM_PAY_PERIOD_AMOUNT = 0\nconst MINIMUM_PAYCHECK_PERCENTAGE = 0\nconst MAXIMUM_PAYCHECK_PERCENTAGE = 100\n\nconst NON_NEGATIVE_ERROR = 'Number must be greater than or equal to 0'\n\nconst ChildSupportPaymentPeriodSchema = z.enum(PaymentPeriod)\n\nconst ChildSupportSchema = z.object({\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string().nullable(),\n orderNumber: z.string().nullable(),\n remittanceNumber: z.string().nullable(),\n amount: z.number().min(0, { error: NON_NEGATIVE_ERROR }).transform(String),\n payPeriodMaximum: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n paymentPeriod: ChildSupportPaymentPeriodSchema,\n})\n\nexport type ChildSupportInputs = z.input<typeof ChildSupportSchema>\nexport type ChildSupportPayload = z.output<typeof ChildSupportSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n handleStateAgencySelect: (stateAgency: string) => void\n stateAgencies: { label: string; value: string }[]\n counties: { label: string; value: string }[]\n singleAllCountiesFipsCode: string | null | undefined\n selectedAgency?: Agencies\n onCancel: () => void\n}\n\nfunction ChildSupportForm({\n deduction,\n handleStateAgencySelect,\n stateAgencies,\n counties,\n singleAllCountiesFipsCode,\n employeeId,\n selectedAgency,\n onCancel,\n}: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER = {\n case_number: {\n name: 'caseNumber',\n description: t('caseNumberDescription'),\n },\n order_number: {\n name: 'orderNumber',\n description: t('orderNumberDescription'),\n },\n remittance_number: {\n name: 'remittanceNumber',\n description: t('remittanceNumberDescription'),\n },\n } as const\n\n const requiredSelectedAgencyAttributes =\n selectedAgency?.requiredAttributes\n ?.map(attr => {\n if (!attr.key) {\n return null\n }\n if (!Object.prototype.hasOwnProperty.call(ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER, attr.key)) {\n return null\n }\n const key = attr.key as keyof typeof ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER\n const mappedAttr = ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER[key]\n return {\n name: mappedAttr.name,\n label: attr.label as string,\n description: mappedAttr.description,\n }\n })\n .filter((attr): attr is NonNullable<typeof attr> => attr !== null) || []\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultChildSupportValues: ChildSupportInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n state: deduction?.childSupport?.state || '',\n fipsCode: deduction?.childSupport?.fipsCode || '',\n caseNumber: deduction?.childSupport?.caseNumber || null,\n orderNumber: deduction?.childSupport?.orderNumber || null,\n remittanceNumber: deduction?.childSupport?.remittanceNumber || null,\n paymentPeriod: deduction?.childSupport?.paymentPeriod as PaymentPeriod,\n }\n }, [deduction])\n\n const childSupportFormMethods = useForm<ChildSupportInputs, unknown, ChildSupportPayload>({\n resolver: zodResolver(ChildSupportSchema),\n defaultValues: defaultChildSupportValues,\n })\n const { reset: resetChildSupportForm, setValue, control } = childSupportFormMethods\n const watchedStateAgency = useWatch({ control, name: 'state' })\n\n useEffect(() => {\n resetChildSupportForm(defaultChildSupportValues)\n }, [deduction, defaultChildSupportValues, resetChildSupportForm])\n\n // if in edit mode and user elects to change state agency, reset the required attribute values\n // as new selected agency might require different payload inputs, e.g. OH requires case number + order number\n useEffect(() => {\n setValue('caseNumber', null)\n setValue('orderNumber', null)\n setValue('remittanceNumber', null)\n }, [watchedStateAgency, setValue])\n\n useEffect(() => {\n if (typeof singleAllCountiesFipsCode === 'string') {\n setValue('fipsCode', singleAllCountiesFipsCode)\n }\n }, [singleAllCountiesFipsCode, setValue])\n\n const onChildSupportSubmit: SubmitHandler<ChildSupportPayload> = async data => {\n const childSupport = {\n state: data.state,\n paymentPeriod: data.paymentPeriod,\n fipsCode: data.fipsCode,\n caseNumber: data.caseNumber,\n orderNumber: data.orderNumber,\n remittanceNumber: data.remittanceNumber,\n }\n\n await baseSubmitHandler(data, async payload => {\n const requestBody = {\n active: true,\n amount: payload.amount,\n description: `Child Support - ${childSupport.caseNumber}`, // child support description follows prefix type + case number convention\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true, // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled\n payPeriodMaximum: payload.payPeriodMaximum,\n recurring: true,\n childSupport,\n }\n\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId,\n garnishmentRequest: requestBody,\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n updateGarnishmentRequest: {\n ...requestBody,\n version: deduction.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n const isManualPaymentRequired = selectedAgency?.manualPaymentRequired\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n return (\n <FormProvider {...childSupportFormMethods}>\n <Form onSubmit={childSupportFormMethods.handleSubmit(onChildSupportSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('childSupportTitle')}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <SelectField\n name=\"state\"\n label={t('agency')}\n description={t('agencyDescription')}\n options={stateAgencies}\n onChange={handleStateAgencySelect}\n isRequired\n />\n\n {isManualPaymentRequired && (\n <Components.Alert status=\"warning\" label={t('manualPaymentRequired')} />\n )}\n\n {watchedStateAgency && (\n <Flex flexDirection=\"column\" gap={20}>\n {hasSelectableCounties && (\n <SelectField\n name=\"fipsCode\"\n label={t('county')}\n description={t('countyDescription')}\n options={counties}\n isRequired\n />\n )}\n {/* render required inputs for respective agency, e.g. OH requires case number + order number */}\n {requiredSelectedAgencyAttributes.map(({ name, label, description }) => (\n <TextInputField\n key={name}\n name={name}\n label={label}\n description={description}\n isRequired\n />\n ))}\n <NumberInputField\n name=\"payPeriodMaximum\"\n label={t('totalAmountWithheld')}\n description={t('totalAmountWithheldDescription')}\n min={MINIMUM_PAY_PERIOD_AMOUNT}\n adornmentStart=\"$\"\n isRequired\n />\n <NumberInputField\n name=\"amount\"\n label={t('maxPaycheckPercentage')}\n description={t('maxPaycheckPercentageDescription')}\n isRequired\n min={MINIMUM_PAYCHECK_PERCENTAGE}\n max={MAXIMUM_PAYCHECK_PERCENTAGE}\n adornmentEnd=\"%\"\n />\n <SelectField\n name=\"paymentPeriod\"\n label={t('per')}\n description={t('perDescription')}\n options={[\n {\n label: t('everyWeek'),\n value: 'Every week',\n },\n {\n label: t('everyOtherWeek'),\n value: 'Every other week',\n },\n {\n label: t('twicePerMonth'),\n value: 'Twice per month',\n },\n {\n label: t('monthly'),\n value: 'Monthly',\n },\n ]}\n isRequired\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n {watchedStateAgency && (\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default ChildSupportForm\n"],"names":["MINIMUM_PAY_PERIOD_AMOUNT","MINIMUM_PAYCHECK_PERCENTAGE","MAXIMUM_PAYCHECK_PERCENTAGE","NON_NEGATIVE_ERROR","ChildSupportPaymentPeriodSchema","z","PaymentPeriod","ChildSupportSchema","val","ChildSupportForm","deduction","handleStateAgencySelect","stateAgencies","counties","singleAllCountiesFipsCode","employeeId","selectedAgency","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER","requiredSelectedAgencyAttributes","attr","key","mappedAttr","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultChildSupportValues","useMemo","childSupportFormMethods","useForm","zodResolver","resetChildSupportForm","setValue","control","watchedStateAgency","useWatch","useEffect","onChildSupportSubmit","data","childSupport","payload","requestBody","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","isManualPaymentRequired","hasSelectableCounties","FormProvider","jsx","Form","jsxs","Flex","SelectField","name","label","description","TextInputField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,KAA4B,GAC5BC,KAA8B,GAC9BC,KAA8B,KAE9BC,IAAqB,6CAErBC,KAAkCC,EAAE,KAAKC,CAAa,GAEtDC,KAAqBF,EAAE,OAAO;AAAA,EAClC,OAAOA,EAAE,OAAA;AAAA,EACT,UAAUA,EAAE,OAAA;AAAA,EACZ,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,aAAaA,EAAE,OAAA,EAAS,SAAA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