@gusto/embedded-react-sdk 0.24.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/dist/assets/icons/slash-circle.svg.js +10 -0
- package/dist/assets/icons/slash-circle.svg.js.map +1 -0
- package/dist/components/Base/Base.d.ts +1 -1
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
- package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
- package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -11
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +151 -0
- package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +34 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
- package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
- package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +35 -33
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +30 -29
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +3 -2
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +31 -30
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +61 -59
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +34 -31
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +29 -10
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +33 -31
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +25 -19
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +86 -56
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +116 -99
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +157 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +46 -48
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +58 -56
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +34 -32
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +3 -2
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js +142 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +18 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.d.ts +7 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js +88 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.d.ts +6 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js +55 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.d.ts +19 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js +20 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/index.d.ts +3 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js +47 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js.map +1 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -6
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +3 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +107 -99
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -145
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +14 -12
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +174 -106
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +84 -102
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +24 -20
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -46
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +111 -45
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -125
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +117 -110
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +282 -278
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +73 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +10 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +46 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
- package/dist/components/Payroll/helpers.d.ts +12 -0
- package/dist/components/Payroll/helpers.js +129 -117
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +2 -0
- package/dist/components/Payroll/index.js +18 -14
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +43 -31
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +1 -0
- package/dist/helpers/dateFormatting.js +1 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +23 -18
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/responsive.js +1 -1
- package/dist/helpers/responsive.js.map +1 -1
- package/dist/i18n/I18n.js +3 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -32
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +5 -3
- package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +14 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +8 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +5 -0
- package/dist/i18n/en/common.json.js +4 -2
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/shared/constants.d.ts +24 -0
- package/dist/shared/constants.js +70 -54
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +119 -3
- package/package.json +31 -20
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../../../Base';
|
|
2
2
|
interface PaymentHistoryProps extends BaseComponentInterface<'Contractor.Payments.PaymentHistory'> {
|
|
3
|
-
companyId: string;
|
|
4
3
|
paymentId: string;
|
|
5
4
|
}
|
|
6
5
|
export declare function PaymentHistory(props: PaymentHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const Root: ({
|
|
6
|
+
export declare const Root: ({ paymentId, dictionary, onEvent }: PaymentHistoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,26 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as n, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { useContractorPaymentGroupsGetSuspense as G } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGet";
|
|
3
|
+
import { useContractorsListSuspense as T } from "@gusto/embedded-api/react-query/contractorsList";
|
|
4
|
+
import { useContractorPaymentsDeleteMutation as h } from "@gusto/embedded-api/react-query/contractorPaymentsDelete";
|
|
5
|
+
import { useTranslation as A } from "react-i18next";
|
|
6
|
+
import { PaymentHistoryPresentation as w } from "./PaymentHistoryPresentation.js";
|
|
7
|
+
import { useComponentDictionary as E } from "../../../../i18n/I18n.js";
|
|
8
|
+
import { BaseComponent as N } from "../../../Base/Base.js";
|
|
9
|
+
import { useBase as R } from "../../../Base/useBase.js";
|
|
10
|
+
import { componentEvents as m } from "../../../../shared/constants.js";
|
|
11
|
+
function b(t) {
|
|
12
|
+
return /* @__PURE__ */ n(N, { ...t, children: /* @__PURE__ */ n(H, { ...t, children: t.children }) });
|
|
8
13
|
}
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const H = ({ paymentId: t, dictionary: s, onEvent: e }) => {
|
|
15
|
+
E("Contractor.Payments.PaymentHistory", s);
|
|
16
|
+
const { t: i } = A("Contractor.Payments.PaymentHistory"), { baseSubmitHandler: y } = R(), { data: r } = G({
|
|
17
|
+
contractorPaymentGroupUuid: t
|
|
18
|
+
});
|
|
19
|
+
if (!r.contractorPaymentGroup)
|
|
20
|
+
throw new Error(i("errors.paymentGroupNotFound"));
|
|
21
|
+
const a = r.contractorPaymentGroup.companyUuid, { data: u } = T({ companyUuid: a }), c = u.contractorList || [], { mutateAsync: p, isPending: P } = h(), d = (o) => {
|
|
22
|
+
e(m.CONTRACTOR_PAYMENT_VIEW_DETAILS, {
|
|
23
|
+
contractor: c.find((l) => l.uuid === o),
|
|
24
|
+
paymentGroupId: t
|
|
25
|
+
});
|
|
26
|
+
}, C = async (o) => {
|
|
27
|
+
await y(o, async () => {
|
|
28
|
+
await p({
|
|
29
|
+
request: {
|
|
30
|
+
contractorPaymentId: o,
|
|
31
|
+
companyId: a
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}), e(m.CONTRACTOR_PAYMENT_CANCEL, { paymentId: o });
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
|
|
37
|
+
w,
|
|
38
|
+
{
|
|
39
|
+
paymentGroup: r.contractorPaymentGroup,
|
|
40
|
+
contractors: c,
|
|
41
|
+
isCancelling: P,
|
|
42
|
+
onViewPayment: d,
|
|
43
|
+
onCancelPayment: C
|
|
19
44
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
45
|
+
) });
|
|
46
|
+
};
|
|
22
47
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
48
|
+
b as PaymentHistory,
|
|
49
|
+
H as Root
|
|
25
50
|
};
|
|
26
51
|
//# sourceMappingURL=PaymentHistory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentHistory.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistory.tsx"],"sourcesContent":["import { PaymentHistoryPresentation } from './PaymentHistoryPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\n\ninterface PaymentHistoryProps extends BaseComponentInterface<'Contractor.Payments.PaymentHistory'> {\n
|
|
1
|
+
{"version":3,"file":"PaymentHistory.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistory.tsx"],"sourcesContent":["import { useContractorPaymentGroupsGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGet'\nimport { useContractorsListSuspense } from '@gusto/embedded-api/react-query/contractorsList'\nimport { useContractorPaymentsDeleteMutation } from '@gusto/embedded-api/react-query/contractorPaymentsDelete'\nimport { useTranslation } from 'react-i18next'\nimport { PaymentHistoryPresentation } from './PaymentHistoryPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\ninterface PaymentHistoryProps extends BaseComponentInterface<'Contractor.Payments.PaymentHistory'> {\n paymentId: string\n}\n\nexport function PaymentHistory(props: PaymentHistoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ paymentId, dictionary, onEvent }: PaymentHistoryProps) => {\n useComponentDictionary('Contractor.Payments.PaymentHistory', dictionary)\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const { baseSubmitHandler } = useBase()\n\n const { data: paymentGroupResponse } = useContractorPaymentGroupsGetSuspense({\n contractorPaymentGroupUuid: paymentId,\n })\n if (!paymentGroupResponse.contractorPaymentGroup) {\n throw new Error(t('errors.paymentGroupNotFound'))\n }\n\n const companyId = paymentGroupResponse.contractorPaymentGroup.companyUuid!\n\n const { data: contractorList } = useContractorsListSuspense({ companyUuid: companyId })\n const contractors = contractorList.contractorList || []\n\n const { mutateAsync: cancelPayment, isPending: isCancelling } =\n useContractorPaymentsDeleteMutation()\n\n const handleViewPayment = (contractorUuid: string) => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_VIEW_DETAILS, {\n contractor: contractors.find(c => c.uuid === contractorUuid),\n paymentGroupId: paymentId,\n })\n }\n\n const handleCancelPayment = async (paymentId: string) => {\n await baseSubmitHandler(paymentId, async () => {\n await cancelPayment({\n request: {\n contractorPaymentId: paymentId,\n companyId,\n },\n })\n })\n\n onEvent(componentEvents.CONTRACTOR_PAYMENT_CANCEL, { paymentId })\n }\n\n return (\n <>\n <PaymentHistoryPresentation\n paymentGroup={paymentGroupResponse.contractorPaymentGroup}\n contractors={contractors}\n isCancelling={isCancelling}\n onViewPayment={handleViewPayment}\n onCancelPayment={handleCancelPayment}\n />\n </>\n )\n}\n"],"names":["PaymentHistory","props","jsx","BaseComponent","Root","paymentId","dictionary","onEvent","useComponentDictionary","t","useTranslation","baseSubmitHandler","useBase","paymentGroupResponse","useContractorPaymentGroupsGetSuspense","companyId","contractorList","useContractorsListSuspense","contractors","cancelPayment","isCancelling","useContractorPaymentsDeleteMutation","handleViewPayment","contractorUuid","componentEvents","c","handleCancelPayment","Fragment","PaymentHistoryPresentation"],"mappings":";;;;;;;;;;AAaO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,QAAmC;AAC/E,EAAAC,EAAuB,sCAAsCF,CAAU;AACvE,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,oCAAoC,GAC3D,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,EAAA,IAAyBC,EAAsC;AAAA,IAC3E,4BAA4BT;AAAA,EAAA,CAC7B;AACD,MAAI,CAACQ,EAAqB;AACxB,UAAM,IAAI,MAAMJ,EAAE,6BAA6B,CAAC;AAGlD,QAAMM,IAAYF,EAAqB,uBAAuB,aAExD,EAAE,MAAMG,EAAA,IAAmBC,EAA2B,EAAE,aAAaF,GAAW,GAChFG,IAAcF,EAAe,kBAAkB,CAAA,GAE/C,EAAE,aAAaG,GAAe,WAAWC,EAAA,IAC7CC,EAAA,GAEIC,IAAoB,CAACC,MAA2B;AACpD,IAAAhB,EAAQiB,EAAgB,iCAAiC;AAAA,MACvD,YAAYN,EAAY,KAAK,CAAAO,MAAKA,EAAE,SAASF,CAAc;AAAA,MAC3D,gBAAgBlB;AAAA,IAAA,CACjB;AAAA,EACH,GAEMqB,IAAsB,OAAOrB,MAAsB;AACvD,UAAMM,EAAkBN,GAAW,YAAY;AAC7C,YAAMc,EAAc;AAAA,QAClB,SAAS;AAAA,UACP,qBAAqBd;AAAAA,UACrB,WAAAU;AAAA,QAAA;AAAA,MACF,CACD;AAAA,IACH,CAAC,GAEDR,EAAQiB,EAAgB,2BAA2B,EAAE,WAAAnB,GAAW;AAAA,EAClE;AAEA,SACE,gBAAAH,EAAAyB,GAAA,EACE,UAAA,gBAAAzB;AAAA,IAAC0B;AAAA,IAAA;AAAA,MACC,cAAcf,EAAqB;AAAA,MACnC,aAAAK;AAAA,MACA,cAAAE;AAAA,MACA,eAAeE;AAAA,MACf,iBAAiBI;AAAA,IAAA;AAAA,EAAA,GAErB;AAEJ;"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
name: string;
|
|
4
|
-
wageType: string;
|
|
5
|
-
paymentMethod: string;
|
|
6
|
-
hours: number;
|
|
7
|
-
wage: string;
|
|
8
|
-
bonus: number;
|
|
9
|
-
reimbursement: number;
|
|
10
|
-
total: number;
|
|
11
|
-
}
|
|
1
|
+
import { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup';
|
|
2
|
+
import { Contractor } from '@gusto/embedded-api/models/components/contractor';
|
|
12
3
|
interface PaymentHistoryPresentationProps {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
onBack: () => void;
|
|
4
|
+
paymentGroup: ContractorPaymentGroup;
|
|
5
|
+
contractors: Contractor[];
|
|
16
6
|
onViewPayment: (paymentId: string) => void;
|
|
17
7
|
onCancelPayment: (paymentId: string) => void;
|
|
8
|
+
isCancelling: boolean;
|
|
18
9
|
}
|
|
19
|
-
export declare const PaymentHistoryPresentation: ({
|
|
10
|
+
export declare const PaymentHistoryPresentation: ({ paymentGroup, contractors, onViewPayment, onCancelPayment, isCancelling, }: PaymentHistoryPresentationProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
11
|
export {};
|
|
@@ -1,113 +1,130 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as N, Trans as x } from "react-i18next";
|
|
3
|
+
import { getContractorDisplayName as C } from "../CreatePayment/helpers.js";
|
|
4
|
+
import h from "./PaymentHistoryPresentation.module.scss.js";
|
|
5
|
+
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
4
6
|
import "classnames";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { HamburgerMenu as
|
|
8
|
-
import { useComponentContext as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { formatNumberAsCurrency as c } from "../../../../helpers/formattedStrings.js";
|
|
11
|
-
import { useLocale as P } from "../../../../contexts/LocaleProvider/useLocale.js";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
8
|
+
import { EmptyData as P } from "../../../Common/EmptyData/EmptyData.js";
|
|
9
|
+
import { HamburgerMenu as F } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
10
|
+
import { useComponentContext as v } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { useI18n as S } from "../../../../i18n/I18n.js";
|
|
12
12
|
import { formatHoursDisplay as k } from "../../../Payroll/helpers.js";
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
import w from "../../../../hooks/useNumberFormatter.js";
|
|
14
|
+
import { useDateFormatter as L } from "../../../../hooks/useDateFormatter.js";
|
|
15
|
+
import M from "../../../../assets/icons/eye.svg.js";
|
|
16
|
+
import T from "../../../../assets/icons/slash-circle.svg.js";
|
|
17
|
+
import { DataView as j } from "../../../Common/DataView/DataView.js";
|
|
18
|
+
const $ = ({
|
|
19
|
+
paymentGroup: s,
|
|
20
|
+
contractors: b,
|
|
21
|
+
onViewPayment: c,
|
|
22
|
+
onCancelPayment: f,
|
|
23
|
+
isCancelling: y
|
|
20
24
|
}) => {
|
|
21
|
-
const { Button:
|
|
22
|
-
|
|
23
|
-
const { t:
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
25
|
+
const { Button: g, Text: n, Heading: d } = v();
|
|
26
|
+
S("Contractor.Payments.PaymentHistory");
|
|
27
|
+
const { t: r } = N("Contractor.Payments.PaymentHistory"), o = w("currency"), { formatLongWithYear: H } = L(), p = s.contractorPayments || [];
|
|
28
|
+
return /* @__PURE__ */ l(m, { flexDirection: "column", gap: 32, children: [
|
|
29
|
+
/* @__PURE__ */ l(m, { flexDirection: "column", gap: 8, children: [
|
|
30
|
+
/* @__PURE__ */ t(d, { as: "h2", children: r("title") }),
|
|
31
|
+
/* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
|
|
32
|
+
x,
|
|
33
|
+
{
|
|
34
|
+
i18nKey: "subtitle",
|
|
35
|
+
t: r,
|
|
36
|
+
values: { date: H(s.debitDate) },
|
|
37
|
+
components: {
|
|
38
|
+
strong: /* @__PURE__ */ t(n, { weight: "bold", as: "span" })
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
) })
|
|
28
42
|
] }),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
43
|
+
/* @__PURE__ */ l(m, { flexDirection: "column", gap: 16, children: [
|
|
44
|
+
/* @__PURE__ */ t(d, { as: "h2", children: r("paymentsSection") }),
|
|
45
|
+
p.length === 0 ? /* @__PURE__ */ t(P, { title: r("noPaymentsFound"), description: r("noPaymentsDescription") }) : /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(
|
|
46
|
+
j,
|
|
47
|
+
{
|
|
48
|
+
columns: [
|
|
49
|
+
{
|
|
50
|
+
title: r("tableHeaders.contractor"),
|
|
51
|
+
render: ({ contractorUuid: e }) => /* @__PURE__ */ t(
|
|
52
|
+
g,
|
|
53
|
+
{
|
|
54
|
+
variant: "tertiary",
|
|
55
|
+
onClick: () => {
|
|
56
|
+
c(e);
|
|
57
|
+
},
|
|
58
|
+
children: C(
|
|
59
|
+
b.find((i) => i.uuid === e)
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: r("tableHeaders.wageType"),
|
|
66
|
+
render: ({ wageType: e }) => /* @__PURE__ */ t(n, { children: e })
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: r("tableHeaders.paymentMethod"),
|
|
70
|
+
render: ({ paymentMethod: e }) => /* @__PURE__ */ t(n, { children: e })
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: r("tableHeaders.hours"),
|
|
74
|
+
render: ({ hours: e }) => /* @__PURE__ */ t(n, { children: e ? k(Number(e)) : "–" })
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: r("tableHeaders.wage"),
|
|
78
|
+
render: ({ wage: e }) => /* @__PURE__ */ t(n, { children: e || "–" })
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: r("tableHeaders.bonus"),
|
|
82
|
+
render: ({ bonus: e }) => /* @__PURE__ */ t(n, { children: e ? o(Number(e)) : "–" })
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: r("tableHeaders.reimbursements"),
|
|
86
|
+
render: ({ reimbursement: e }) => /* @__PURE__ */ t(n, { children: e ? o(Number(e)) : "–" })
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: r("tableHeaders.total"),
|
|
90
|
+
render: ({ wageTotal: e, reimbursement: i, bonus: a }) => /* @__PURE__ */ t(n, { children: e ? o(
|
|
91
|
+
Number(e) + Number(i) + Number(a)
|
|
92
|
+
) : "–" })
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
itemMenu: ({ contractorUuid: e, mayCancel: i, uuid: a }) => {
|
|
96
|
+
const u = [
|
|
61
97
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
title: e("tableHeaders.total"),
|
|
75
|
-
render: ({ total: t }) => /* @__PURE__ */ r(n, { children: c(t, l) })
|
|
98
|
+
label: r("actions.view"),
|
|
99
|
+
onClick: () => {
|
|
100
|
+
c(e);
|
|
101
|
+
},
|
|
102
|
+
icon: /* @__PURE__ */ t("span", { className: h.icon, children: /* @__PURE__ */ t(M, { "aria-hidden": !0 }) })
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
return i && u.push({
|
|
106
|
+
label: r("actions.cancel"),
|
|
107
|
+
onClick: () => {
|
|
108
|
+
f(a);
|
|
76
109
|
},
|
|
110
|
+
icon: /* @__PURE__ */ t("span", { className: h.icon, children: /* @__PURE__ */ t(T, { "aria-hidden": !0 }) })
|
|
111
|
+
}), /* @__PURE__ */ t(
|
|
112
|
+
F,
|
|
77
113
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
items: [
|
|
83
|
-
{
|
|
84
|
-
label: e("actions.view"),
|
|
85
|
-
onClick: () => {
|
|
86
|
-
d(t);
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
label: e("actions.cancel"),
|
|
91
|
-
onClick: () => {
|
|
92
|
-
b(t);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
triggerLabel: e("tableHeaders.action")
|
|
97
|
-
}
|
|
98
|
-
)
|
|
114
|
+
items: u,
|
|
115
|
+
triggerLabel: r("tableHeaders.action"),
|
|
116
|
+
isLoading: y
|
|
99
117
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
] })
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
data: p,
|
|
121
|
+
label: r("title")
|
|
122
|
+
}
|
|
123
|
+
) })
|
|
107
124
|
] })
|
|
108
125
|
] });
|
|
109
126
|
};
|
|
110
127
|
export {
|
|
111
|
-
|
|
128
|
+
$ as PaymentHistoryPresentation
|
|
112
129
|
};
|
|
113
130
|
//# sourceMappingURL=PaymentHistoryPresentation.js.map
|
package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentHistoryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { DataView, Flex, EmptyData, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\n\ninterface PaymentData {\n id: string\n name: string\n wageType: string\n paymentMethod: string\n hours: number\n wage: string\n bonus: number\n reimbursement: number\n total: number\n}\n\ninterface PaymentHistoryPresentationProps {\n date: string\n payments: PaymentData[]\n onBack: () => void\n onViewPayment: (paymentId: string) => void\n onCancelPayment: (paymentId: string) => void\n}\n\nexport const PaymentHistoryPresentation = ({\n date,\n payments,\n onBack,\n onViewPayment,\n onCancelPayment,\n}: PaymentHistoryPresentationProps) => {\n const { Button, Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentHistory')\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const { locale } = useLocale()\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h1\">{t('title')}</Heading>\n <Text>{t('subtitle', { date })}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('paymentsSection')}</Heading>\n\n {payments.length === 0 ? (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button variant=\"primary\" onClick={onBack}>\n {t('backButton')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ) : (\n <>\n <DataView\n columns={[\n {\n title: t('tableHeaders.contractor'),\n render: ({ name, id }) => (\n <Button\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(id)\n }}\n >\n {name}\n </Button>\n ),\n },\n {\n title: t('tableHeaders.wageType'),\n render: ({ wageType }) => <Text>{wageType}</Text>,\n },\n {\n title: t('tableHeaders.paymentMethod'),\n render: ({ paymentMethod }) => <Text>{paymentMethod}</Text>,\n },\n {\n title: t('tableHeaders.hours'),\n render: ({ hours }) => <Text>{hours ? formatHoursDisplay(hours) : '–'}</Text>,\n },\n {\n title: t('tableHeaders.wage'),\n render: ({ wage }) => <Text>{wage || '–'}</Text>,\n },\n {\n title: t('tableHeaders.bonus'),\n render: ({ bonus }) => (\n <Text>{bonus ? formatNumberAsCurrency(bonus, locale) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: ({ reimbursement }) => (\n <Text>{formatNumberAsCurrency(reimbursement, locale)}</Text>\n ),\n },\n {\n title: t('tableHeaders.total'),\n render: ({ total }) => <Text>{formatNumberAsCurrency(total, locale)}</Text>,\n },\n {\n title: t('tableHeaders.action'),\n render: ({ id, name }) => (\n <HamburgerMenu\n items={[\n {\n label: t('actions.view'),\n onClick: () => {\n onViewPayment(id)\n },\n },\n {\n label: t('actions.cancel'),\n onClick: () => {\n onCancelPayment(id)\n },\n },\n ]}\n triggerLabel={t('tableHeaders.action')}\n />\n ),\n },\n ]}\n data={payments}\n label={t('title')}\n />\n\n <Flex>\n <Button onClick={onBack} variant=\"secondary\">\n {t('backButton')}\n </Button>\n </Flex>\n </>\n )}\n </Flex>\n </Flex>\n )\n}\n"],"names":["PaymentHistoryPresentation","date","payments","onBack","onViewPayment","onCancelPayment","Button","Text","Heading","useComponentContext","useI18n","t","useTranslation","locale","useLocale","jsxs","Flex","jsx","EmptyData","ActionsLayout","Fragment","DataView","name","id","wageType","paymentMethod","hours","formatHoursDisplay","wage","bonus","formatNumberAsCurrency","reimbursement","total","HamburgerMenu"],"mappings":";;;;;;;;;;;;;AA6BO,MAAMA,IAA6B,CAAC;AAAA,EACzC,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AACF,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA;AAClC,EAAAC,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oCAAoC,GAC3D,EAAE,QAAAC,EAAA,IAAWC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAC,EAACT,GAAA,EAAQ,IAAG,MAAM,UAAAG,EAAE,OAAO,GAAE;AA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AAA;AAAA,oBACF;AAAA,oBAEF,cAAcZ,EAAE,qBAAqB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACvC;AAAA,YAEJ;AAAA,YAEF,MAAMT;AAAA,YACN,OAAOS,EAAE,OAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGlB,gBAAAM,EAACD,GAAA,EACC,UAAA,gBAAAC,EAACX,GAAA,EAAO,SAASH,GAAQ,SAAQ,aAC9B,UAAAQ,EAAE,YAAY,EAAA,CACjB,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PaymentHistoryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { getContractorDisplayName } from '../CreatePayment/helpers'\nimport styles from './PaymentHistoryPresentation.module.scss'\nimport { DataView, Flex, EmptyData } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport CancelIcon from '@/assets/icons/slash-circle.svg?react'\n\ninterface PaymentHistoryPresentationProps {\n paymentGroup: ContractorPaymentGroup\n contractors: Contractor[]\n onViewPayment: (paymentId: string) => void\n onCancelPayment: (paymentId: string) => void\n isCancelling: boolean\n}\n\nexport const PaymentHistoryPresentation = ({\n paymentGroup,\n contractors,\n onViewPayment,\n onCancelPayment,\n isCancelling,\n}: PaymentHistoryPresentationProps) => {\n const { Button, Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentHistory')\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const payments = paymentGroup.contractorPayments || []\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>\n <Trans\n i18nKey={'subtitle'}\n t={t}\n values={{ date: formatLongWithYear(paymentGroup.debitDate) }}\n components={{\n strong: <Text weight=\"bold\" as=\"span\" />,\n }}\n />\n </Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('paymentsSection')}</Heading>\n\n {payments.length === 0 ? (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')} />\n ) : (\n <>\n <DataView\n columns={[\n {\n title: t('tableHeaders.contractor'),\n render: ({ contractorUuid }) => (\n <Button\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(contractorUuid!)\n }}\n >\n {getContractorDisplayName(\n contractors.find(contractor => contractor.uuid === contractorUuid),\n )}\n </Button>\n ),\n },\n {\n title: t('tableHeaders.wageType'),\n render: ({ wageType }) => <Text>{wageType}</Text>,\n },\n {\n title: t('tableHeaders.paymentMethod'),\n render: ({ paymentMethod }) => <Text>{paymentMethod}</Text>,\n },\n {\n title: t('tableHeaders.hours'),\n render: ({ hours }) => (\n <Text>{hours ? formatHoursDisplay(Number(hours)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.wage'),\n render: ({ wage }) => <Text>{wage || '–'}</Text>,\n },\n {\n title: t('tableHeaders.bonus'),\n render: ({ bonus }) => (\n <Text>{bonus ? currencyFormatter(Number(bonus)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: ({ reimbursement }) => (\n <Text>{reimbursement ? currencyFormatter(Number(reimbursement)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.total'),\n render: ({ wageTotal, reimbursement, bonus }) => (\n <Text>\n {wageTotal\n ? currencyFormatter(\n Number(wageTotal) + Number(reimbursement) + Number(bonus),\n )\n : '–'}\n </Text>\n ),\n },\n ]}\n itemMenu={({ contractorUuid, mayCancel, uuid }) => {\n const items = [\n {\n label: t('actions.view'),\n onClick: () => {\n onViewPayment(contractorUuid!)\n },\n icon: (\n <span className={styles.icon}>\n <EyeIcon aria-hidden />\n </span>\n ),\n },\n ]\n if (mayCancel) {\n items.push({\n label: t('actions.cancel'),\n onClick: () => {\n onCancelPayment(uuid!)\n },\n icon: (\n <span className={styles.icon}>\n <CancelIcon aria-hidden />\n </span>\n ),\n })\n }\n return (\n <HamburgerMenu\n items={items}\n triggerLabel={t('tableHeaders.action')}\n isLoading={isCancelling}\n />\n )\n }}\n data={payments}\n label={t('title')}\n />\n </>\n )}\n </Flex>\n </Flex>\n )\n}\n"],"names":["PaymentHistoryPresentation","paymentGroup","contractors","onViewPayment","onCancelPayment","isCancelling","Button","Text","Heading","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","payments","jsxs","Flex","jsx","Trans","EmptyData","Fragment","DataView","contractorUuid","getContractorDisplayName","contractor","wageType","paymentMethod","hours","formatHoursDisplay","wage","bonus","reimbursement","wageTotal","mayCancel","uuid","items","styles","EyeIcon","CancelIcon","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAuBO,MAAMA,IAA6B,CAAC;AAAA,EACzC,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AACF,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA;AAClC,EAAAC,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAoBC,EAAmB,UAAU,GACjD,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AAA,EACE,UAAA4B,IACGtB;AAAA,gBACE,OAAOsB,CAAS,IAAI,OAAOD,CAAa,IAAI,OAAOD,CAAK;AAAA,cAAA,IAE1D,IAAA,CACN;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEF,UAAU,CAAC,EAAE,gBAAAR,GAAgB,WAAAW,GAAW,MAAAC,QAAW;AACjD,kBAAMC,IAAQ;AAAA,cACZ;AAAA,gBACE,OAAO3B,EAAE,cAAc;AAAA,gBACvB,SAAS,MAAM;AACb,kBAAAR,EAAcsB,CAAe;AAAA,gBAC/B;AAAA,gBACA,MACE,gBAAAL,EAAC,QAAA,EAAK,WAAWmB,EAAO,MACtB,UAAA,gBAAAnB,EAACoB,GAAA,EAAQ,eAAW,GAAA,CAAC,EAAA,CACvB;AAAA,cAAA;AAAA,YAEJ;AAEF,mBAAIJ,KACFE,EAAM,KAAK;AAAA,cACT,OAAO3B,EAAE,gBAAgB;AAAA,cACzB,SAAS,MAAM;AACb,gBAAAP,EAAgBiC,CAAK;AAAA,cACvB;AAAA,cACA,MACE,gBAAAjB,EAAC,QAAA,EAAK,WAAWmB,EAAO,MACtB,UAAA,gBAAAnB,EAACqB,GAAA,EAAW,eAAW,GAAA,CAAC,EAAA,CAC1B;AAAA,YAAA,CAEH,GAGD,gBAAArB;AAAA,cAACsB;AAAA,cAAA;AAAA,gBACC,OAAAJ;AAAA,gBACA,cAAc3B,EAAE,qBAAqB;AAAA,gBACrC,WAAWN;AAAA,cAAA;AAAA,YAAA;AAAA,UAGjB;AAAA,UACA,MAAMY;AAAA,UACN,OAAON,EAAE,OAAO;AAAA,QAAA;AAAA,MAAA,EAClB,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentHistoryPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
2
|
+
interface PaymentStatementProps extends BaseComponentInterface<'Contractor.Payments.PaymentStatement'> {
|
|
3
|
+
paymentGroupId: string;
|
|
4
|
+
contractorUuid: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function PaymentStatement(props: PaymentStatementProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Root: ({ paymentGroupId, contractorUuid, dictionary }: PaymentStatementProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useContractorPaymentGroupsGetSuspense as f } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGet";
|
|
3
|
+
import { useContractorsListSuspense as d } from "@gusto/embedded-api/react-query/contractorsList";
|
|
4
|
+
import { useContractorPaymentsGetReceipt as P } from "@gusto/embedded-api/react-query/contractorPaymentsGetReceipt";
|
|
5
|
+
import { APIError as h } from "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import { useTranslation as G } from "react-i18next";
|
|
7
|
+
import { PaymentStatementPresentation as w } from "./PaymentStatementPresentation.js";
|
|
8
|
+
import { useComponentDictionary as C } from "../../../../i18n/I18n.js";
|
|
9
|
+
import { BaseComponent as l } from "../../../Base/Base.js";
|
|
10
|
+
import "../../../Base/useBase.js";
|
|
11
|
+
function j(o) {
|
|
12
|
+
return /* @__PURE__ */ a(l, { ...o, children: /* @__PURE__ */ a(R, { ...o, children: o.children }) });
|
|
13
|
+
}
|
|
14
|
+
const R = ({ paymentGroupId: o, contractorUuid: c, dictionary: s }) => {
|
|
15
|
+
C("Contractor.Payments.PaymentStatement", s);
|
|
16
|
+
const { t: n } = G("Contractor.Payments.PaymentStatement"), { data: r } = f({
|
|
17
|
+
contractorPaymentGroupUuid: o
|
|
18
|
+
});
|
|
19
|
+
if (!r.contractorPaymentGroup)
|
|
20
|
+
throw new Error(n("errors.paymentGroupNotFound"));
|
|
21
|
+
const i = r.contractorPaymentGroup.companyUuid, { data: p } = d({ companyUuid: i }), u = p.contractorList || [], e = r.contractorPaymentGroup.contractorPayments?.find(
|
|
22
|
+
(t) => t.contractorUuid === c
|
|
23
|
+
);
|
|
24
|
+
if (!e)
|
|
25
|
+
throw new Error(n("errors.paymentNotFound"));
|
|
26
|
+
const { data: y } = P(
|
|
27
|
+
{
|
|
28
|
+
contractorPaymentUuid: e.uuid
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
retry: !1,
|
|
32
|
+
throwOnError: (t) => !(t instanceof h && t.httpMeta.response.status === 404)
|
|
33
|
+
}
|
|
34
|
+
), m = u.find((t) => t.uuid === c);
|
|
35
|
+
if (!m)
|
|
36
|
+
throw new Error(n("errors.contractorNotFound"));
|
|
37
|
+
return /* @__PURE__ */ a(
|
|
38
|
+
w,
|
|
39
|
+
{
|
|
40
|
+
payment: e,
|
|
41
|
+
contractor: m,
|
|
42
|
+
paymentReceipt: y?.contractorPaymentReceipt,
|
|
43
|
+
checkDate: r.contractorPaymentGroup.checkDate || ""
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
j as PaymentStatement,
|
|
49
|
+
R as Root
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=PaymentStatement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentStatement.js","sources":["../../../../../src/components/Contractor/Payments/PaymentStatement/PaymentStatement.tsx"],"sourcesContent":["import { useContractorPaymentGroupsGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGet'\nimport { useContractorsListSuspense } from '@gusto/embedded-api/react-query/contractorsList'\nimport { useContractorPaymentsGetReceipt } from '@gusto/embedded-api/react-query/contractorPaymentsGetReceipt'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { useTranslation } from 'react-i18next'\nimport { PaymentStatementPresentation } from './PaymentStatementPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\n\ninterface PaymentStatementProps extends BaseComponentInterface<'Contractor.Payments.PaymentStatement'> {\n paymentGroupId: string\n contractorUuid: string\n}\n\nexport function PaymentStatement(props: PaymentStatementProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ paymentGroupId, contractorUuid, dictionary }: PaymentStatementProps) => {\n useComponentDictionary('Contractor.Payments.PaymentStatement', dictionary)\n const { t } = useTranslation('Contractor.Payments.PaymentStatement')\n // Fetching entire payment\n const { data: paymentGroupResponse } = useContractorPaymentGroupsGetSuspense({\n contractorPaymentGroupUuid: paymentGroupId,\n })\n\n if (!paymentGroupResponse.contractorPaymentGroup) {\n throw new Error(t('errors.paymentGroupNotFound'))\n }\n\n const companyId = paymentGroupResponse.contractorPaymentGroup.companyUuid!\n // Fetching all contractors for the company\n const { data: contractorList } = useContractorsListSuspense({ companyUuid: companyId })\n const contractors = contractorList.contractorList || []\n // Locating the payment for the selectedcontractor\n const payment = paymentGroupResponse.contractorPaymentGroup.contractorPayments?.find(\n p => p.contractorUuid === contractorUuid,\n )\n\n if (!payment) {\n throw new Error(t('errors.paymentNotFound'))\n }\n // Attempting to fetch the payment receipt\n // Note: 404 is expected for receipts that aren't available (e.g., non-direct deposit or not yet funded)\n const { data: paymentResponse } = useContractorPaymentsGetReceipt(\n {\n contractorPaymentUuid: payment.uuid!,\n },\n {\n retry: false,\n throwOnError: (error: Error) => {\n // Ignore 404 errors (receipt not available), but throw other errors\n if (error instanceof APIError && error.httpMeta.response.status === 404) {\n return false\n }\n return true\n },\n },\n )\n const contractor = contractors.find(c => c.uuid === contractorUuid)\n if (!contractor) {\n throw new Error(t('errors.contractorNotFound'))\n }\n\n return (\n <PaymentStatementPresentation\n payment={payment}\n contractor={contractor}\n paymentReceipt={paymentResponse?.contractorPaymentReceipt}\n checkDate={paymentGroupResponse.contractorPaymentGroup.checkDate || ''}\n />\n )\n}\n"],"names":["PaymentStatement","props","jsx","BaseComponent","Root","paymentGroupId","contractorUuid","dictionary","useComponentDictionary","t","useTranslation","paymentGroupResponse","useContractorPaymentGroupsGetSuspense","companyId","contractorList","useContractorsListSuspense","contractors","payment","p","paymentResponse","useContractorPaymentsGetReceipt","error","APIError","contractor","c","PaymentStatementPresentation"],"mappings":";;;;;;;;;;AAcO,SAASA,EAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC,EAAE,gBAAAC,GAAgB,gBAAAC,GAAgB,YAAAC,QAAwC;AAC7F,EAAAC,EAAuB,wCAAwCD,CAAU;AACzE,QAAM,EAAE,GAAAE,EAAA,IAAMC,EAAe,sCAAsC,GAE7D,EAAE,MAAMC,EAAA,IAAyBC,EAAsC;AAAA,IAC3E,4BAA4BP;AAAA,EAAA,CAC7B;AAED,MAAI,CAACM,EAAqB;AACxB,UAAM,IAAI,MAAMF,EAAE,6BAA6B,CAAC;AAGlD,QAAMI,IAAYF,EAAqB,uBAAuB,aAExD,EAAE,MAAMG,EAAA,IAAmBC,EAA2B,EAAE,aAAaF,GAAW,GAChFG,IAAcF,EAAe,kBAAkB,CAAA,GAE/CG,IAAUN,EAAqB,uBAAuB,oBAAoB;AAAA,IAC9E,CAAAO,MAAKA,EAAE,mBAAmBZ;AAAA,EAAA;AAG5B,MAAI,CAACW;AACH,UAAM,IAAI,MAAMR,EAAE,wBAAwB,CAAC;AAI7C,QAAM,EAAE,MAAMU,EAAA,IAAoBC;AAAA,IAChC;AAAA,MACE,uBAAuBH,EAAQ;AAAA,IAAA;AAAA,IAEjC;AAAA,MACE,OAAO;AAAA,MACP,cAAc,CAACI,MAET,EAAAA,aAAiBC,KAAYD,EAAM,SAAS,SAAS,WAAW;AAAA,IAItE;AAAA,EACF,GAEIE,IAAaP,EAAY,KAAK,CAAAQ,MAAKA,EAAE,SAASlB,CAAc;AAClE,MAAI,CAACiB;AACH,UAAM,IAAI,MAAMd,EAAE,2BAA2B,CAAC;AAGhD,SACE,gBAAAP;AAAA,IAACuB;AAAA,IAAA;AAAA,MACC,SAAAR;AAAA,MACA,YAAAM;AAAA,MACA,gBAAgBJ,GAAiB;AAAA,MACjC,WAAWR,EAAqB,uBAAuB,aAAa;AAAA,IAAA;AAAA,EAAA;AAG1E;"}
|
package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContractorPaymentForGroup } from '@gusto/embedded-api/models/components/contractorpaymentforgroup';
|
|
2
|
+
import { Contractor } from '@gusto/embedded-api/models/components/contractor';
|
|
3
|
+
import { ContractorPaymentReceipt } from '@gusto/embedded-api/models/components/contractorpaymentreceipt';
|
|
4
|
+
interface PaymentStatementPresentationProps {
|
|
5
|
+
payment: ContractorPaymentForGroup;
|
|
6
|
+
contractor: Contractor;
|
|
7
|
+
paymentReceipt?: ContractorPaymentReceipt;
|
|
8
|
+
checkDate: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const PaymentStatementPresentation: ({ payment, contractor, checkDate, paymentReceipt, }: PaymentStatementPresentationProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|