@gusto/embedded-react-sdk 0.10.7 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/Button/Button.d.ts +1 -1
- package/dist/components/Common/UI/Button/Button.js +4 -4
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +34 -38
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -54
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -43
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -11
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccount.js +17 -23
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -43
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -46
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -5
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +12 -13
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +3 -2
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +5 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +0 -5
- package/dist/components/Company/Industry/Industry.js +23 -29
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +44 -48
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +0 -4
- package/dist/components/Company/Locations/Locations.js +14 -18
- package/dist/components/Company/Locations/Locations.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +3 -2
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +28 -32
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
- package/dist/components/Company/PaySchedule/PaySchedule.js +72 -77
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -9
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +37 -38
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +7 -6
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
- package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Contractor/Address/Address.d.ts +0 -5
- package/dist/components/Contractor/Address/Address.js +35 -39
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -4
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/List/index.js +2 -3
- package/dist/components/Contractor/List/index.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -5
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
- package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
- package/dist/components/Contractor/Profile/index.d.ts +3 -0
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
- package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
- package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
- package/dist/components/Contractor/Submit/index.d.ts +6 -0
- package/dist/components/Contractor/Submit/index.js +20 -0
- package/dist/components/Contractor/Submit/index.js.map +1 -0
- package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
- package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
- package/dist/components/Contractor/index.d.ts +2 -0
- package/dist/components/Contractor/index.js +10 -6
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
- package/dist/components/Employee/Compensation/Compensation.js +97 -102
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +12 -12
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +8 -7
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +6 -5
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +11 -10
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +25 -29
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +40 -45
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +3 -2
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
- package/dist/components/Employee/EmployeeList/EmployeeList.js +56 -60
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +6 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -8
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/Profile/Actions.js +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +5 -6
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -11
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.d.ts +0 -8
- package/dist/components/Employee/Profile/Profile.js +131 -138
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +9 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +11 -10
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
- package/dist/components/Employee/Taxes/Taxes.js +76 -81
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Profile.json.js +73 -0
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
- package/dist/shared/constants.d.ts +14 -0
- package/dist/shared/constants.js +33 -26
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +77 -1
- package/package.json +3 -3
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { zodResolver as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useForm as
|
|
5
|
-
import { useLocationsGetSuspense as
|
|
6
|
-
import { useEmployeesCreateMutation as
|
|
7
|
-
import { useEmployeesGetSuspense as
|
|
8
|
-
import { useEmployeeAddressesGetSuspense as
|
|
9
|
-
import { useEmployeeAddressesCreateMutation as
|
|
10
|
-
import { useEmployeeAddressesUpdateMutation as
|
|
11
|
-
import { useEmployeeAddressesUpdateWorkAddressMutation as
|
|
12
|
-
import { useEmployeesUpdateMutation as
|
|
13
|
-
import { useEmployeeAddressesGetWorkAddressesSuspense as
|
|
14
|
-
import { useEmployeeAddressesCreateWorkAddressMutation as
|
|
15
|
-
import { RFCDate as
|
|
16
|
-
import { useEmployeesUpdateOnboardingStatusMutation as
|
|
17
|
-
import { AdminPersonalDetailsSchema as
|
|
18
|
-
import { SelfPersonalDetailsSchema as
|
|
19
|
-
import { Head as
|
|
20
|
-
import { Actions as
|
|
21
|
-
import { HomeAddressSchema as
|
|
22
|
-
import { WorkAddress as
|
|
23
|
-
import { ProfileProvider as
|
|
24
|
-
import { getEmployeeAddressForProfile as
|
|
1
|
+
import { jsx as t, jsxs as ae, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver as ue } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useState as ce, useRef as pe, useEffect as ye } from "react";
|
|
4
|
+
import { useForm as Ae, useWatch as fe, FormProvider as Ee } from "react-hook-form";
|
|
5
|
+
import { useLocationsGetSuspense as he } from "@gusto/embedded-api/react-query/locationsGet";
|
|
6
|
+
import { useEmployeesCreateMutation as De } from "@gusto/embedded-api/react-query/employeesCreate";
|
|
7
|
+
import { useEmployeesGetSuspense as Oe } from "@gusto/embedded-api/react-query/employeesGet";
|
|
8
|
+
import { useEmployeeAddressesGetSuspense as Se } from "@gusto/embedded-api/react-query/employeeAddressesGet";
|
|
9
|
+
import { useEmployeeAddressesCreateMutation as ge } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
|
|
10
|
+
import { useEmployeeAddressesUpdateMutation as Pe } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
|
|
11
|
+
import { useEmployeeAddressesUpdateWorkAddressMutation as be } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
|
|
12
|
+
import { useEmployeesUpdateMutation as Ne } from "@gusto/embedded-api/react-query/employeesUpdate";
|
|
13
|
+
import { useEmployeeAddressesGetWorkAddressesSuspense as Ie } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
14
|
+
import { useEmployeeAddressesCreateWorkAddressMutation as _e } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
15
|
+
import { RFCDate as B } from "@gusto/embedded-api/types/rfcdate";
|
|
16
|
+
import { useEmployeesUpdateOnboardingStatusMutation as we } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
|
|
17
|
+
import { AdminPersonalDetailsSchema as R, AdminSelfOnboardingPersonalDetailsSchema as Me, AdminPersonalDetails as ke } from "./AdminPersonalDetails.js";
|
|
18
|
+
import { SelfPersonalDetailsSchema as Be, SelfPersonalDetails as Re } from "./SelfPersonalDetails.js";
|
|
19
|
+
import { Head as Le } from "./Head.js";
|
|
20
|
+
import { Actions as ve } from "./Actions.js";
|
|
21
|
+
import { HomeAddressSchema as Ce, HomeAddress as We } from "./HomeAddress.js";
|
|
22
|
+
import { WorkAddress as Ue } from "./WorkAddress.js";
|
|
23
|
+
import { ProfileProvider as qe } from "./useProfile.js";
|
|
24
|
+
import { getEmployeeAddressForProfile as Te } from "./getEmployeeAddressForProfile.js";
|
|
25
25
|
import { Form as Ge } from "../../Common/Form/Form.js";
|
|
26
|
-
import { BaseComponent as
|
|
27
|
-
import { useBase as
|
|
28
|
-
import { useI18n as
|
|
29
|
-
import { EmployeeOnboardingStatus as
|
|
30
|
-
import { useFlow as
|
|
31
|
-
import { ensureRequired as
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */ t(
|
|
26
|
+
import { BaseComponent as He } from "../../Base/Base.js";
|
|
27
|
+
import { useBase as Fe } from "../../Base/useBase.js";
|
|
28
|
+
import { useI18n as L, useComponentDictionary as Ve } from "../../../i18n/I18n.js";
|
|
29
|
+
import { EmployeeOnboardingStatus as a, EmployeeSelfOnboardingStatuses as Ye, componentEvents as d } from "../../../shared/constants.js";
|
|
30
|
+
import { useFlow as xe } from "../../Flow/useFlow.js";
|
|
31
|
+
import { ensureRequired as ze } from "../../../helpers/ensureRequired.js";
|
|
32
|
+
function je(r) {
|
|
33
|
+
return /* @__PURE__ */ t(He, { ...r, children: r.employeeId ? /* @__PURE__ */ t(Ke, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(v, { ...r, children: r.children }) });
|
|
34
34
|
}
|
|
35
|
-
function Ke({ employeeId: r, ...
|
|
35
|
+
function Ke({ employeeId: r, ...i }) {
|
|
36
36
|
const {
|
|
37
|
-
data: { employee:
|
|
38
|
-
} =
|
|
39
|
-
data: { employeeAddressList:
|
|
40
|
-
} =
|
|
37
|
+
data: { employee: l }
|
|
38
|
+
} = Oe({ employeeId: r }), {
|
|
39
|
+
data: { employeeAddressList: u }
|
|
40
|
+
} = Se({ employeeId: r }), {
|
|
41
41
|
data: { employeeWorkAddressesList: m }
|
|
42
|
-
} =
|
|
42
|
+
} = Ie({ employeeId: r });
|
|
43
43
|
return /* @__PURE__ */ t(
|
|
44
|
-
|
|
44
|
+
v,
|
|
45
45
|
{
|
|
46
|
-
...
|
|
47
|
-
employee:
|
|
48
|
-
homeAddresses:
|
|
46
|
+
...i,
|
|
47
|
+
employee: l,
|
|
48
|
+
homeAddresses: u,
|
|
49
49
|
workAddresses: m
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const v = ({
|
|
54
54
|
isAdmin: r = !1,
|
|
55
|
-
isSelfOnboardingEnabled:
|
|
56
|
-
dictionary:
|
|
57
|
-
...
|
|
55
|
+
isSelfOnboardingEnabled: i = !0,
|
|
56
|
+
dictionary: l,
|
|
57
|
+
...u
|
|
58
58
|
}) => {
|
|
59
|
-
|
|
59
|
+
L("Employee.Profile"), L("Employee.HomeAddress"), Ve("Employee.Profile", l);
|
|
60
60
|
const {
|
|
61
61
|
companyId: m,
|
|
62
|
-
employee:
|
|
63
|
-
homeAddresses:
|
|
62
|
+
employee: h,
|
|
63
|
+
homeAddresses: C,
|
|
64
64
|
workAddresses: g,
|
|
65
|
-
children:
|
|
66
|
-
className:
|
|
65
|
+
children: P,
|
|
66
|
+
className: W = "",
|
|
67
67
|
defaultValues: s
|
|
68
|
-
} =
|
|
69
|
-
mutateAsync:
|
|
70
|
-
isPending:
|
|
71
|
-
} =
|
|
72
|
-
employee:
|
|
73
|
-
homeAddress:
|
|
74
|
-
workAddress:
|
|
75
|
-
}),
|
|
68
|
+
} = u, { onEvent: n, baseSubmitHandler: U } = Fe(), [q, b] = ce(R), { data: T } = he({ companyId: m }), G = T.locationList, { mutateAsync: H, isPending: F } = De(), { mutateAsync: V, isPending: Y } = Ne(), { mutateAsync: x, isPending: z } = _e(), { mutateAsync: j, isPending: K } = be(), { mutateAsync: J, isPending: Q } = ge(), { mutateAsync: X, isPending: Z } = Pe(), {
|
|
69
|
+
mutateAsync: $,
|
|
70
|
+
isPending: ee
|
|
71
|
+
} = we(), N = { employee: h, workAddresses: g }, re = Te(C), te = N.workAddresses?.find((S) => S.active), e = pe({
|
|
72
|
+
employee: N.employee,
|
|
73
|
+
homeAddress: re,
|
|
74
|
+
workAddress: te
|
|
75
|
+
}), D = {
|
|
76
76
|
firstName: e.current.employee?.firstName ?? s?.employee?.firstName ?? "",
|
|
77
77
|
middleInitial: e.current.employee?.middleInitial ?? s?.employee?.middleInitial ?? "",
|
|
78
78
|
lastName: e.current.employee?.lastName ?? s?.employee?.lastName ?? "",
|
|
@@ -87,60 +87,60 @@ const G = ({
|
|
|
87
87
|
zip: e.current.homeAddress?.zip ?? s?.homeAddress?.zip ?? "",
|
|
88
88
|
state: e.current.homeAddress?.state ?? s?.homeAddress?.state ?? "",
|
|
89
89
|
courtesyWithholding: e.current.homeAddress?.courtesyWithholding ?? !1
|
|
90
|
-
},
|
|
91
|
-
...
|
|
92
|
-
selfOnboarding:
|
|
90
|
+
}, oe = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === a.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== a.ADMIN_ONBOARDING_INCOMPLETE ? { ...D, enableSsn: !1, selfOnboarding: !0 } : {
|
|
91
|
+
...D,
|
|
92
|
+
selfOnboarding: i && e.current.employee?.onboardingStatus ? (
|
|
93
93
|
// @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
|
|
94
|
-
|
|
94
|
+
Ye.has(e.current.employee.onboarding_status)
|
|
95
95
|
) : !1,
|
|
96
96
|
enableSsn: !e.current.employee?.hasSsn,
|
|
97
97
|
ssn: ""
|
|
98
|
-
},
|
|
99
|
-
...
|
|
98
|
+
}, se = {
|
|
99
|
+
...D,
|
|
100
100
|
enableSsn: !e.current.employee?.hasSsn,
|
|
101
101
|
ssn: ""
|
|
102
|
-
},
|
|
103
|
-
resolver:
|
|
104
|
-
(r ?
|
|
102
|
+
}, O = Ae({
|
|
103
|
+
resolver: ue(
|
|
104
|
+
(r ? q : Be).and(Ce)
|
|
105
105
|
),
|
|
106
|
-
defaultValues: r ?
|
|
107
|
-
}), { handleSubmit:
|
|
108
|
-
|
|
109
|
-
r &&
|
|
110
|
-
}, [
|
|
111
|
-
const
|
|
112
|
-
await
|
|
113
|
-
const { workAddress:
|
|
106
|
+
defaultValues: r ? oe : se
|
|
107
|
+
}), { handleSubmit: ne } = O, y = fe({ control: O.control, name: "selfOnboarding" });
|
|
108
|
+
ye(() => {
|
|
109
|
+
r && b(y ? Me : R);
|
|
110
|
+
}, [y, r]);
|
|
111
|
+
const de = async (S) => {
|
|
112
|
+
await U(S, async (A) => {
|
|
113
|
+
const { workAddress: I, startDate: me, selfOnboarding: f, ...E } = A;
|
|
114
114
|
if (e.current.employee) {
|
|
115
|
-
if (
|
|
116
|
-
const { employeeOnboardingStatus:
|
|
115
|
+
if (f && e.current.employee.onboardingStatus === a.ADMIN_ONBOARDING_INCOMPLETE || !f && e.current.employee.onboardingStatus === a.SELF_ONBOARDING_PENDING_INVITE) {
|
|
116
|
+
const { employeeOnboardingStatus: c } = await $({
|
|
117
117
|
request: {
|
|
118
118
|
employeeId: e.current.employee.uuid,
|
|
119
119
|
requestBody: {
|
|
120
|
-
onboardingStatus:
|
|
120
|
+
onboardingStatus: f ? a.SELF_ONBOARDING_PENDING_INVITE : a.ADMIN_ONBOARDING_INCOMPLETE
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
e.current.employee = {
|
|
125
125
|
...e.current.employee,
|
|
126
|
-
onboardingStatus:
|
|
127
|
-
}, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED,
|
|
126
|
+
onboardingStatus: c.onboardingStatus
|
|
127
|
+
}, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, c);
|
|
128
128
|
}
|
|
129
|
-
const { employee: o } = await
|
|
129
|
+
const { employee: o } = await V({
|
|
130
130
|
request: {
|
|
131
131
|
employeeId: e.current.employee.uuid,
|
|
132
|
-
requestBody: { ...
|
|
132
|
+
requestBody: { ...E, version: e.current.employee.version }
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_UPDATED, o);
|
|
136
136
|
} else {
|
|
137
|
-
const { employee: o } = await
|
|
137
|
+
const { employee: o } = await H({
|
|
138
138
|
request: {
|
|
139
139
|
companyId: m,
|
|
140
140
|
requestBody: {
|
|
141
|
-
...
|
|
142
|
-
selfOnboarding:
|
|
143
|
-
dateOfBirth:
|
|
141
|
+
...E,
|
|
142
|
+
selfOnboarding: f,
|
|
143
|
+
dateOfBirth: E.dateOfBirth ? new B(E.dateOfBirth) : void 0
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
});
|
|
@@ -148,60 +148,60 @@ const G = ({
|
|
|
148
148
|
}
|
|
149
149
|
if (typeof e.current.employee?.uuid != "string")
|
|
150
150
|
throw new Error("Employee id is not available");
|
|
151
|
-
if ((!
|
|
152
|
-
const { street1: o, street2:
|
|
151
|
+
if ((!y || !r) && !A.selfOnboarding) {
|
|
152
|
+
const { street1: o, street2: c, city: _, state: w, zip: M, courtesyWithholding: k } = A;
|
|
153
153
|
if (e.current.homeAddress) {
|
|
154
|
-
const { employeeAddress:
|
|
154
|
+
const { employeeAddress: p } = await X({
|
|
155
155
|
request: {
|
|
156
156
|
homeAddressUuid: e.current.homeAddress.uuid,
|
|
157
157
|
requestBody: {
|
|
158
158
|
version: e.current.homeAddress.version,
|
|
159
159
|
street1: o,
|
|
160
|
-
street2:
|
|
161
|
-
city:
|
|
162
|
-
state:
|
|
160
|
+
street2: c,
|
|
161
|
+
city: _,
|
|
162
|
+
state: w,
|
|
163
163
|
zip: M,
|
|
164
|
-
courtesyWithholding:
|
|
164
|
+
courtesyWithholding: k
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
-
e.current = { ...e.current, homeAddress:
|
|
168
|
+
e.current = { ...e.current, homeAddress: p }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, p);
|
|
169
169
|
} else {
|
|
170
|
-
const { employeeAddress:
|
|
170
|
+
const { employeeAddress: p } = await J({
|
|
171
171
|
request: {
|
|
172
172
|
employeeId: e.current.employee.uuid,
|
|
173
173
|
requestBody: {
|
|
174
174
|
street1: o,
|
|
175
|
-
street2:
|
|
176
|
-
city:
|
|
177
|
-
state:
|
|
175
|
+
street2: c,
|
|
176
|
+
city: _,
|
|
177
|
+
state: w,
|
|
178
178
|
zip: M,
|
|
179
|
-
courtesyWithholding:
|
|
179
|
+
courtesyWithholding: k
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
|
-
e.current = { ...e.current, homeAddress:
|
|
183
|
+
e.current = { ...e.current, homeAddress: p }, n(d.EMPLOYEE_HOME_ADDRESS_CREATED, p);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
if (r)
|
|
187
187
|
if (e.current.workAddress) {
|
|
188
|
-
const { employeeWorkAddress: o } = await
|
|
188
|
+
const { employeeWorkAddress: o } = await j({
|
|
189
189
|
request: {
|
|
190
190
|
workAddressUuid: e.current.workAddress.uuid,
|
|
191
191
|
requestBody: {
|
|
192
192
|
version: e.current.workAddress.version,
|
|
193
|
-
locationUuid:
|
|
193
|
+
locationUuid: I
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
197
|
e.current = { ...e.current, workAddress: o }, n(d.EMPLOYEE_WORK_ADDRESS_UPDATED, o);
|
|
198
198
|
} else {
|
|
199
|
-
const { employeeWorkAddress: o } = await
|
|
199
|
+
const { employeeWorkAddress: o } = await x({
|
|
200
200
|
request: {
|
|
201
201
|
employeeId: e.current.employee?.uuid,
|
|
202
202
|
requestBody: {
|
|
203
|
-
locationUuid:
|
|
204
|
-
effectiveDate: new
|
|
203
|
+
locationUuid: I,
|
|
204
|
+
effectiveDate: new B(A.startDate || /* @__PURE__ */ new Date())
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
});
|
|
@@ -209,58 +209,51 @@ const G = ({
|
|
|
209
209
|
}
|
|
210
210
|
n(d.EMPLOYEE_PROFILE_DONE, {
|
|
211
211
|
...e.current.employee,
|
|
212
|
-
startDate:
|
|
212
|
+
startDate: me
|
|
213
213
|
});
|
|
214
214
|
});
|
|
215
|
-
},
|
|
215
|
+
}, ie = () => {
|
|
216
216
|
n(d.CANCEL);
|
|
217
217
|
};
|
|
218
|
-
return /* @__PURE__ */ t("section", { className:
|
|
219
|
-
|
|
218
|
+
return /* @__PURE__ */ t("section", { className: W, children: /* @__PURE__ */ t(
|
|
219
|
+
qe,
|
|
220
220
|
{
|
|
221
221
|
value: {
|
|
222
|
-
companyLocations:
|
|
222
|
+
companyLocations: G,
|
|
223
223
|
workAddresses: g,
|
|
224
224
|
employee: e.current.employee ?? void 0,
|
|
225
|
-
isSelfOnboardingIntended:
|
|
226
|
-
handleCancel:
|
|
225
|
+
isSelfOnboardingIntended: y,
|
|
226
|
+
handleCancel: ie,
|
|
227
227
|
isAdmin: r,
|
|
228
|
-
isSelfOnboardingEnabled:
|
|
229
|
-
isPending:
|
|
228
|
+
isSelfOnboardingEnabled: i,
|
|
229
|
+
isPending: Y || K || Q || Z || F || z || ee
|
|
230
230
|
},
|
|
231
|
-
children: /* @__PURE__ */ t(
|
|
232
|
-
/* @__PURE__ */ t(
|
|
233
|
-
/* @__PURE__ */ t(
|
|
234
|
-
/* @__PURE__ */ t(
|
|
235
|
-
/* @__PURE__ */ t(
|
|
236
|
-
/* @__PURE__ */ t(
|
|
237
|
-
/* @__PURE__ */ t(
|
|
231
|
+
children: /* @__PURE__ */ t(Ee, { ...O, children: /* @__PURE__ */ t(Ge, { onSubmit: ne(de), children: P || /* @__PURE__ */ ae(le, { children: [
|
|
232
|
+
/* @__PURE__ */ t(Le, {}),
|
|
233
|
+
/* @__PURE__ */ t(ke, {}),
|
|
234
|
+
/* @__PURE__ */ t(Re, {}),
|
|
235
|
+
/* @__PURE__ */ t(We, {}),
|
|
236
|
+
/* @__PURE__ */ t(Ue, {}),
|
|
237
|
+
/* @__PURE__ */ t(ve, {})
|
|
238
238
|
] }) }) })
|
|
239
239
|
}
|
|
240
240
|
) });
|
|
241
|
-
}
|
|
242
|
-
i
|
|
243
|
-
i.Actions = q;
|
|
244
|
-
i.AdminPersonalDetails = W;
|
|
245
|
-
i.SelfPersonalDetails = C;
|
|
246
|
-
i.HomeAddress = T;
|
|
247
|
-
i.WorkAddress = H;
|
|
248
|
-
const Ir = () => {
|
|
249
|
-
const { companyId: r, employeeId: a, onEvent: u, isAdmin: c, defaultValues: m, isSelfOnboardingEnabled: D } = ze();
|
|
241
|
+
}, Ir = () => {
|
|
242
|
+
const { companyId: r, employeeId: i, onEvent: l, isAdmin: u, defaultValues: m, isSelfOnboardingEnabled: h } = xe();
|
|
250
243
|
return /* @__PURE__ */ t(
|
|
251
|
-
|
|
244
|
+
je,
|
|
252
245
|
{
|
|
253
|
-
companyId:
|
|
254
|
-
employeeId:
|
|
255
|
-
onEvent:
|
|
256
|
-
isAdmin:
|
|
246
|
+
companyId: ze(r),
|
|
247
|
+
employeeId: i,
|
|
248
|
+
onEvent: l,
|
|
249
|
+
isAdmin: u,
|
|
257
250
|
defaultValues: m?.profile,
|
|
258
|
-
isSelfOnboardingEnabled:
|
|
251
|
+
isSelfOnboardingEnabled: h
|
|
259
252
|
}
|
|
260
253
|
);
|
|
261
254
|
};
|
|
262
255
|
export {
|
|
263
|
-
|
|
256
|
+
je as Profile,
|
|
264
257
|
Ir as ProfileContextual
|
|
265
258
|
};
|
|
266
259
|
//# sourceMappingURL=Profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation()\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : false\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n resolver: zodResolver(\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n if (watchedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n (selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nProfile.Head = Head\nProfile.Actions = Actions\nProfile.AdminPersonalDetails = AdminPersonalDetails\nProfile.SelfPersonalDetails = SelfPersonalDetails\nProfile.HomeAddress = HomeAddress\nProfile.WorkAddress = WorkAddress\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","AdminSelfOnboardingPersonalDetailsSchema","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFO,SAASA,EAAQC,GAA8C;AAElE,SAAA,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAkB,EAAA,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,SACT,CAAA,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAMA,EAAA,SAAA,CAAS,EAErC,CAAA;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KA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ACAY;AAAA,MACJ;AAAA,MAEA,UAAC,gBAAAnD,EAAA+F,IAAA,EAAc,GAAG9B,GAChB,UAAC,gBAAAjE,EAAAgG,IAAA,EAAK,UAAU1B,GAAaK,EAAQ,GAClC,UACCxD,KAGE,gBAAA8E,GAAAC,IAAA,EAAA,UAAA;AAAA,QAAA,gBAAAlG,EAACmG,GAAK,EAAA;AAAA,0BACLC,GAAqB,EAAA;AAAA,0BACrBC,GAAoB,EAAA;AAAA,0BACpBC,GAAY,EAAA;AAAA,0BACZC,GAAY,EAAA;AAAA,0BACZC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA1G,EAAQ,OAAOqG;AACfrG,EAAQ,UAAU0G;AAClB1G,EAAQ,uBAAuBsG;AAC/BtG,EAAQ,sBAAsBuG;AAC9BvG,EAAQ,cAAcwG;AACtBxG,EAAQ,cAAcyG;AAEf,MAAME,KAAoB,MAAM;AAC/B,QAAA,EAAE,WAAAzF,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,MAC9D8F,GAAoC;AAGpC,SAAA,gBAAA1G;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW6G,GAAe3F,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation()\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : false\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n resolver: zodResolver(\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n if (watchedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n (selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","AdminSelfOnboardingPersonalDetailsSchema","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFO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useTranslation as r } from "react-i18next";
|
|
3
|
+
import { useTaxes as s } from "./useTaxes.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import "../../../shared/constants.js";
|
|
6
|
+
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
const l = () => {
|
|
9
|
+
const { t } = r("Employee.Taxes"), { isPending: n } = s(), i = e();
|
|
10
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("submitCta") }) });
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
l as Actions
|
|
13
14
|
};
|
|
14
15
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,gBAAgB,GACvC,EAAE,WAAAC,EAAU,IAAIC,EAAS,GACzBC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
|
|
@@ -2,11 +2,12 @@ import { jsxs as l, Fragment as a, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as s, Trans as m } from "react-i18next";
|
|
3
3
|
import { z as t } from "zod";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
5
|
+
import "../../../shared/constants.js";
|
|
6
|
+
import { RadioGroupField as u } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
7
|
import { NumberInputField as i } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
9
|
-
|
|
8
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { SelectField as f } from "../../Common/Fields/SelectField/SelectField.js";
|
|
10
|
+
const q = t.object({
|
|
10
11
|
filingStatus: t.string().min(1),
|
|
11
12
|
twoJobs: t.string().min(1),
|
|
12
13
|
dependentsAmount: t.number().transform(String),
|
|
@@ -15,8 +16,8 @@ const R = t.object({
|
|
|
15
16
|
extraWithholding: t.number().transform(String),
|
|
16
17
|
w4DataType: t.enum(["pre_2020_w4", "rev_2020_w4"])
|
|
17
18
|
});
|
|
18
|
-
function
|
|
19
|
-
const { t: e } = s("Employee.Taxes"), o =
|
|
19
|
+
function v() {
|
|
20
|
+
const { t: e } = s("Employee.Taxes"), o = d(), n = [
|
|
20
21
|
{ value: "Single", label: e("filingStatusSingle") },
|
|
21
22
|
{ value: "Married", label: e("filingStatusMarried") },
|
|
22
23
|
{ value: "Head of Household", label: e("filingStatusHeadOfHousehold") },
|
|
@@ -24,7 +25,7 @@ function q() {
|
|
|
24
25
|
];
|
|
25
26
|
return /* @__PURE__ */ l(a, { children: [
|
|
26
27
|
/* @__PURE__ */ r(
|
|
27
|
-
|
|
28
|
+
f,
|
|
28
29
|
{
|
|
29
30
|
name: "filingStatus",
|
|
30
31
|
label: e("federalFilingStatus1c"),
|
|
@@ -35,7 +36,7 @@ function q() {
|
|
|
35
36
|
}
|
|
36
37
|
),
|
|
37
38
|
/* @__PURE__ */ r(
|
|
38
|
-
|
|
39
|
+
u,
|
|
39
40
|
{
|
|
40
41
|
name: "twoJobs",
|
|
41
42
|
label: e("multipleJobs2c"),
|
|
@@ -101,7 +102,7 @@ function q() {
|
|
|
101
102
|
] });
|
|
102
103
|
}
|
|
103
104
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
v as FederalForm,
|
|
106
|
+
q as FederalFormSchema
|
|
106
107
|
};
|
|
107
108
|
//# sourceMappingURL=FederalForm.js.map
|