@gusto/embedded-react-sdk 0.56.1 → 0.56.3
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 +36 -0
- package/dist/components/Common/FieldCaption/FieldCaption.js +18 -24
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js +3 -5
- package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.js +66 -62
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PaySchedule.js +60 -0
- package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js +67 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +59 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +57 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +46 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +101 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +81 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js +18 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +56 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +34 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js +77 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js +10 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +66 -0
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +75 -57
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/requirementSetError.js +15 -0
- package/dist/components/Company/StateTaxes/shared/requirementSetError.js.map +1 -0
- package/dist/components/Company/exports/companyManagement.js +7 -0
- package/dist/components/Company/exports/companyManagement.js.map +1 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +24 -24
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +51 -58
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +12 -7
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +87 -85
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +55 -54
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +81 -67
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +129 -125
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +30 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +41 -30
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js +159 -152
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +61 -59
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -31
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +16 -16
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +61 -61
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +192 -193
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +27 -22
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +55 -53
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +44 -41
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +48 -47
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/helpers.js +72 -67
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +37 -28
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +23 -22
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/informationRequestEnumHook.js +30 -0
- package/dist/contexts/ApiProvider/informationRequestEnumHook.js.map +1 -0
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +9 -8
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +2 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -0
- package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -0
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +18 -0
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -0
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +52 -50
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/common.json.js +36 -38
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.js +137 -135
- package/dist/index.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/shared/constants.js +39 -31
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Common/ActionsLayout/ActionsLayout.d.ts +1 -1
- package/dist/src/components/Common/Alert/Alert.d.ts +1 -1
- package/dist/src/components/Common/DataView/DataCards/DataCards.d.ts +1 -1
- package/dist/src/components/Common/DataView/DataTable/DataTable.d.ts +1 -1
- package/dist/src/components/Common/DataView/DataView.d.ts +1 -1
- package/dist/src/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -1
- package/dist/src/components/Common/DetailViewLayout/DetailViewLayout.d.ts +1 -1
- package/dist/src/components/Common/DocumentList/DocumentList.d.ts +1 -1
- package/dist/src/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -1
- package/dist/src/components/Common/EmptyData/EmptyData.d.ts +1 -1
- package/dist/src/components/Common/FieldCaption/FieldCaption.d.ts +1 -1
- package/dist/src/components/Common/FieldErrorMessage/FieldErrorMessage.d.ts +1 -1
- package/dist/src/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/src/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +1 -1
- package/dist/src/components/Common/Fields/PercentageField/PercentageField.d.ts +1 -1
- package/dist/src/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/src/components/Common/Fields/SelectField/SelectField.d.ts +1 -1
- package/dist/src/components/Common/Fields/hooks/FieldElementRegistryProvider.d.ts +1 -1
- package/dist/src/components/Common/Flex/Flex.d.ts +2 -2
- package/dist/src/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +1 -1
- package/dist/src/components/Common/Form/Form.d.ts +1 -1
- package/dist/src/components/Common/Grid/Grid.d.ts +1 -1
- package/dist/src/components/Common/HamburgerMenu/HamburgerMenu.d.ts +1 -1
- package/dist/src/components/Common/InlineSpinner/InlineSpinner.d.ts +1 -1
- package/dist/src/components/Common/InternalError/InternalError.d.ts +1 -1
- package/dist/src/components/Common/Loading/Loading.d.ts +1 -1
- package/dist/src/components/Common/OnboardingStatusBadge/index.d.ts +3 -3
- package/dist/src/components/Common/PaginationControl/PaginationControl.d.ts +1 -1
- package/dist/src/components/Common/PayrollLoading/PayrollLoading.d.ts +1 -1
- package/dist/src/components/Common/ReorderableList/ReorderableList.d.ts +1 -1
- package/dist/src/components/Common/RequirementsList/RequirementsList.d.ts +1 -1
- package/dist/src/components/Common/TaxInputs/TaxInputs.d.ts +7 -7
- package/dist/src/components/Common/Toast/Toast.d.ts +1 -1
- package/dist/src/components/Common/UI/Alert/Alert.d.ts +1 -1
- package/dist/src/components/Common/UI/Box/Box.d.ts +1 -1
- package/dist/src/components/Common/UI/BoxHeader/BoxHeader.d.ts +1 -1
- package/dist/src/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/src/components/Common/UI/Button/Button.d.ts +1 -1
- package/dist/src/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
- package/dist/src/components/Common/UI/CalendarPreview/CalendarLegend.d.ts +1 -1
- package/dist/src/components/Common/UI/CalendarPreview/CalendarPreview.d.ts +1 -1
- package/dist/src/components/Common/UI/Card/Card.d.ts +1 -1
- package/dist/src/components/Common/UI/Checkbox/Checkbox.d.ts +1 -1
- package/dist/src/components/Common/UI/ComboBox/ComboBox.d.ts +1 -1
- package/dist/src/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
- package/dist/src/components/Common/UI/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/components/Common/UI/DescriptionList/DescriptionList.d.ts +1 -1
- package/dist/src/components/Common/UI/Dialog/Dialog.d.ts +1 -1
- package/dist/src/components/Common/UI/FileInput/FileInput.d.ts +1 -1
- package/dist/src/components/Common/UI/FormBox/FormBox.d.ts +1 -1
- package/dist/src/components/Common/UI/FormBoxHeader/FormBoxHeader.d.ts +1 -1
- package/dist/src/components/Common/UI/Heading/Heading.d.ts +1 -1
- package/dist/src/components/Common/UI/Input/Input.d.ts +1 -1
- package/dist/src/components/Common/UI/Link/Link.d.ts +1 -1
- package/dist/src/components/Common/UI/List/OrderedList.d.ts +1 -1
- package/dist/src/components/Common/UI/List/UnorderedList.d.ts +1 -1
- package/dist/src/components/Common/UI/Menu/Menu.d.ts +1 -1
- package/dist/src/components/Common/UI/Modal/Modal.d.ts +1 -1
- package/dist/src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.d.ts +1 -1
- package/dist/src/components/Common/UI/NumberInput/NumberInput.d.ts +1 -1
- package/dist/src/components/Common/UI/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/src/components/Common/UI/Radio/Radio.d.ts +1 -1
- package/dist/src/components/Common/UI/Select/Select.d.ts +1 -1
- package/dist/src/components/Common/UI/Switch/Switch.d.ts +1 -1
- package/dist/src/components/Common/UI/Table/Table.d.ts +1 -1
- package/dist/src/components/Common/UI/Tabs/Tabs.d.ts +1 -1
- package/dist/src/components/Common/UI/Text/Text.d.ts +1 -1
- package/dist/src/components/Common/UI/TextArea/TextArea.d.ts +1 -1
- package/dist/src/components/Common/UI/TextInput/TextInput.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/AssignSignatory.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/AssignSignatorySelection.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/CreateSignatory/Actions.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/Head.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/InviteSignatory/Actions.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/SignatoryForm.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/TitleSelect.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccount.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountComponents.d.ts +3 -3
- package/dist/src/components/Company/BankAccount/BankAccountForm/Actions.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountForm/Head.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/AccountView.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/Actions.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/Head.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/Actions.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/Form.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/Head.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/Actions.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/Head.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/List.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/ManageSignatories.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentSigner.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/documentSignerStateMachine.d.ts +3 -3
- package/dist/src/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.d.ts +2 -2
- package/dist/src/components/Company/FederalTaxes/Actions.d.ts +1 -1
- package/dist/src/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -1
- package/dist/src/components/Company/FederalTaxes/Form.d.ts +1 -1
- package/dist/src/components/Company/FederalTaxes/Head.d.ts +1 -1
- package/dist/src/components/Company/Industry/Actions.d.ts +1 -1
- package/dist/src/components/Company/Industry/Edit.d.ts +1 -1
- package/dist/src/components/Company/Industry/Head.d.ts +1 -1
- package/dist/src/components/Company/Industry/Industry.d.ts +1 -1
- package/dist/src/components/Company/Industry/IndustrySelect.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/Actions.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/Form.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/Head.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/LocationForm.d.ts +1 -1
- package/dist/src/components/Company/Locations/Locations.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/Actions.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/Head.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/List.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/LocationsList.d.ts +1 -1
- package/dist/src/components/Company/Locations/locationsStateMachine.d.ts +2 -2
- package/dist/src/components/Company/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/src/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +9 -9
- package/dist/src/components/Company/OnboardingOverview/Completed.d.ts +1 -1
- package/dist/src/components/Company/OnboardingOverview/MissingRequirements.d.ts +1 -1
- package/dist/src/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/PaySchedule.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/PayScheduleComponents.d.ts +2 -2
- package/dist/src/components/Company/PaySchedule/PayScheduleForm.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/PayScheduleList.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +24 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.d.ts +10 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +9 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +35 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +29 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.d.ts +7 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.d.ts +12 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +9 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +20 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverview.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.d.ts +18 -0
- package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/payScheduleManagementStateMachine.d.ts +12 -0
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +8 -8
- package/dist/src/components/Company/StateTaxes/StateTaxes.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesComponents.d.ts +3 -3
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/Actions.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/Head.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/Actions.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/Head.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/List.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/AddRateAction.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/shared/RequirementFields.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/shared/requirementSetError.d.ts +18 -0
- package/dist/src/components/Company/StateTaxes/shared/requirementSetError.test.d.ts +1 -0
- package/dist/src/components/Company/exports/companyManagement.d.ts +2 -0
- package/dist/src/components/Contractor/Address/management/Address.d.ts +1 -1
- package/dist/src/components/Contractor/Address/management/AddressCard/AddressCard.d.ts +1 -1
- package/dist/src/components/Contractor/Address/management/AddressComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Address/management/AddressEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/Address/shared/useContractorAddressForm/fields.d.ts +5 -5
- package/dist/src/components/Contractor/Compensation/management/Compensation.d.ts +1 -1
- package/dist/src/components/Contractor/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -1
- package/dist/src/components/Contractor/Compensation/management/CompensationComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Compensation/management/CompensationEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/Compensation/shared/useContractorPayForm/fields.d.ts +2 -2
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/onboarding/ContractorList.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/onboarding/ContractorListView.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlow.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Dashboard/Dashboard.d.ts +1 -1
- package/dist/src/components/Contractor/Dashboard/DashboardComponents.d.ts +5 -5
- package/dist/src/components/Contractor/Dashboard/DashboardFlow.d.ts +1 -1
- package/dist/src/components/Contractor/Dashboard/DetailsView.d.ts +1 -1
- package/dist/src/components/Contractor/Dashboard/PayView.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +2 -2
- package/dist/src/components/Contractor/Documents/onboarding/DocumentsList/DocumentsList.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/fields.d.ts +19 -19
- package/dist/src/components/Contractor/Landing/Landing.d.ts +1 -1
- package/dist/src/components/Contractor/NewHireReport/NewHireReport.d.ts +1 -1
- package/dist/src/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/src/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +7 -7
- package/dist/src/components/Contractor/OnboardingSummary/OnboardingSummary.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethod.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethodComponents.d.ts +2 -2
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/onboarding/PaymentMethod.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.d.ts +4 -4
- package/dist/src/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +5 -5
- package/dist/src/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/management/Profile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/management/ProfileCard/ProfileCard.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/management/ProfileComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Profile/management/ProfileEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/BusinessSelfOnboardingProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/ContractorProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/IndividualSelfOnboardingProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/shared/useContractorDetailsForm/fields.d.ts +14 -14
- package/dist/src/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +6 -6
- package/dist/src/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +1 -1
- package/dist/src/components/Contractor/Submit/Submit.d.ts +1 -1
- package/dist/src/components/Contractor/Submit/SubmitDone.d.ts +1 -1
- package/dist/src/components/Contractor/shared/SelectContractors/SelectContractors.d.ts +1 -1
- package/dist/src/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/Compensation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationComponents.d.ts +4 -4
- package/dist/src/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/onboarding/Compensation.d.ts +2 -2
- package/dist/src/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +3 -3
- package/dist/src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/shared/PendingChangesReviewModal.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Compensation/shared/useJobForm/fields.d.ts +5 -5
- package/dist/src/components/Employee/Dashboard/BasicDetailsView.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/Dashboard.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/DashboardComponents.d.ts +13 -13
- package/dist/src/components/Employee/Dashboard/DashboardFlow.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/JobAndPayView.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/TaxesView.d.ts +2 -2
- package/dist/src/components/Employee/Deductions/management/Deductions.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/management/DeductionsComponents.d.ts +2 -2
- package/dist/src/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/onboarding/Deductions.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +2 -2
- package/dist/src/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +8 -8
- package/dist/src/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Documents/management/DocumentManager.d.ts +1 -1
- package/dist/src/components/Employee/Documents/management/Documents.d.ts +1 -1
- package/dist/src/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +1 -1
- package/dist/src/components/Employee/Documents/management/DocumentsComponents.d.ts +2 -2
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +4 -4
- package/dist/src/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +2 -2
- package/dist/src/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/src/components/Employee/Documents/shared/useSignEmployeeForm/fields.d.ts +39 -39
- package/dist/src/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +4 -4
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxesComponents.d.ts +2 -2
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +6 -6
- package/dist/src/components/Employee/HomeAddress/management/HomeAddress.d.ts +1 -1
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +1 -1
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressComponents.d.ts +2 -2
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +1 -1
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressView.d.ts +1 -1
- package/dist/src/components/Employee/Landing/Landing.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +3 -3
- package/dist/src/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
- package/dist/src/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +2 -2
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +3 -3
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/onboarding/ListView.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +2 -2
- package/dist/src/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +3 -3
- package/dist/src/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +4 -4
- package/dist/src/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +1 -1
- package/dist/src/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +1 -1
- package/dist/src/components/Employee/Profile/management/Profile.d.ts +1 -1
- package/dist/src/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +1 -1
- package/dist/src/components/Employee/Profile/management/ProfileComponents.d.ts +2 -2
- package/dist/src/components/Employee/Profile/management/ProfileEditForm.d.ts +1 -1
- package/dist/src/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -1
- package/dist/src/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -1
- package/dist/src/components/Employee/Profile/onboarding/Profile.d.ts +2 -2
- package/dist/src/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +2 -2
- package/dist/src/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +7 -7
- package/dist/src/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/management/StateTaxes.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/management/StateTaxesComponents.d.ts +2 -2
- package/dist/src/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.d.ts +6 -6
- package/dist/src/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +4 -4
- package/dist/src/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddress.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressComponents.d.ts +2 -2
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressView.d.ts +1 -1
- package/dist/src/components/Flow/Flow.d.ts +1 -1
- package/dist/src/components/Flow/FlowHeader.d.ts +1 -1
- package/dist/src/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +2 -2
- package/dist/src/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +1 -1
- package/dist/src/components/InformationRequests/InformationRequests.d.ts +1 -1
- package/dist/src/components/InformationRequests/InformationRequestsComponents.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +2 -2
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +1 -1
- package/dist/src/components/Payroll/Dismissal/DismissalFlow.d.ts +1 -1
- package/dist/src/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +2 -2
- package/dist/src/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +1 -1
- package/dist/src/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -3
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
- package/dist/src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +12 -0
- package/dist/src/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +6 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +7 -7
- package/dist/src/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollHistory/PayrollHistory.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollLanding/PayrollLanding.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +3 -3
- package/dist/src/components/Payroll/PayrollList/PayrollList.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecks.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksComponents.d.ts +3 -3
- package/dist/src/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCases.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +1 -1
- package/dist/src/components/Payroll/Transition/TransitionFlow.d.ts +1 -1
- package/dist/src/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreation.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayroll.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.d.ts +2 -2
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +6 -1
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +7 -1
- package/dist/src/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.d.ts +1 -1
- package/dist/src/components/Payroll/helpers.d.ts +34 -0
- package/dist/src/components/Payroll/usePreparedPayrollData.d.ts +6 -1
- package/dist/src/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +1 -1
- package/dist/src/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +12 -12
- package/dist/src/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +1 -1
- package/dist/src/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +1 -1
- package/dist/src/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +1 -1
- package/dist/src/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
- package/dist/src/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
- package/dist/src/components/index.d.ts +12 -0
- package/dist/src/contexts/ApiProvider/ApiProvider.d.ts +1 -1
- package/dist/src/contexts/ApiProvider/informationRequestEnumHook.d.ts +14 -0
- package/dist/src/contexts/ApiProvider/informationRequestEnumHook.test.d.ts +1 -0
- package/dist/src/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +1 -1
- package/dist/src/contexts/LocaleProvider/LocaleProvider.d.ts +1 -1
- package/dist/src/contexts/ObservabilityProvider/ObservabilityProvider.d.ts +1 -1
- package/dist/src/contexts/ThemeProvider/customRender.d.ts +1 -1
- package/dist/src/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.d.ts +1 -1
- package/dist/src/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +2 -0
- package/dist/src/helpers/dateFormatting.d.ts +2 -2
- package/dist/src/helpers/formattedStrings.d.ts +15 -0
- package/dist/src/i18n/en/common.json.d.ts +0 -1
- package/dist/src/i18n/types.d.ts +99 -7
- package/dist/src/models/external.d.ts +12 -0
- package/dist/src/partner-hook-utils/form/FormFieldsMetadataProvider.d.ts +1 -1
- package/dist/src/partner-hook-utils/form/SDKFormProvider.d.ts +1 -1
- package/dist/src/shared/constants.d.ts +16 -0
- package/dist/src/test-utils/renderWithProviders.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/sdkError.js +32 -21
- package/dist/types/sdkError.js.map +1 -1
- package/docs/guides/endpoint-inventory.json +59 -10
- package/package.json +11 -11
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { OffCycleReasonType as
|
|
2
|
-
import { useCallback as
|
|
1
|
+
import { OffCycleReasonType as T } from "@gusto/embedded-api/models/components/payrollshow";
|
|
2
|
+
import { useCallback as v } from "react";
|
|
3
3
|
import { useTranslation as S } from "react-i18next";
|
|
4
|
-
import { PayrollCategory as
|
|
5
|
-
import { formatPayRate as
|
|
4
|
+
import { PayrollCategory as x, isOffCyclePayroll as M } from "./payrollTypes.js";
|
|
5
|
+
import { formatPayRate as N } from "../../helpers/formattedStrings.js";
|
|
6
6
|
import { useLocale as L } from "../../contexts/LocaleProvider/useLocale.js";
|
|
7
|
-
import { FlsaStatus as
|
|
8
|
-
import { MS_PER_HOUR as
|
|
9
|
-
const A = "regular hours",
|
|
7
|
+
import { FlsaStatus as g } from "../../shared/constants.js";
|
|
8
|
+
import { MS_PER_HOUR as D } from "../../helpers/dateFormatting.js";
|
|
9
|
+
const A = "regular hours", p = (e) => e.jobs?.find((t) => t.primary) || e.jobs?.[0] || null, j = (e) => Math.round(e * 1e6) / 1e6, R = (e) => Math.round(e * 100) / 100, H = (e) => e.toLowerCase() === A, U = {
|
|
10
10
|
Daily: 8,
|
|
11
11
|
"Every week": 40,
|
|
12
12
|
"Every other week": 80,
|
|
@@ -15,35 +15,35 @@ const A = "regular hours", g = (e) => e.jobs?.find((t) => t.primary) || e.jobs?.
|
|
|
15
15
|
Quarterly: 520,
|
|
16
16
|
Semiannually: 1040,
|
|
17
17
|
Annually: 2080
|
|
18
|
-
},
|
|
18
|
+
}, W = ({
|
|
19
19
|
employee: e,
|
|
20
20
|
t,
|
|
21
21
|
locale: r = "en-US"
|
|
22
22
|
}) => {
|
|
23
23
|
if (!e?.jobs)
|
|
24
24
|
return null;
|
|
25
|
-
const n =
|
|
25
|
+
const n = p(e);
|
|
26
26
|
if (!n?.compensations)
|
|
27
27
|
return null;
|
|
28
28
|
const o = n.compensations[0];
|
|
29
29
|
if (!o || !o.rate || parseFloat(o.rate) === 0)
|
|
30
30
|
return null;
|
|
31
31
|
const s = parseFloat(o.rate), u = o.paymentUnit || "Hour";
|
|
32
|
-
return
|
|
32
|
+
return N({ rate: s, paymentUnit: u, t, locale: r });
|
|
33
33
|
}, ae = () => {
|
|
34
34
|
const { t: e } = S("common"), { locale: t } = L();
|
|
35
|
-
return
|
|
36
|
-
(r) =>
|
|
35
|
+
return v(
|
|
36
|
+
(r) => W({ employee: r, t: e, locale: t }),
|
|
37
37
|
[e, t]
|
|
38
38
|
);
|
|
39
39
|
}, ue = (e) => e.hourlyCompensations ? e.hourlyCompensations.filter((t) => t.name?.toLowerCase() === "regular hours").reduce((t, r) => t + parseFloat(r.hours || "0"), 0) : 0;
|
|
40
40
|
function ie(e) {
|
|
41
41
|
return !e.hourlyCompensations || e.excluded ? 0 : e.hourlyCompensations.filter((t) => Number(t.compensationMultiplier) > 1).reduce((t, r) => t + parseFloat(r.hours || "0"), 0);
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const _ = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r.hours || "0"), 0) : 0, I = (e) => e.fixedCompensations ? e.fixedCompensations.filter((t) => {
|
|
44
44
|
const r = t.name?.toLowerCase() || "", n = parseFloat(t.amount || "0");
|
|
45
45
|
return r !== "reimbursement" && r !== "minimum wage adjustment" && n > 0;
|
|
46
|
-
}).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0,
|
|
46
|
+
}).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0, ce = (e) => {
|
|
47
47
|
if (e.reimbursements && e.reimbursements.length > 0)
|
|
48
48
|
return e.reimbursements.reduce(
|
|
49
49
|
(r, n) => r + parseFloat(n.amount || "0"),
|
|
@@ -55,7 +55,7 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
55
55
|
(r) => r.name?.toLowerCase() === "reimbursement"
|
|
56
56
|
);
|
|
57
57
|
return t ? parseFloat(t.amount || "0") : 0;
|
|
58
|
-
},
|
|
58
|
+
}, le = (e) => {
|
|
59
59
|
const t = [];
|
|
60
60
|
let r = 0;
|
|
61
61
|
return e.forEach((n) => {
|
|
@@ -73,9 +73,9 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
73
73
|
amount: r.toFixed(2)
|
|
74
74
|
}), t;
|
|
75
75
|
}, fe = (e) => {
|
|
76
|
-
const t =
|
|
76
|
+
const t = R(e);
|
|
77
77
|
return t % 1 === 0 ? `${t}.0` : t.toString();
|
|
78
|
-
}, k = (e) => e.frequency && U[e.frequency] || 0,
|
|
78
|
+
}, k = (e) => e.frequency && U[e.frequency] || 0, P = (e, t) => {
|
|
79
79
|
if (!e.length) return null;
|
|
80
80
|
const r = [...e].sort(
|
|
81
81
|
(n, o) => (n.effectiveDate ? new Date(n.effectiveDate).getTime() : 0) - (o.effectiveDate ? new Date(o.effectiveDate).getTime() : 0)
|
|
@@ -97,10 +97,10 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
97
97
|
return r[n] || null;
|
|
98
98
|
}
|
|
99
99
|
return r[0] || null;
|
|
100
|
-
}, Y = (e) => e.flsaStatus === "Exempt" || e.flsaStatus === "Salaried Nonexempt", me = (e) => e ===
|
|
100
|
+
}, Y = (e) => e.flsaStatus === "Exempt" || e.flsaStatus === "Salaried Nonexempt", me = (e) => e === g.NONEXEMPT || e === g.SALARIED_NONEXEMPT || e === g.COMMISSION_ONLY_NONEXEMPT, J = (e) => e.length ? e.filter((t) => {
|
|
101
101
|
const r = t.name?.toLowerCase(), n = parseFloat(t.amount || "0");
|
|
102
102
|
return (r === "paycheck tips" || r === "cash tips") && n > 0;
|
|
103
|
-
}).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0,
|
|
103
|
+
}).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0, h = (e) => {
|
|
104
104
|
const t = parseFloat(e.rate || "0");
|
|
105
105
|
switch (e.paymentUnit || "Hour") {
|
|
106
106
|
case "Hour":
|
|
@@ -122,19 +122,19 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
122
122
|
const n = e.jobs?.find((s) => s.uuid === t);
|
|
123
123
|
if (!n?.compensations)
|
|
124
124
|
return 0;
|
|
125
|
-
const o =
|
|
126
|
-
return o ?
|
|
127
|
-
},
|
|
128
|
-
const r =
|
|
125
|
+
const o = P(n.compensations, r);
|
|
126
|
+
return o ? h(o) : 0;
|
|
127
|
+
}, b = (e, t) => {
|
|
128
|
+
const r = p(e);
|
|
129
129
|
if (!r?.compensations)
|
|
130
130
|
return 0;
|
|
131
|
-
const n =
|
|
132
|
-
return n ?
|
|
131
|
+
const n = P(r.compensations, t);
|
|
132
|
+
return n ? h(n) : 0;
|
|
133
133
|
}, X = (e) => e.paidTimeOff ? e.paidTimeOff.reduce(
|
|
134
134
|
(t, r) => t + parseFloat(r.finalPayoutUnusedHoursInput || "0"),
|
|
135
135
|
0
|
|
136
|
-
) : 0,
|
|
137
|
-
const o =
|
|
136
|
+
) : 0, w = (e, t, r, n) => {
|
|
137
|
+
const o = _(e);
|
|
138
138
|
if (n) {
|
|
139
139
|
const s = X(e);
|
|
140
140
|
return o + s;
|
|
@@ -149,82 +149,85 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
149
149
|
if (!n)
|
|
150
150
|
return 0;
|
|
151
151
|
const o = t.hourlyCompensations?.reduce(
|
|
152
|
-
(f,
|
|
152
|
+
(f, c) => f + parseFloat(c.hours || "0"),
|
|
153
153
|
0
|
|
154
|
-
) || 0, s =
|
|
154
|
+
) || 0, s = h(e), u = (parseFloat(n.wage || "0") - s) * o, a = J(t.fixedCompensations || []);
|
|
155
155
|
return Math.max(0, u - a);
|
|
156
156
|
}, Q = (e, t, r, n, o, s, u) => {
|
|
157
157
|
if (!u && n)
|
|
158
|
-
return
|
|
158
|
+
return b(t, r) * (o - s);
|
|
159
159
|
if (!e.hourlyCompensations || !t.jobs)
|
|
160
160
|
return 0;
|
|
161
|
-
const a = e.hourlyCompensations.reduce((i,
|
|
162
|
-
const d = parseFloat(
|
|
161
|
+
const a = e.hourlyCompensations.reduce((i, l) => {
|
|
162
|
+
const d = parseFloat(l.hours || "0"), y = G(t, l.jobUuid || "", r);
|
|
163
163
|
return i + d * y;
|
|
164
|
-
}, 0), f = e.hourlyCompensations.reduce((i,
|
|
164
|
+
}, 0), f = e.hourlyCompensations.reduce((i, l) => i + parseFloat(l.hours || "0"), 0);
|
|
165
165
|
if (f === 0) return a;
|
|
166
|
-
const
|
|
167
|
-
const d = parseFloat(
|
|
168
|
-
return i + d *
|
|
166
|
+
const c = j(a / f), m = e.hourlyCompensations.filter((i) => !H(i.name || "")).reduce((i, l) => {
|
|
167
|
+
const d = parseFloat(l.hours || "0"), y = l.compensationMultiplier || 1;
|
|
168
|
+
return i + d * c * (y - 1);
|
|
169
169
|
}, 0);
|
|
170
170
|
return a + m;
|
|
171
171
|
}, $ = (e, t, r, n, o, s) => {
|
|
172
|
-
const u =
|
|
172
|
+
const u = w(
|
|
173
173
|
e,
|
|
174
174
|
n,
|
|
175
175
|
o,
|
|
176
176
|
s
|
|
177
|
-
), a =
|
|
177
|
+
), a = b(t, r);
|
|
178
178
|
return u * a;
|
|
179
179
|
}, z = (e, t, r) => {
|
|
180
180
|
if (!t) return !1;
|
|
181
181
|
const n = e.hourlyCompensations?.find(
|
|
182
|
-
(s) =>
|
|
182
|
+
(s) => H(s.name || "")
|
|
183
183
|
);
|
|
184
184
|
return n ? parseFloat(n.hours || "0") === r : !1;
|
|
185
|
-
}, de = (e, t, r, n, o =
|
|
185
|
+
}, de = (e, t, r, n, o = x.Regular) => {
|
|
186
186
|
if (e.excluded)
|
|
187
187
|
return 0;
|
|
188
|
-
const s = r ? new Date(r) : /* @__PURE__ */ new Date(), u =
|
|
188
|
+
const s = r ? new Date(r) : /* @__PURE__ */ new Date(), u = p(t);
|
|
189
189
|
if (!u?.compensations)
|
|
190
190
|
return 0;
|
|
191
|
-
const a =
|
|
191
|
+
const a = P(
|
|
192
192
|
u.compensations,
|
|
193
193
|
s
|
|
194
194
|
);
|
|
195
195
|
if (!a)
|
|
196
196
|
return 0;
|
|
197
|
-
const f = Y(a),
|
|
197
|
+
const f = Y(a), c = n ? k(n) : 0, m = z(
|
|
198
198
|
e,
|
|
199
199
|
f,
|
|
200
|
-
|
|
201
|
-
), i =
|
|
200
|
+
c
|
|
201
|
+
), i = M(o), l = w(
|
|
202
202
|
e,
|
|
203
203
|
m,
|
|
204
|
-
|
|
204
|
+
c,
|
|
205
205
|
i
|
|
206
206
|
), d = Q(
|
|
207
207
|
e,
|
|
208
208
|
t,
|
|
209
209
|
s,
|
|
210
210
|
m,
|
|
211
|
-
l,
|
|
212
211
|
c,
|
|
212
|
+
l,
|
|
213
213
|
i
|
|
214
|
-
), y = I(e),
|
|
214
|
+
), y = I(e), E = $(
|
|
215
215
|
e,
|
|
216
216
|
t,
|
|
217
217
|
s,
|
|
218
218
|
m,
|
|
219
|
-
|
|
219
|
+
c,
|
|
220
220
|
i
|
|
221
|
-
),
|
|
221
|
+
), F = q(
|
|
222
222
|
a,
|
|
223
223
|
e,
|
|
224
224
|
s
|
|
225
|
-
),
|
|
226
|
-
return
|
|
227
|
-
}, ye = (e) => e ===
|
|
225
|
+
), O = d + y + E + F;
|
|
226
|
+
return R(O);
|
|
227
|
+
}, ye = (e) => e === T.DismissedEmployee, ge = (e) => e === T.TaxReconciliation, pe = (e, t) => t.formatPayPeriodRange(
|
|
228
|
+
e.payPeriod?.startDate,
|
|
229
|
+
e.payPeriod?.endDate
|
|
230
|
+
) || t.formatShortWithYear(e.checkDate), K = {
|
|
228
231
|
Bonus: "Bonus",
|
|
229
232
|
Correction: "Correction",
|
|
230
233
|
"Transition from old pay schedule": "Transition",
|
|
@@ -235,7 +238,7 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
235
238
|
"Tax reconciliation": "Tax Reconciliation",
|
|
236
239
|
Reversal: "Reversal",
|
|
237
240
|
"Disability insurance distribution": "Disability Insurance"
|
|
238
|
-
},
|
|
241
|
+
}, Pe = (e) => e.external ? "External" : e.offCycle && e.offCycleReason ? K[e.offCycleReason] ?? e.offCycleReason : e.offCycle ? "Off-Cycle" : "Regular", he = ({
|
|
239
242
|
flsaStatus: e,
|
|
240
243
|
existingFixedCompensations: t = [],
|
|
241
244
|
primaryJobUuid: r,
|
|
@@ -243,42 +246,44 @@ const W = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
|
|
|
243
246
|
excludedTypes: o = []
|
|
244
247
|
}) => {
|
|
245
248
|
const s = [...t];
|
|
246
|
-
return e !==
|
|
249
|
+
return e !== g.OWNER && r && n.length > 0 && n.map((a) => a.name).filter(Boolean).forEach((a) => {
|
|
247
250
|
s.some(
|
|
248
|
-
(
|
|
251
|
+
(c) => c.name?.toLowerCase() === a.toLowerCase()
|
|
249
252
|
) || s.push({
|
|
250
253
|
name: a,
|
|
251
254
|
amount: "0.00",
|
|
252
255
|
jobUuid: r
|
|
253
256
|
});
|
|
254
257
|
}), s.filter((u) => u.name && !o.includes(u.name)).sort((u, a) => (u.name || "").localeCompare(a.name || ""));
|
|
255
|
-
},
|
|
258
|
+
}, De = (e) => e.totals ? Number(e.totals.grossPay ?? 0) + Number(e.totals.employerTaxes ?? 0) + Number(e.totals.reimbursements ?? 0) + Number(e.totals.benefits ?? 0) : 0, C = (e) => {
|
|
256
259
|
const t = e.getFullYear(), r = new Date(t, 2, 1);
|
|
257
260
|
r.setDate(1 + (7 - r.getDay()) + 7);
|
|
258
261
|
const n = new Date(t, 10, 1);
|
|
259
262
|
return n.setDate(1 + (7 - n.getDay()) % 7), e >= r && e < n ? -7 : -8;
|
|
260
|
-
},
|
|
263
|
+
}, Ce = (e) => {
|
|
261
264
|
if (e.payrollStatusMeta?.cancellable === !1 || !e.processed || !e.payrollDeadline)
|
|
262
265
|
return !1;
|
|
263
|
-
const t = /* @__PURE__ */ new Date(), r = new Date(e.payrollDeadline), n = new Date(t.getTime() +
|
|
266
|
+
const t = /* @__PURE__ */ new Date(), r = new Date(e.payrollDeadline), n = new Date(t.getTime() + C(t) * D), o = new Date(r.getTime() + C(r) * D), s = new Date(o);
|
|
264
267
|
return s.setUTCHours(16, 0, 0, 0), !(n >= s);
|
|
265
268
|
};
|
|
266
269
|
export {
|
|
267
270
|
de as calculateGrossPay,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
De as calculateTotalPayroll,
|
|
272
|
+
Ce as canCancelPayroll,
|
|
273
|
+
le as cleanupReimbursements,
|
|
274
|
+
W as formatEmployeePayRate,
|
|
272
275
|
fe as formatHoursDisplay,
|
|
273
276
|
I as getAdditionalEarnings,
|
|
274
|
-
|
|
277
|
+
he as getAdditionalEarningsCompensations,
|
|
275
278
|
ie as getOvertimeHours,
|
|
276
|
-
pe as
|
|
279
|
+
pe as getPayPeriodOrCheckDateLabel,
|
|
280
|
+
Pe as getPayrollTypeLabel,
|
|
277
281
|
ue as getRegularHours,
|
|
278
|
-
|
|
279
|
-
|
|
282
|
+
ce as getReimbursements,
|
|
283
|
+
_ as getTotalPtoHours,
|
|
280
284
|
ye as isDismissalPayroll,
|
|
281
285
|
me as isOvertimeEligibleFlsaStatus,
|
|
286
|
+
ge as isTaxReconciliationPayroll,
|
|
282
287
|
ae as useFormatEmployeePayRate
|
|
283
288
|
};
|
|
284
289
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport {\n type PayrollShowFixedCompensations,\n OffCycleReasonType,\n} from '@gusto/embedded-api/models/components/payrollshow'\nimport type {\n FixedCompensations,\n Reimbursements as Reimbursement,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateReimbursements } from '@gusto/embedded-api/models/components/payrollupdate'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow as PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { PayrollType } from './PayrollList/types'\nimport { PayrollCategory, isOffCyclePayroll } from './payrollTypes'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n/**\n * The compensation fields the payroll math helpers operate on.\n *\n * @remarks\n * These helpers run over both compensation representations the API returns: the\n * prepared (base) shape used when editing a payroll and the calculated (show)\n * shape rendered after calculation. The two are interchangeable for every field\n * read here and differ only on `deductions`, which no helper touches. Omitting\n * `deductions` lets a single input type accept either shape without a cast.\n *\n * @internal\n */\ntype EmployeeCompensationInput = Omit<PayrollEmployeeCompensationsType, 'deductions'>\n\n// Utility to get the primary job from an employee\nconst getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\n/**\n * Formats an employee's primary-job pay rate into a localized display string.\n *\n * @remarks\n * Returns `null` when the employee has no jobs, the primary job has no compensations, or the rate is missing\n * or zero.\n *\n * @param args - The employee, translation function, and locale to format against.\n * @returns The formatted pay-rate string, or `null` when no usable rate is available.\n * @internal\n */\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\n/**\n * Returns a memoized formatter that produces a localized pay-rate string from an employee's primary job.\n *\n * @returns A callback that takes an `Employee` and returns the formatted pay-rate string, or `null` when the\n * employee has no usable primary-job compensation.\n * @internal\n */\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\n/**\n * Sums hourly-compensation rows named `'regular hours'`.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total regular hours worked, or `0` when none are recorded.\n * @internal\n */\nexport const getRegularHours = (compensation: EmployeeCompensationInput) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the overtime hours (multiplier greater than `1`) from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total overtime hours, or `0` when the compensation is excluded or has none.\n * @internal\n */\nexport function getOvertimeHours(compensation: EmployeeCompensationInput) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the paid-time-off hours from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total PTO hours, or `0` when none are recorded.\n * @internal\n */\nexport const getTotalPtoHours = (compensation: EmployeeCompensationInput) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\n/**\n * Sums fixed-compensation amounts excluding reimbursements and minimum-wage adjustments.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total additional earnings amount, or `0` when none qualify.\n * @internal\n */\nexport const getAdditionalEarnings = (compensation: EmployeeCompensationInput) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\n/**\n * Returns the total reimbursement amount for an employee compensation.\n *\n * @remarks\n * Prefers the explicit `reimbursements` array when present; falls back to a fixed-compensation row named\n * `'Reimbursement'` for older payroll shapes.\n *\n * @param compensation - The employee compensation entry.\n * @returns The summed reimbursement amount, or `0` when none.\n * @internal\n */\nexport const getReimbursements = (compensation: EmployeeCompensationInput) => {\n if (compensation.reimbursements && compensation.reimbursements.length > 0) {\n return compensation.reimbursements.reduce(\n (sum, reimbursement) => sum + parseFloat(reimbursement.amount || '0'),\n 0,\n )\n }\n\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\n/**\n * Normalizes a reimbursement list for submission to the v2025-11-15 API.\n *\n * @remarks\n * - Drops named rows that would be no-ops on the server (zero amount with no existing uuid).\n * - Drops named rows with an existing uuid and zero amount — these are removals, and the backend's\n * `replace_itemized_reimbursements` deletes any persisted reimbursement whose uuid is omitted from the\n * incoming list.\n * - Consolidates multiple unnamed (description-less) rows into a single unnamed entry, since the API rejects\n * more than one unnamed reimbursement per employee.\n * - When the consolidated unnamed total is zero, sends no unnamed entry at all. The backend's full-replace\n * semantics then delete any persisted unnamed entry (unnamed entries never have uuids, so this is the only\n * way to remove them).\n * - Maps the read shape (`description: string | null`) to the write shape (`description?: string`), omitting\n * the field when there is no description.\n *\n * @param reimbursements - The reimbursements pulled from the prepared payroll.\n * @returns The normalized reimbursements ready to send on a payroll update.\n * @internal\n */\nexport const cleanupReimbursements = (\n reimbursements: Reimbursement[],\n): PayrollUpdateReimbursements[] => {\n const consolidated: PayrollUpdateReimbursements[] = []\n let unnamedTotal = 0\n\n reimbursements.forEach(reimbursement => {\n const amount = reimbursement.amount\n const numericAmount = parseFloat(amount || '0')\n const description = reimbursement.description?.trim() || ''\n const uuid = reimbursement.uuid ?? undefined\n\n if (description === '') {\n unnamedTotal += numericAmount\n return\n }\n\n if (numericAmount === 0 && !uuid) {\n return\n }\n\n consolidated.push({\n amount,\n description,\n ...(uuid ? { uuid } : {}),\n })\n })\n\n if (unnamedTotal > 0) {\n consolidated.push({\n amount: unnamedTotal.toFixed(2),\n })\n }\n\n return consolidated\n}\n\n/**\n * Formats an hours value for display, rounding to two decimals and ensuring whole numbers render with `.0`.\n *\n * @param hours - The hours value to format.\n * @returns A string like `'40.0'` or `'37.25'`.\n * @internal\n */\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\n/**\n * Whether an FLSA status is eligible for regular-rate-of-pay overtime.\n *\n * @remarks\n * Only the nonexempt family (`Nonexempt`, `Salaried Nonexempt`,\n * `Commission Only Nonexempt`) earns overtime premiums, so only those statuses\n * warrant per-workweek breakdowns. `Exempt`, `Owner`, and\n * `Commission Only Exempt` are never overtime-eligible. An unknown status\n * returns `false` (treat as flat, never show meaningless workweek columns).\n *\n * @param flsaStatus - The employee's FLSA status, e.g. from `hourlyCompensations[].flsaStatus`.\n * @returns `true` only for the three nonexempt statuses.\n * @internal\n */\nexport const isOvertimeEligibleFlsaStatus = (flsaStatus: string | undefined): boolean =>\n flsaStatus === FlsaStatus.NONEXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: EmployeeCompensationInput): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: EmployeeCompensationInput,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: EmployeeCompensationInput,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: EmployeeCompensationInput,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: EmployeeCompensationInput,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: EmployeeCompensationInput,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\n/**\n * Calculates an employee's gross pay for a payroll, combining regular and overtime pay,\n * additional earnings, PTO pay, and any minimum-wage adjustment.\n *\n * @remarks\n * Returns `0` when the compensation is excluded or the employee has no primary job compensation effective\n * on the given date. The result is rounded to two decimal places.\n *\n * @param compensation - The employee compensation entry from the payroll.\n * @param employee - The employee record (used to look up jobs and effective compensations).\n * @param compensationEffectiveDateString - ISO date used to resolve the effective compensation; defaults to now.\n * @param paySchedule - The pay schedule, used to derive expected hours per pay period.\n * @param payrollCategory - The payroll category; off-cycle categories change how PTO hours are summed.\n * @returns The gross pay amount.\n * @internal\n */\nexport const calculateGrossPay = (\n compensation: EmployeeCompensationInput,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const offCycle = isOffCyclePayroll(payrollCategory)\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n offCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n/**\n * Returns the high-level payroll type — `'External'`, `'Off-Cycle'`, or `'Regular'`.\n *\n * @param payroll - The payroll whose type to classify.\n * @returns The payroll type string.\n * @internal\n */\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Returns whether an off-cycle reason indicates a dismissal payroll.\n *\n * @param offCycleReason - The payroll's off-cycle reason string.\n * @returns `true` when the reason matches the dismissed-employee reason.\n * @internal\n */\nexport const isDismissalPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.DismissedEmployee\n\nconst OFF_CYCLE_REASON_LABELS: Record<string, string> = {\n Bonus: 'Bonus',\n Correction: 'Correction',\n 'Transition from old pay schedule': 'Transition',\n 'Dismissed employee': 'Dismissal',\n 'Hired employee': 'New Hire',\n 'Benefit reversal': 'Benefit Reversal',\n 'Wage correction': 'Wage Correction',\n 'Tax reconciliation': 'Tax Reconciliation',\n Reversal: 'Reversal',\n 'Disability insurance distribution': 'Disability Insurance',\n}\n\n/**\n * Returns a human-readable label describing the payroll type, mapping off-cycle reasons to display strings.\n *\n * @param payroll - The payroll whose type to describe.\n * @returns `'External'`, `'Regular'`, `'Off-Cycle'`, or a label derived from the off-cycle reason\n * (e.g. `'Bonus'`, `'Dismissal'`).\n * @internal\n */\nexport const getPayrollTypeLabel = (payroll: {\n external?: boolean\n offCycle?: boolean\n offCycleReason?: string | null\n}): string => {\n if (payroll.external) return 'External'\n if (payroll.offCycle && payroll.offCycleReason) {\n return OFF_CYCLE_REASON_LABELS[payroll.offCycleReason] ?? payroll.offCycleReason\n }\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Merges existing fixed compensations with placeholder entries for any compensation types the employee\n * doesn't yet have, then filters out excluded types and sorts the result alphabetically.\n *\n * @remarks\n * Owners (FLSA status `Owner`) never receive placeholder entries. Placeholders are added with `amount: '0.00'`\n * and the supplied `primaryJobUuid`.\n *\n * @param options - Inputs controlling which placeholder entries to add and which types to exclude.\n * @returns The merged, filtered, and sorted list of fixed compensations.\n * @internal\n */\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\n/**\n * Sums gross pay, employer taxes, reimbursements, and benefits from a payroll's totals.\n *\n * @param payrollData - The payroll whose totals to sum.\n * @returns The total payroll cost, or `0` when `payrollData.totals` is missing.\n * @internal\n */\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines whether a payroll can be cancelled based on its status, deadline, and the 4:00 PM PT cutoff.\n *\n * @remarks\n * Returns `true` only when the payroll has been processed, `payrollStatusMeta.cancellable` is not explicitly `false`,\n * the payroll has a `payrollDeadline`, and the current time is before 4:00 PM Pacific Time on that deadline date.\n *\n * @param payroll - The payroll to evaluate.\n * @returns `true` if the payroll is still cancellable, `false` otherwise.\n * @internal\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursement","reimbursementComp","cleanupReimbursements","reimbursements","consolidated","unnamedTotal","numericAmount","description","uuid","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","isOvertimeEligibleFlsaStatus","flsaStatus","FlsaStatus","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","payrollCategory","PayrollCategory","compensationEffectiveDate","salaried","isOffCyclePayroll","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","isDismissalPayroll","offCycleReason","OffCycleReasonType","OFF_CYCLE_REASON_LABELS","getPayrollTypeLabel","payroll","getAdditionalEarningsCompensations","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","type","comp","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;;;AAwBA,MAAMA,IAAqB,iBAiBrBC,IAAgB,CAACC,MACdA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EAC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IACvC,GAaAC,IAAuB,CAACC,MAAuB;AACnD,QAAMC,IAAOD,EAAK,YAAA,GAEZE,IAAoB,IAAI,KAAKD,GAAM,GAAG,CAAC;AAC7C,EAAAC,EAAkB,QAAQ,KAAK,IAAIA,EAAkB,OAAA,KAAY,CAAC;AAElE,QAAMC,IAAsB,IAAI,KAAKF,GAAM,IAAI,CAAC;AAChD,SAAAE,EAAoB,QAAQ,KAAM,IAAIA,EAAoB,OAAA,KAAY,CAAE,GAE1DH,KAAQE,KAAqBF,IAAOG,IACnC,KAAK;AACtB,GAaaC,KAAmB,CAAChB,MAA8B;AAS7D,MARIA,EAAQ,mBAAmB,gBAAgB,MAI3C,CAACA,EAAQ,aAIT,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMiB,wBAAU,KAAA,GACVC,IAAW,IAAI,KAAKlB,EAAQ,eAAe,GAE3CmB,IAAU,IAAI,KAAKF,EAAI,YAAYN,EAAqBM,CAAG,IAAIG,CAAW,GAC1EC,IAAe,IAAI,KAAKH,EAAS,YAAYP,EAAqBO,CAAQ,IAAIE,CAAW,GAEzFE,IAAa,IAAI,KAAKD,CAAY;AAGxC,SAFAC,EAAW,YAAY,IAAI,GAAG,GAAG,CAAC,GAE9B,EAAAH,KAAWG;AAKjB;"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport {\n type PayrollShowFixedCompensations,\n OffCycleReasonType,\n} from '@gusto/embedded-api/models/components/payrollshow'\nimport type {\n FixedCompensations,\n Reimbursements as Reimbursement,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateReimbursements } from '@gusto/embedded-api/models/components/payrollupdate'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow as PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { PayrollType } from './PayrollList/types'\nimport { PayrollCategory, isOffCyclePayroll } from './payrollTypes'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nimport type { useDateFormatter } from '@/hooks/useDateFormatter'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n/**\n * The compensation fields the payroll math helpers operate on.\n *\n * @remarks\n * These helpers run over both compensation representations the API returns: the\n * prepared (base) shape used when editing a payroll and the calculated (show)\n * shape rendered after calculation. The two are interchangeable for every field\n * read here and differ only on `deductions`, which no helper touches. Omitting\n * `deductions` lets a single input type accept either shape without a cast.\n *\n * @internal\n */\ntype EmployeeCompensationInput = Omit<PayrollEmployeeCompensationsType, 'deductions'>\n\n// Utility to get the primary job from an employee\nconst getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\n/**\n * Formats an employee's primary-job pay rate into a localized display string.\n *\n * @remarks\n * Returns `null` when the employee has no jobs, the primary job has no compensations, or the rate is missing\n * or zero.\n *\n * @param args - The employee, translation function, and locale to format against.\n * @returns The formatted pay-rate string, or `null` when no usable rate is available.\n * @internal\n */\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\n/**\n * Returns a memoized formatter that produces a localized pay-rate string from an employee's primary job.\n *\n * @returns A callback that takes an `Employee` and returns the formatted pay-rate string, or `null` when the\n * employee has no usable primary-job compensation.\n * @internal\n */\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\n/**\n * Sums hourly-compensation rows named `'regular hours'`.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total regular hours worked, or `0` when none are recorded.\n * @internal\n */\nexport const getRegularHours = (compensation: EmployeeCompensationInput) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the overtime hours (multiplier greater than `1`) from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total overtime hours, or `0` when the compensation is excluded or has none.\n * @internal\n */\nexport function getOvertimeHours(compensation: EmployeeCompensationInput) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the paid-time-off hours from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total PTO hours, or `0` when none are recorded.\n * @internal\n */\nexport const getTotalPtoHours = (compensation: EmployeeCompensationInput) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\n/**\n * Sums fixed-compensation amounts excluding reimbursements and minimum-wage adjustments.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total additional earnings amount, or `0` when none qualify.\n * @internal\n */\nexport const getAdditionalEarnings = (compensation: EmployeeCompensationInput) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\n/**\n * Returns the total reimbursement amount for an employee compensation.\n *\n * @remarks\n * Prefers the explicit `reimbursements` array when present; falls back to a fixed-compensation row named\n * `'Reimbursement'` for older payroll shapes.\n *\n * @param compensation - The employee compensation entry.\n * @returns The summed reimbursement amount, or `0` when none.\n * @internal\n */\nexport const getReimbursements = (compensation: EmployeeCompensationInput) => {\n if (compensation.reimbursements && compensation.reimbursements.length > 0) {\n return compensation.reimbursements.reduce(\n (sum, reimbursement) => sum + parseFloat(reimbursement.amount || '0'),\n 0,\n )\n }\n\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\n/**\n * Normalizes a reimbursement list for submission to the v2025-11-15 API.\n *\n * @remarks\n * - Drops named rows that would be no-ops on the server (zero amount with no existing uuid).\n * - Drops named rows with an existing uuid and zero amount — these are removals, and the backend's\n * `replace_itemized_reimbursements` deletes any persisted reimbursement whose uuid is omitted from the\n * incoming list.\n * - Consolidates multiple unnamed (description-less) rows into a single unnamed entry, since the API rejects\n * more than one unnamed reimbursement per employee.\n * - When the consolidated unnamed total is zero, sends no unnamed entry at all. The backend's full-replace\n * semantics then delete any persisted unnamed entry (unnamed entries never have uuids, so this is the only\n * way to remove them).\n * - Maps the read shape (`description: string | null`) to the write shape (`description?: string`), omitting\n * the field when there is no description.\n *\n * @param reimbursements - The reimbursements pulled from the prepared payroll.\n * @returns The normalized reimbursements ready to send on a payroll update.\n * @internal\n */\nexport const cleanupReimbursements = (\n reimbursements: Reimbursement[],\n): PayrollUpdateReimbursements[] => {\n const consolidated: PayrollUpdateReimbursements[] = []\n let unnamedTotal = 0\n\n reimbursements.forEach(reimbursement => {\n const amount = reimbursement.amount\n const numericAmount = parseFloat(amount || '0')\n const description = reimbursement.description?.trim() || ''\n const uuid = reimbursement.uuid ?? undefined\n\n if (description === '') {\n unnamedTotal += numericAmount\n return\n }\n\n if (numericAmount === 0 && !uuid) {\n return\n }\n\n consolidated.push({\n amount,\n description,\n ...(uuid ? { uuid } : {}),\n })\n })\n\n if (unnamedTotal > 0) {\n consolidated.push({\n amount: unnamedTotal.toFixed(2),\n })\n }\n\n return consolidated\n}\n\n/**\n * Formats an hours value for display, rounding to two decimals and ensuring whole numbers render with `.0`.\n *\n * @param hours - The hours value to format.\n * @returns A string like `'40.0'` or `'37.25'`.\n * @internal\n */\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\n/**\n * Whether an FLSA status is eligible for regular-rate-of-pay overtime.\n *\n * @remarks\n * Only the nonexempt family (`Nonexempt`, `Salaried Nonexempt`,\n * `Commission Only Nonexempt`) earns overtime premiums, so only those statuses\n * warrant per-workweek breakdowns. `Exempt`, `Owner`, and\n * `Commission Only Exempt` are never overtime-eligible. An unknown status\n * returns `false` (treat as flat, never show meaningless workweek columns).\n *\n * @param flsaStatus - The employee's FLSA status, e.g. from `hourlyCompensations[].flsaStatus`.\n * @returns `true` only for the three nonexempt statuses.\n * @internal\n */\nexport const isOvertimeEligibleFlsaStatus = (flsaStatus: string | undefined): boolean =>\n flsaStatus === FlsaStatus.NONEXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: EmployeeCompensationInput): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: EmployeeCompensationInput,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: EmployeeCompensationInput,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: EmployeeCompensationInput,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: EmployeeCompensationInput,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: EmployeeCompensationInput,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\n/**\n * Calculates an employee's gross pay for a payroll, combining regular and overtime pay,\n * additional earnings, PTO pay, and any minimum-wage adjustment.\n *\n * @remarks\n * Returns `0` when the compensation is excluded or the employee has no primary job compensation effective\n * on the given date. The result is rounded to two decimal places.\n *\n * @param compensation - The employee compensation entry from the payroll.\n * @param employee - The employee record (used to look up jobs and effective compensations).\n * @param compensationEffectiveDateString - ISO date used to resolve the effective compensation; defaults to now.\n * @param paySchedule - The pay schedule, used to derive expected hours per pay period.\n * @param payrollCategory - The payroll category; off-cycle categories change how PTO hours are summed.\n * @returns The gross pay amount.\n * @internal\n */\nexport const calculateGrossPay = (\n compensation: EmployeeCompensationInput,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const offCycle = isOffCyclePayroll(payrollCategory)\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n offCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n/**\n * Returns the high-level payroll type — `'External'`, `'Off-Cycle'`, or `'Regular'`.\n *\n * @param payroll - The payroll whose type to classify.\n * @returns The payroll type string.\n * @internal\n */\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Returns whether an off-cycle reason indicates a dismissal payroll.\n *\n * @param offCycleReason - The payroll's off-cycle reason string.\n * @returns `true` when the reason matches the dismissed-employee reason.\n * @internal\n */\nexport const isDismissalPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.DismissedEmployee\n\n/**\n * Returns whether an off-cycle reason indicates a tax reconciliation payroll.\n *\n * @remarks\n * Tax reconciliation payrolls are created by Gusto rather than run by the partner. They come\n * back processed with no pay period and no `calculatedAt`, so callers use this to grant them a\n * targeted exception from checks that otherwise assume every payroll has both.\n *\n * @param offCycleReason - The payroll's off-cycle reason string.\n * @returns `true` when the reason matches the tax reconciliation reason.\n * @internal\n */\nexport const isTaxReconciliationPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.TaxReconciliation\n\n/**\n * Returns a formatted pay-period range, falling back to the formatted check date when the\n * payroll has no pay period.\n *\n * @remarks\n * Tax reconciliation payrolls always have a null `pay_period`, so anywhere a pay-period date\n * is used to identify a payroll on screen needs this fallback to avoid rendering blank space.\n *\n * @param payroll - The payroll to derive a date label for.\n * @param dateFormatter - The date formatter returned by {@link useDateFormatter}.\n * @returns The formatted pay-period range, or the formatted check date when no pay period exists.\n * @internal\n */\nexport const getPayPeriodOrCheckDateLabel = (\n payroll: {\n payPeriod?: { startDate?: string | null; endDate?: string | null } | null\n checkDate?: string | Date | null\n },\n dateFormatter: ReturnType<typeof useDateFormatter>,\n): string => {\n const range = dateFormatter.formatPayPeriodRange(\n payroll.payPeriod?.startDate,\n payroll.payPeriod?.endDate,\n )\n return range || dateFormatter.formatShortWithYear(payroll.checkDate)\n}\n\nconst OFF_CYCLE_REASON_LABELS: Record<string, string> = {\n Bonus: 'Bonus',\n Correction: 'Correction',\n 'Transition from old pay schedule': 'Transition',\n 'Dismissed employee': 'Dismissal',\n 'Hired employee': 'New Hire',\n 'Benefit reversal': 'Benefit Reversal',\n 'Wage correction': 'Wage Correction',\n 'Tax reconciliation': 'Tax Reconciliation',\n Reversal: 'Reversal',\n 'Disability insurance distribution': 'Disability Insurance',\n}\n\n/**\n * Returns a human-readable label describing the payroll type, mapping off-cycle reasons to display strings.\n *\n * @param payroll - The payroll whose type to describe.\n * @returns `'External'`, `'Regular'`, `'Off-Cycle'`, or a label derived from the off-cycle reason\n * (e.g. `'Bonus'`, `'Dismissal'`).\n * @internal\n */\nexport const getPayrollTypeLabel = (payroll: {\n external?: boolean\n offCycle?: boolean\n offCycleReason?: string | null\n}): string => {\n if (payroll.external) return 'External'\n if (payroll.offCycle && payroll.offCycleReason) {\n return OFF_CYCLE_REASON_LABELS[payroll.offCycleReason] ?? payroll.offCycleReason\n }\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Merges existing fixed compensations with placeholder entries for any compensation types the employee\n * doesn't yet have, then filters out excluded types and sorts the result alphabetically.\n *\n * @remarks\n * Owners (FLSA status `Owner`) never receive placeholder entries. Placeholders are added with `amount: '0.00'`\n * and the supplied `primaryJobUuid`.\n *\n * @param options - Inputs controlling which placeholder entries to add and which types to exclude.\n * @returns The merged, filtered, and sorted list of fixed compensations.\n * @internal\n */\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\n/**\n * Sums gross pay, employer taxes, reimbursements, and benefits from a payroll's totals.\n *\n * @param payrollData - The payroll whose totals to sum.\n * @returns The total payroll cost, or `0` when `payrollData.totals` is missing.\n * @internal\n */\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines whether a payroll can be cancelled based on its status, deadline, and the 4:00 PM PT cutoff.\n *\n * @remarks\n * Returns `true` only when the payroll has been processed, `payrollStatusMeta.cancellable` is not explicitly `false`,\n * the payroll has a `payrollDeadline`, and the current time is before 4:00 PM Pacific Time on that deadline date.\n *\n * @param payroll - The payroll to evaluate.\n * @returns `true` if the payroll is still cancellable, `false` otherwise.\n * @internal\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursement","reimbursementComp","cleanupReimbursements","reimbursements","consolidated","unnamedTotal","numericAmount","description","uuid","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","isOvertimeEligibleFlsaStatus","flsaStatus","FlsaStatus","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","payrollCategory","PayrollCategory","compensationEffectiveDate","salaried","isOffCyclePayroll","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","isDismissalPayroll","offCycleReason","OffCycleReasonType","isTaxReconciliationPayroll","getPayPeriodOrCheckDateLabel","payroll","dateFormatter","OFF_CYCLE_REASON_LABELS","getPayrollTypeLabel","getAdditionalEarningsCompensations","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","type","comp","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;;;AAyBA,MAAMA,IAAqB,iBAiBrBC,IAAgB,CAACC,MACdA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AACZ,GAaaC,IAAwB,CAAC;AAAA,EACpC,UAAAR;AAAA,EACA;AAAA,EACA,QAAAS,IAAS;AACX,MAIM;AACJ,MAAI,CAACT,GAAU;AACb,WAAO;AAGT,QAAMU,IAAaX,EAAcC,CA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,EAAK,YAAA,GAEZE,IAAoB,IAAI,KAAKD,GAAM,GAAG,CAAC;AAC7C,EAAAC,EAAkB,QAAQ,KAAK,IAAIA,EAAkB,OAAA,KAAY,CAAC;AAElE,QAAMC,IAAsB,IAAI,KAAKF,GAAM,IAAI,CAAC;AAChD,SAAAE,EAAoB,QAAQ,KAAM,IAAIA,EAAoB,OAAA,KAAY,CAAE,GAE1DH,KAAQE,KAAqBF,IAAOG,IACnC,KAAK;AACtB,GAaaC,KAAmB,CAACnB,MAA8B;AAS7D,MARIA,EAAQ,mBAAmB,gBAAgB,MAI3C,CAACA,EAAQ,aAIT,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMoB,wBAAU,KAAA,GACVC,IAAW,IAAI,KAAKrB,EAAQ,eAAe,GAE3CsB,IAAU,IAAI,KAAKF,EAAI,YAAYN,EAAqBM,CAAG,IAAIG,CAAW,GAC1EC,IAAe,IAAI,KAAKH,EAAS,YAAYP,EAAqBO,CAAQ,IAAIE,CAAW,GAEzFE,IAAa,IAAI,KAAKD,CAAY;AAGxC,SAFAC,EAAW,YAAY,IAAI,GAAG,GAAG,CAAC,GAE9B,EAAAH,KAAWG;AAKjB;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { usePayrollsPrepareMutation as
|
|
3
|
-
import { usePaySchedulesGet as
|
|
4
|
-
import { UnprocessableEntityError as
|
|
1
|
+
import { useState as _, useRef as y, useMemo as b, useCallback as f, useEffect as L } from "react";
|
|
2
|
+
import { usePayrollsPrepareMutation as D } from "@gusto/embedded-api/react-query/payrollsPrepare";
|
|
3
|
+
import { usePaySchedulesGet as v } from "@gusto/embedded-api/react-query/paySchedulesGet";
|
|
4
|
+
import { UnprocessableEntityError as w } from "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "react-error-boundary";
|
|
7
7
|
import "react-i18next";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
|
-
import { useBase as
|
|
9
|
+
import { useBase as x } from "../Base/useBase.js";
|
|
10
10
|
import "@gusto/embedded-api/models/errors/apierror";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
12
12
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
@@ -16,15 +16,16 @@ import "../../contexts/LocaleProvider/useLocale.js";
|
|
|
16
16
|
import "../../shared/constants.js";
|
|
17
17
|
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
18
18
|
import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
19
|
-
import { retryAsync as
|
|
20
|
-
const
|
|
19
|
+
import { retryAsync as T } from "../../helpers/retryAsync.js";
|
|
20
|
+
const U = 4, q = 1500, B = (e) => e instanceof w ? e.errors.some((r) => r.category === "invalid_operation") : !1, ee = ({
|
|
21
21
|
companyId: e,
|
|
22
22
|
payrollId: r,
|
|
23
23
|
employeeUuids: a,
|
|
24
24
|
sortBy: n,
|
|
25
|
-
onDataReady: l
|
|
25
|
+
onDataReady: l,
|
|
26
|
+
isTransitionPayroll: p = !1
|
|
26
27
|
}) => {
|
|
27
|
-
const { mutateAsync:
|
|
28
|
+
const { mutateAsync: c, isPending: u } = D(), [o, h] = _(), t = y(!1), d = y(!1), { baseSubmitHandler: m } = x(), S = b(() => a?.join(",") ?? "", [a]), { data: E, isLoading: g } = v(
|
|
28
29
|
{
|
|
29
30
|
companyId: e,
|
|
30
31
|
payScheduleId: o?.payPeriod?.payScheduleUuid || ""
|
|
@@ -32,42 +33,50 @@ const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
32
33
|
{
|
|
33
34
|
enabled: !!o?.payPeriod?.payScheduleUuid
|
|
34
35
|
}
|
|
35
|
-
), P =
|
|
36
|
-
const
|
|
36
|
+
), P = f(async () => {
|
|
37
|
+
const i = await c({
|
|
37
38
|
request: {
|
|
38
39
|
companyId: e,
|
|
39
40
|
payrollId: r,
|
|
40
41
|
sortBy: n,
|
|
41
42
|
requestBody: {
|
|
42
|
-
employeeUuids: a
|
|
43
|
+
employeeUuids: p ? void 0 : a
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
47
|
+
h(i.payrollPrepared), i.payrollPrepared && (t.current = !0, l?.(i.payrollPrepared));
|
|
48
|
+
}, [
|
|
49
|
+
e,
|
|
50
|
+
r,
|
|
51
|
+
c,
|
|
52
|
+
S,
|
|
53
|
+
n,
|
|
54
|
+
l,
|
|
55
|
+
p
|
|
56
|
+
]), s = f(async () => {
|
|
57
|
+
await m(
|
|
49
58
|
null,
|
|
50
|
-
() =>
|
|
51
|
-
maxAttempts:
|
|
52
|
-
delayMs:
|
|
59
|
+
() => T(P, {
|
|
60
|
+
maxAttempts: U,
|
|
61
|
+
delayMs: q,
|
|
53
62
|
shouldRetry: B
|
|
54
63
|
})
|
|
55
64
|
);
|
|
56
|
-
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
const
|
|
65
|
+
}, [m, P]);
|
|
66
|
+
L(() => {
|
|
67
|
+
d.current || (d.current = !0, s());
|
|
68
|
+
}, [s]);
|
|
69
|
+
const R = u && !t.current, A = u && t.current, M = R || g;
|
|
61
70
|
return {
|
|
62
|
-
handlePreparePayroll:
|
|
71
|
+
handlePreparePayroll: s,
|
|
63
72
|
preparedPayroll: o,
|
|
64
|
-
paySchedule:
|
|
65
|
-
isLoading:
|
|
66
|
-
isPaginating:
|
|
73
|
+
paySchedule: E?.payScheduleShow,
|
|
74
|
+
isLoading: M,
|
|
75
|
+
isPaginating: A,
|
|
67
76
|
hasInitialData: t.current
|
|
68
77
|
};
|
|
69
78
|
};
|
|
70
79
|
export {
|
|
71
|
-
|
|
80
|
+
ee as usePreparedPayrollData
|
|
72
81
|
};
|
|
73
82
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|