@gusto/embedded-react-sdk 0.55.0 → 0.55.1
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 +18 -0
- package/dist/components/Common/TaxInputs/TaxInputs.js +65 -64
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Select/Select.module.scss.js +5 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.d.ts +4 -2
- package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js +148 -117
- package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +56 -55
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.d.ts +1 -1
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js +15 -12
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.d.ts +69 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.js +48 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.js.map +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.d.ts +20 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.js +25 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.js.map +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/historicalPaymentMachine.d.ts +20 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/historicalPaymentMachine.js +24 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/historicalPaymentMachine.js.map +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentFlow/index.d.ts +2 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js +16 -15
- package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +36 -23
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +10 -8
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +46 -25
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +53 -52
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +37 -47
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +47 -44
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +65 -53
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +6 -4
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js.map +1 -1
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.d.ts +1 -1
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js +22 -19
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.d.ts +2 -8
- package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js +43 -42
- package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js.map +1 -1
- package/dist/components/Contractor/Payments/shared/paymentAmounts.d.ts +32 -0
- package/dist/components/Contractor/Payments/shared/paymentAmounts.js +11 -0
- package/dist/components/Contractor/Payments/shared/paymentAmounts.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/paymentAmounts.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +13 -4
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +43 -38
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +1 -0
- package/dist/components/Contractor/exports/contractorManagement.js +34 -32
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
- package/dist/components/Contractor/shared/SelectContractors/SelectContractors.d.ts +6 -1
- package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js +13 -12
- package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js.map +1 -1
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.d.ts +5 -1
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js +34 -32
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
- package/dist/components/Flow/Flow.js +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +6 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +36 -34
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.d.ts +22 -0
- package/dist/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.js +14 -0
- package/dist/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.js.map +1 -0
- package/dist/contexts/UnstableFeaturesProvider/WithUnstableFeature.d.ts +19 -0
- package/dist/contexts/UnstableFeaturesProvider/WithUnstableFeature.js +8 -0
- package/dist/contexts/UnstableFeaturesProvider/WithUnstableFeature.js.map +1 -0
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +41 -0
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js +14 -0
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/i18n/en/Contractor.Payments.CreateHistoricalPayment.json.js +34 -32
- package/dist/i18n/en/Contractor.Payments.CreateHistoricalPayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +20 -18
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +0 -21
- package/dist/i18n/types.d.ts +10 -2
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +1 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/renderWithProviders.d.ts +4 -1
- package/dist/test-utils/tableQueries.d.ts +9 -0
- package/docs/guides/endpoint-inventory.json +7 -0
- package/package.json +18 -18
package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { getContractorDisplayName as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import N from "
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as g } from "react";
|
|
3
|
+
import { getContractorDisplayName as D } from "../../../shared/helpers.js";
|
|
4
|
+
import { getContractorPaymentWageAmount as s, getContractorPaymentTotalAmount as a } from "../paymentAmounts.js";
|
|
5
|
+
import { Flex as w } from "../../../../Common/Flex/Flex.js";
|
|
6
|
+
import { formatHoursDisplay as N } from "../../../../Payroll/helpers.js";
|
|
7
|
+
import T from "../../../../../hooks/useNumberFormatter.js";
|
|
8
|
+
import { DataView as b } from "../../../../Common/DataView/DataView.js";
|
|
9
|
+
const j = "0.000", S = ({
|
|
10
|
+
contractorPaymentGroup: u,
|
|
11
|
+
contractors: A,
|
|
12
|
+
bankAccount: f,
|
|
13
|
+
showDebitColumns: p = !0,
|
|
13
14
|
dictionary: t
|
|
14
15
|
}) => {
|
|
15
|
-
const
|
|
16
|
+
const m = T(), h = (e) => e.wageType === "Hourly" && e.hourlyRate ? `Hourly ${m(Number(e.hourlyRate))}/hr` : e.wageType, i = (e) => {
|
|
16
17
|
switch (e) {
|
|
17
18
|
case "Direct Deposit":
|
|
18
19
|
return t.paymentMethods.directDeposit;
|
|
@@ -23,95 +24,95 @@ const D = "0.000", F = ({
|
|
|
23
24
|
default:
|
|
24
25
|
return e || t.notAvailable;
|
|
25
26
|
}
|
|
26
|
-
},
|
|
27
|
-
(e, r) => (e.wageAmount +=
|
|
27
|
+
}, o = u.contractorPayments || [], l = g(() => o.reduce(
|
|
28
|
+
(e, r) => (e.wageAmount += s(r), e.bonusAmount += Number(r.bonus || "0"), e.reimbursementAmount += Number(r.reimbursement || "0"), e.totalAmount += a(r), e),
|
|
28
29
|
{ wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 }
|
|
29
|
-
), [
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
), [o]);
|
|
31
|
+
return /* @__PURE__ */ d(w, { flexDirection: "column", gap: 32, children: [
|
|
31
32
|
/* @__PURE__ */ n(
|
|
32
|
-
|
|
33
|
+
b,
|
|
33
34
|
{
|
|
34
35
|
columns: [
|
|
35
36
|
{
|
|
36
37
|
title: t.totalAmount,
|
|
37
|
-
render: () =>
|
|
38
|
+
render: () => m(Number(u.totals?.amount || "0"))
|
|
38
39
|
},
|
|
39
|
-
...
|
|
40
|
+
...p ? [
|
|
40
41
|
{
|
|
41
42
|
title: t.debitAmount ?? "",
|
|
42
|
-
render: () =>
|
|
43
|
+
render: () => m(Number(u.totals?.debitAmount || "0"))
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
title: t.debitAccount ?? "",
|
|
46
|
-
render: () =>
|
|
47
|
+
render: () => f?.hiddenAccountNumber ?? t.notAvailable
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
title: t.debitDate ?? "",
|
|
50
|
-
render: () =>
|
|
51
|
+
render: () => u.debitDate || t.notAvailable
|
|
51
52
|
}
|
|
52
53
|
] : [],
|
|
53
54
|
{
|
|
54
55
|
title: t.contractorPayDate,
|
|
55
|
-
render: () =>
|
|
56
|
+
render: () => u.checkDate || t.notAvailable
|
|
56
57
|
}
|
|
57
58
|
],
|
|
58
|
-
data: [
|
|
59
|
+
data: [u],
|
|
59
60
|
label: t.paymentSummaryTitle
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
o.length > 0 && /* @__PURE__ */ n(
|
|
64
|
+
b,
|
|
64
65
|
{
|
|
65
66
|
columns: [
|
|
66
67
|
{
|
|
67
68
|
title: t.contractor,
|
|
68
|
-
render: (e) =>
|
|
69
|
-
|
|
69
|
+
render: (e) => D(
|
|
70
|
+
A.find(
|
|
70
71
|
(r) => r.uuid === e.contractorUuid
|
|
71
72
|
)
|
|
72
73
|
) || t.notAvailable
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
76
|
title: t.wageType,
|
|
76
|
-
render: (e) =>
|
|
77
|
+
render: (e) => h(e)
|
|
77
78
|
},
|
|
78
79
|
{
|
|
79
80
|
title: t.paymentMethod,
|
|
80
|
-
render: (e) =>
|
|
81
|
+
render: (e) => i(e.paymentMethod)
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
84
|
title: t.hours,
|
|
84
85
|
justify: "end",
|
|
85
|
-
render: (e) => e.wageType === "Hourly" && e.hours ?
|
|
86
|
+
render: (e) => e.wageType === "Hourly" && e.hours ? N(parseFloat(e.hours)) : j
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
89
|
title: t.wage,
|
|
89
90
|
justify: "end",
|
|
90
|
-
render: (e) =>
|
|
91
|
+
render: (e) => m(s(e))
|
|
91
92
|
},
|
|
92
93
|
{
|
|
93
94
|
title: t.bonus,
|
|
94
95
|
justify: "end",
|
|
95
|
-
render: (e) =>
|
|
96
|
+
render: (e) => m(Number(e.bonus || "0"))
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
title: t.reimbursement,
|
|
99
100
|
justify: "end",
|
|
100
|
-
render: (e) =>
|
|
101
|
+
render: (e) => m(Number(e.reimbursement || "0"))
|
|
101
102
|
},
|
|
102
103
|
{
|
|
103
104
|
title: t.total,
|
|
104
105
|
justify: "end",
|
|
105
|
-
render: (e) =>
|
|
106
|
+
render: (e) => m(a(e))
|
|
106
107
|
}
|
|
107
108
|
],
|
|
108
|
-
data:
|
|
109
|
+
data: o,
|
|
109
110
|
footer: () => ({
|
|
110
111
|
"column-0": t.totalsLabel,
|
|
111
|
-
"column-4":
|
|
112
|
-
"column-5":
|
|
113
|
-
"column-6":
|
|
114
|
-
"column-7":
|
|
112
|
+
"column-4": m(l.wageAmount || 0),
|
|
113
|
+
"column-5": m(l.bonusAmount || 0),
|
|
114
|
+
"column-6": m(l.reimbursementAmount || 0),
|
|
115
|
+
"column-7": m(l.totalAmount || 0)
|
|
115
116
|
}),
|
|
116
117
|
label: t.contractorPaymentsTitle
|
|
117
118
|
}
|
|
@@ -119,6 +120,6 @@ const D = "0.000", F = ({
|
|
|
119
120
|
] });
|
|
120
121
|
};
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
+
S as PaymentSummaryBlock
|
|
123
124
|
};
|
|
124
125
|
//# sourceMappingURL=PaymentSummaryBlock.js.map
|
package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentSummaryBlock.js","sources":["../../../../../../src/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport { getContractorDisplayName } from '../../../shared/helpers'\nimport { DataView, Flex } from '@/components/Common'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nconst ZERO_HOURS_DISPLAY = '0.000'\n\n/**\n * The subset of a contractor payment record `PaymentSummaryBlock` renders. Both\n * `ContractorPaymentForGroup` (post-creation) and `ContractorPaymentForGroupPreview` (pre-creation)\n * satisfy this structurally, so the block works for a not-yet-submitted preview and an\n * already-created group alike.\n *\n * @internal\n */\nexport interface PaymentSummaryBlockContractorPayment {\n contractorUuid?: string\n wageType?: string\n hourlyRate?: string\n paymentMethod?: string\n hours?: string\n wage?: string\n bonus?: string\n reimbursement?: string\n wageTotal?: string\n}\n\n/**\n * The subset of a contractor payment group `PaymentSummaryBlock` renders. Both\n * `ContractorPaymentGroup` and `ContractorPaymentGroupPreview` satisfy this structurally.\n *\n * @internal\n */\nexport interface PaymentSummaryBlockGroup {\n checkDate?: string\n debitDate?: string\n totals?: {\n amount?: string\n debitAmount?: string\n }\n contractorPayments?: PaymentSummaryBlockContractorPayment[]\n}\n\n/**\n * Every string `PaymentSummaryBlock` renders. There is no default copy or namespace of its own —\n * `PaymentSummaryBlock` is `@internal`, so each caller (`PaymentSummary`, `HistoricalPaymentSummary`)\n * must fully resolve this from its own public namespace and pass it down, rather than this\n * component owning a namespace that would show up in the SDK's public translation types without\n * ever being a real partner override surface.\n *\n * @internal\n */\nexport interface PaymentSummaryBlockDictionary {\n paymentSummaryTitle: string\n totalAmount: string\n /** Required when `showDebitColumns` is `true`. */\n debitAmount?: string\n /** Required when `showDebitColumns` is `true`. */\n debitAccount?: string\n /** Required when `showDebitColumns` is `true`. */\n debitDate?: string\n contractorPayDate: string\n contractorPaymentsTitle: string\n contractor: string\n wageType: string\n paymentMethod: string\n paymentMethods: {\n directDeposit: string\n check: string\n historicalPayment: string\n }\n hours: string\n wage: string\n bonus: string\n reimbursement: string\n total: string\n totalsLabel: string\n notAvailable: string\n}\n\n/** @internal */\nexport interface PaymentSummaryBlockProps {\n contractorPaymentGroup: PaymentSummaryBlockGroup\n contractors: Contractor[]\n bankAccount?: CompanyBankAccount\n /** Whether to show the debit amount, debit account, and debit date columns. Defaults to `true`. */\n showDebitColumns?: boolean\n dictionary: PaymentSummaryBlockDictionary\n}\n\n/** @internal */\nexport const PaymentSummaryBlock = ({\n contractorPaymentGroup,\n contractors,\n bankAccount,\n showDebitColumns = true,\n dictionary,\n}: PaymentSummaryBlockProps) => {\n const currencyFormatter = useNumberFormatter()\n\n const formatWageType = (contractor: PaymentSummaryBlockContractorPayment) => {\n if (contractor.wageType === 'Hourly' && contractor.hourlyRate) {\n return `Hourly ${currencyFormatter(Number(contractor.hourlyRate))}/hr`\n }\n return contractor.wageType\n }\n\n const formatPaymentMethod = (paymentMethod?: string) => {\n switch (paymentMethod) {\n case 'Direct Deposit':\n return dictionary.paymentMethods.directDeposit\n case 'Check':\n return dictionary.paymentMethods.check\n case 'Historical Payment':\n return dictionary.paymentMethods.historicalPayment\n default:\n return paymentMethod || dictionary.notAvailable\n }\n }\n\n const contractorPayments = contractorPaymentGroup.contractorPayments || []\n\n const totals = useMemo(() => {\n return contractorPayments.reduce(\n (acc, contractorPayment) => {\n acc.wageAmount += Number(contractorPayment.wage || '0')\n acc.bonusAmount += Number(contractorPayment.bonus || '0')\n acc.reimbursementAmount += Number(contractorPayment.reimbursement || '0')\n acc.totalAmount += Number(contractorPayment.wageTotal || '0')\n return acc\n },\n { wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 },\n )\n }, [contractorPayments])\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <DataView\n columns={[\n {\n title: dictionary.totalAmount,\n render: () => currencyFormatter(Number(contractorPaymentGroup.totals?.amount || '0')),\n },\n ...(showDebitColumns\n ? [\n {\n title: dictionary.debitAmount ?? '',\n render: () =>\n currencyFormatter(Number(contractorPaymentGroup.totals?.debitAmount || '0')),\n },\n {\n title: dictionary.debitAccount ?? '',\n render: () => bankAccount?.hiddenAccountNumber ?? dictionary.notAvailable,\n },\n {\n title: dictionary.debitDate ?? '',\n render: () => contractorPaymentGroup.debitDate || dictionary.notAvailable,\n },\n ]\n : []),\n {\n title: dictionary.contractorPayDate,\n render: () => contractorPaymentGroup.checkDate || dictionary.notAvailable,\n },\n ]}\n data={[contractorPaymentGroup]}\n label={dictionary.paymentSummaryTitle}\n />\n\n {contractorPayments.length > 0 && (\n <DataView\n columns={[\n {\n title: dictionary.contractor,\n render: contractorPayment =>\n getContractorDisplayName(\n contractors.find(\n contractor => contractor.uuid === contractorPayment.contractorUuid,\n ),\n ) || dictionary.notAvailable,\n },\n {\n title: dictionary.wageType,\n render: contractorPayment => formatWageType(contractorPayment),\n },\n {\n title: dictionary.paymentMethod,\n render: contractorPayment => formatPaymentMethod(contractorPayment.paymentMethod),\n },\n {\n title: dictionary.hours,\n justify: 'end',\n render: contractorPayment =>\n contractorPayment.wageType === 'Hourly' && contractorPayment.hours\n ? formatHoursDisplay(parseFloat(contractorPayment.hours))\n : ZERO_HOURS_DISPLAY,\n },\n {\n title: dictionary.wage,\n justify: 'end',\n render: contractorPayment => currencyFormatter(Number(contractorPayment.wage || '0')),\n },\n {\n title: dictionary.bonus,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(Number(contractorPayment.bonus || '0')),\n },\n {\n title: dictionary.reimbursement,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(Number(contractorPayment.reimbursement || '0')),\n },\n {\n title: dictionary.total,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(Number(contractorPayment.wageTotal || '0')),\n },\n ]}\n data={contractorPayments}\n footer={() => ({\n 'column-0': dictionary.totalsLabel,\n 'column-4': currencyFormatter(totals.wageAmount || 0),\n 'column-5': currencyFormatter(totals.bonusAmount || 0),\n 'column-6': currencyFormatter(totals.reimbursementAmount || 0),\n 'column-7': currencyFormatter(totals.totalAmount || 0),\n })}\n label={dictionary.contractorPaymentsTitle}\n />\n )}\n </Flex>\n )\n}\n"],"names":["ZERO_HOURS_DISPLAY","PaymentSummaryBlock","contractorPaymentGroup","contractors","bankAccount","showDebitColumns","dictionary","currencyFormatter","useNumberFormatter","formatWageType","contractor","formatPaymentMethod","paymentMethod","contractorPayments","totals","useMemo","acc","contractorPayment","jsxs","Flex","jsx","DataView","getContractorDisplayName","formatHoursDisplay"],"mappings":";;;;;;;AAQA,MAAMA,IAAqB,SAsFdC,IAAsB,CAAC;AAAA,EAClC,wBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,YAAAC;AACF,MAAgC;AAC9B,QAAMC,I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,EAAkB,OAAOU,EAAkB,SAAS,GAAG,CAAC;AAAA,UAAA;AAAA,UAE5D;AAAA,YACE,OAAOX,EAAW;AAAA,YAClB,SAAS;AAAA,YACT,QAAQ,CAAAW,MACNV,EAAkB,OAAOU,EAAkB,iBAAiB,GAAG,CAAC;AAAA,UAAA;AAAA,UAEpE;AAAA,YACE,OAAOX,EAAW;AAAA,YAClB,SAAS;AAAA,YACT,QAAQ,CAAAW,MACNV,EAAkB,OAAOU,EAAkB,aAAa,GAAG,CAAC;AAAA,UAAA;AAAA,QAChE;AAAA,QAEF,MAAMJ;AAAA,QACN,QAAQ,OAAO;AAAA,UACb,YAAYP,EAAW;AAAA,UACvB,YAAYC,EAAkBO,EAAO,cAAc,CAAC;AAAA,UACpD,YAAYP,EAAkBO,EAAO,eAAe,CAAC;AAAA,UACrD,YAAYP,EAAkBO,EAAO,uBAAuB,CAAC;AAAA,UAC7D,YAAYP,EAAkBO,EAAO,eAAe,CAAC;AAAA,QAAA;AAAA,QAEvD,OAAOR,EAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EACpB,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PaymentSummaryBlock.js","sources":["../../../../../../src/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport { getContractorDisplayName } from '../../../shared/helpers'\nimport {\n getContractorPaymentWageAmount,\n getContractorPaymentTotalAmount,\n type ContractorPaymentAmountFields,\n} from '../paymentAmounts'\nimport { DataView, Flex } from '@/components/Common'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nconst ZERO_HOURS_DISPLAY = '0.000'\n\n/**\n * The subset of a contractor payment record `PaymentSummaryBlock` renders. Both\n * `ContractorPaymentForGroup` (post-creation) and `ContractorPaymentForGroupPreview` (pre-creation)\n * satisfy this structurally, so the block works for a not-yet-submitted preview and an\n * already-created group alike.\n *\n * @internal\n */\nexport interface PaymentSummaryBlockContractorPayment extends ContractorPaymentAmountFields {\n contractorUuid?: string\n paymentMethod?: string\n}\n\n/**\n * The subset of a contractor payment group `PaymentSummaryBlock` renders. Both\n * `ContractorPaymentGroup` and `ContractorPaymentGroupPreview` satisfy this structurally.\n *\n * @internal\n */\nexport interface PaymentSummaryBlockGroup {\n checkDate?: string\n debitDate?: string\n totals?: {\n amount?: string\n debitAmount?: string\n }\n contractorPayments?: PaymentSummaryBlockContractorPayment[]\n}\n\n/**\n * Every string `PaymentSummaryBlock` renders. There is no default copy or namespace of its own —\n * `PaymentSummaryBlock` is `@internal`, so each caller (`PaymentSummary`, `HistoricalPaymentSummary`)\n * must fully resolve this from its own public namespace and pass it down, rather than this\n * component owning a namespace that would show up in the SDK's public translation types without\n * ever being a real partner override surface.\n *\n * @internal\n */\nexport interface PaymentSummaryBlockDictionary {\n paymentSummaryTitle: string\n totalAmount: string\n /** Required when `showDebitColumns` is `true`. */\n debitAmount?: string\n /** Required when `showDebitColumns` is `true`. */\n debitAccount?: string\n /** Required when `showDebitColumns` is `true`. */\n debitDate?: string\n contractorPayDate: string\n contractorPaymentsTitle: string\n contractor: string\n wageType: string\n paymentMethod: string\n paymentMethods: {\n directDeposit: string\n check: string\n historicalPayment: string\n }\n hours: string\n wage: string\n bonus: string\n reimbursement: string\n total: string\n totalsLabel: string\n notAvailable: string\n}\n\n/** @internal */\nexport interface PaymentSummaryBlockProps {\n contractorPaymentGroup: PaymentSummaryBlockGroup\n contractors: Contractor[]\n bankAccount?: CompanyBankAccount\n /** Whether to show the debit amount, debit account, and debit date columns. Defaults to `true`. */\n showDebitColumns?: boolean\n dictionary: PaymentSummaryBlockDictionary\n}\n\n/** @internal */\nexport const PaymentSummaryBlock = ({\n contractorPaymentGroup,\n contractors,\n bankAccount,\n showDebitColumns = true,\n dictionary,\n}: PaymentSummaryBlockProps) => {\n const currencyFormatter = useNumberFormatter()\n\n const formatWageType = (contractor: PaymentSummaryBlockContractorPayment) => {\n if (contractor.wageType === 'Hourly' && contractor.hourlyRate) {\n return `Hourly ${currencyFormatter(Number(contractor.hourlyRate))}/hr`\n }\n return contractor.wageType\n }\n\n const formatPaymentMethod = (paymentMethod?: string) => {\n switch (paymentMethod) {\n case 'Direct Deposit':\n return dictionary.paymentMethods.directDeposit\n case 'Check':\n return dictionary.paymentMethods.check\n case 'Historical Payment':\n return dictionary.paymentMethods.historicalPayment\n default:\n return paymentMethod || dictionary.notAvailable\n }\n }\n\n const contractorPayments = contractorPaymentGroup.contractorPayments || []\n\n const totals = useMemo(() => {\n return contractorPayments.reduce(\n (acc, contractorPayment) => {\n acc.wageAmount += getContractorPaymentWageAmount(contractorPayment)\n acc.bonusAmount += Number(contractorPayment.bonus || '0')\n acc.reimbursementAmount += Number(contractorPayment.reimbursement || '0')\n acc.totalAmount += getContractorPaymentTotalAmount(contractorPayment)\n return acc\n },\n { wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 },\n )\n }, [contractorPayments])\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <DataView\n columns={[\n {\n title: dictionary.totalAmount,\n render: () => currencyFormatter(Number(contractorPaymentGroup.totals?.amount || '0')),\n },\n ...(showDebitColumns\n ? [\n {\n title: dictionary.debitAmount ?? '',\n render: () =>\n currencyFormatter(Number(contractorPaymentGroup.totals?.debitAmount || '0')),\n },\n {\n title: dictionary.debitAccount ?? '',\n render: () => bankAccount?.hiddenAccountNumber ?? dictionary.notAvailable,\n },\n {\n title: dictionary.debitDate ?? '',\n render: () => contractorPaymentGroup.debitDate || dictionary.notAvailable,\n },\n ]\n : []),\n {\n title: dictionary.contractorPayDate,\n render: () => contractorPaymentGroup.checkDate || dictionary.notAvailable,\n },\n ]}\n data={[contractorPaymentGroup]}\n label={dictionary.paymentSummaryTitle}\n />\n\n {contractorPayments.length > 0 && (\n <DataView\n columns={[\n {\n title: dictionary.contractor,\n render: contractorPayment =>\n getContractorDisplayName(\n contractors.find(\n contractor => contractor.uuid === contractorPayment.contractorUuid,\n ),\n ) || dictionary.notAvailable,\n },\n {\n title: dictionary.wageType,\n render: contractorPayment => formatWageType(contractorPayment),\n },\n {\n title: dictionary.paymentMethod,\n render: contractorPayment => formatPaymentMethod(contractorPayment.paymentMethod),\n },\n {\n title: dictionary.hours,\n justify: 'end',\n render: contractorPayment =>\n contractorPayment.wageType === 'Hourly' && contractorPayment.hours\n ? formatHoursDisplay(parseFloat(contractorPayment.hours))\n : ZERO_HOURS_DISPLAY,\n },\n {\n title: dictionary.wage,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(getContractorPaymentWageAmount(contractorPayment)),\n },\n {\n title: dictionary.bonus,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(Number(contractorPayment.bonus || '0')),\n },\n {\n title: dictionary.reimbursement,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(Number(contractorPayment.reimbursement || '0')),\n },\n {\n title: dictionary.total,\n justify: 'end',\n render: contractorPayment =>\n currencyFormatter(getContractorPaymentTotalAmount(contractorPayment)),\n },\n ]}\n data={contractorPayments}\n footer={() => ({\n 'column-0': dictionary.totalsLabel,\n 'column-4': currencyFormatter(totals.wageAmount || 0),\n 'column-5': currencyFormatter(totals.bonusAmount || 0),\n 'column-6': currencyFormatter(totals.reimbursementAmount || 0),\n 'column-7': currencyFormatter(totals.totalAmount || 0),\n })}\n label={dictionary.contractorPaymentsTitle}\n />\n )}\n </Flex>\n )\n}\n"],"names":["ZERO_HOURS_DISPLAY","PaymentSummaryBlock","contractorPaymentGroup","contractors","bankAccount","showDebitColumns","dictionary","currencyFormatter","useNumberFormatter","formatWageType","contractor","formatPaymentMethod","paymentMethod","contractorPayments","totals","useMemo","acc","contractorPayment","getContractorPaymentWageAmount","getContractorPaymentTotalAmount","jsxs","Flex","jsx","DataView","getContractorDisplayName","formatHoursDispl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;AAAA,YACT,QAAQ,CAAAW,MACNV,EAAkBW,EAA+BD,CAAiB,CAAC;AAAA,UAAA;AAAA,UAEvE;AAAA,YACE,OAAOX,EAAW;AAAA,YAClB,SAAS;AAAA,YACT,QAAQ,CAAAW,MACNV,EAAkB,OAAOU,EAAkB,SAAS,GAAG,CAAC;AAAA,UAAA;AAAA,UAE5D;AAAA,YACE,OAAOX,EAAW;AAAA,YAClB,SAAS;AAAA,YACT,QAAQ,CAAAW,MACNV,EAAkB,OAAOU,EAAkB,iBAAiB,GAAG,CAAC;AAAA,UAAA;AAAA,UAEpE;AAAA,YACE,OAAOX,EAAW;AAAA,YAClB,SAAS;AAAA,YACT,QAAQ,CAAAW,MACNV,EAAkBY,EAAgCF,CAAiB,CAAC;AAAA,UAAA;AAAA,QACxE;AAAA,QAEF,MAAMJ;AAAA,QACN,QAAQ,OAAO;AAAA,UACb,YAAYP,EAAW;AAAA,UACvB,YAAYC,EAAkBO,EAAO,cAAc,CAAC;AAAA,UACpD,YAAYP,EAAkBO,EAAO,eAAe,CAAC;AAAA,UACrD,YAAYP,EAAkBO,EAAO,uBAAuB,CAAC;AAAA,UAC7D,YAAYP,EAAkBO,EAAO,eAAe,CAAC;AAAA,QAAA;AAAA,QAEvD,OAAOR,EAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EACpB,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subset of a contractor payment record needed to derive its wage and total amounts. Both
|
|
3
|
+
* pre-creation (`ContractorPayments`, `ContractorPaymentForGroupPreview`) and post-creation
|
|
4
|
+
* (`ContractorPaymentForGroup`) payment shapes satisfy this structurally.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface ContractorPaymentAmountFields {
|
|
9
|
+
wageType?: string;
|
|
10
|
+
hourlyRate?: string;
|
|
11
|
+
hours?: string;
|
|
12
|
+
wage?: string;
|
|
13
|
+
bonus?: string;
|
|
14
|
+
reimbursement?: string;
|
|
15
|
+
wageTotal?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The payment's wage amount: `hours * hourlyRate` for Hourly contractors, otherwise the raw
|
|
19
|
+
* `wage` field. The API only populates `wage` for Fixed-wage contractors, so Hourly payments
|
|
20
|
+
* must be derived from hours and rate instead.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare function getContractorPaymentWageAmount(payment: ContractorPaymentAmountFields): number;
|
|
25
|
+
/**
|
|
26
|
+
* The payment's true total: `wageTotal + reimbursement`. The API's `wageTotal` field is
|
|
27
|
+
* `(hours * hourlyRate) + wage + bonus` and excludes reimbursement by design, so callers must add
|
|
28
|
+
* it back in rather than treating `wageTotal` alone as "the total".
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function getContractorPaymentTotalAmount(payment: ContractorPaymentAmountFields): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function e(r) {
|
|
2
|
+
return r.wageType === "Hourly" ? Number(r.hours || "0") * Number(r.hourlyRate || "0") : Number(r.wage || "0");
|
|
3
|
+
}
|
|
4
|
+
function t(r) {
|
|
5
|
+
return Number(r.wageTotal || "0") + Number(r.reimbursement || "0");
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
t as getContractorPaymentTotalAmount,
|
|
9
|
+
e as getContractorPaymentWageAmount
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=paymentAmounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymentAmounts.js","sources":["../../../../../src/components/Contractor/Payments/shared/paymentAmounts.ts"],"sourcesContent":["/**\n * The subset of a contractor payment record needed to derive its wage and total amounts. Both\n * pre-creation (`ContractorPayments`, `ContractorPaymentForGroupPreview`) and post-creation\n * (`ContractorPaymentForGroup`) payment shapes satisfy this structurally.\n *\n * @internal\n */\nexport interface ContractorPaymentAmountFields {\n wageType?: string\n hourlyRate?: string\n hours?: string\n wage?: string\n bonus?: string\n reimbursement?: string\n wageTotal?: string\n}\n\n/**\n * The payment's wage amount: `hours * hourlyRate` for Hourly contractors, otherwise the raw\n * `wage` field. The API only populates `wage` for Fixed-wage contractors, so Hourly payments\n * must be derived from hours and rate instead.\n *\n * @internal\n */\nexport function getContractorPaymentWageAmount(payment: ContractorPaymentAmountFields): number {\n return payment.wageType === 'Hourly'\n ? Number(payment.hours || '0') * Number(payment.hourlyRate || '0')\n : Number(payment.wage || '0')\n}\n\n/**\n * The payment's true total: `wageTotal + reimbursement`. The API's `wageTotal` field is\n * `(hours * hourlyRate) + wage + bonus` and excludes reimbursement by design, so callers must add\n * it back in rather than treating `wageTotal` alone as \"the total\".\n *\n * @internal\n */\nexport function getContractorPaymentTotalAmount(payment: ContractorPaymentAmountFields): number {\n return Number(payment.wageTotal || '0') + Number(payment.reimbursement || '0')\n}\n"],"names":["getContractorPaymentWageAmount","payment","getContractorPaymentTotalAmount"],"mappings":"AAwBO,SAASA,EAA+BC,GAAgD;AAC7F,SAAOA,EAAQ,aAAa,WACxB,OAAOA,EAAQ,SAAS,GAAG,IAAI,OAAOA,EAAQ,cAAc,GAAG,IAC/D,OAAOA,EAAQ,QAAQ,GAAG;AAChC;AASO,SAASC,EAAgCD,GAAgD;AAC9F,SAAO,OAAOA,EAAQ,aAAa,GAAG,IAAI,OAAOA,EAAQ,iBAAiB,GAAG;AAC/E;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,17 +3,26 @@ import { PostV1CompaniesCompanyIdContractorPaymentGroupsContractorPayments as Co
|
|
|
3
3
|
import { Contractor } from '@gusto/embedded-api/models/components/contractor';
|
|
4
4
|
import { EditContractorPaymentFormValues } from './SetPaymentAmounts/EditContractorPaymentFormSchema';
|
|
5
5
|
/** @internal */
|
|
6
|
+
export type VirtualContractorPayment = ContractorPayments & {
|
|
7
|
+
isTouched: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
6
10
|
export interface UsePaymentAmountsEditorParams {
|
|
7
11
|
contractors: Contractor[];
|
|
8
12
|
allowedPaymentMethods: ContractorPaymentMethod[];
|
|
13
|
+
/**
|
|
14
|
+
* Payments to seed state with instead of the zeroed default, keyed by `contractorUuid`.
|
|
15
|
+
* Contractors without a matching entry still get the zeroed default. Pass the previous
|
|
16
|
+
* `virtualContractorPayments` here to survive this hook's owner unmounting and remounting
|
|
17
|
+
* (e.g. a "Back" button that swaps the amounts screen out for another screen and back).
|
|
18
|
+
*/
|
|
19
|
+
preservedContractorPayments?: VirtualContractorPayment[];
|
|
9
20
|
onEditOpen?: () => void;
|
|
10
21
|
onEditSave?: (data: EditContractorPaymentFormValues) => void;
|
|
11
22
|
}
|
|
12
23
|
/** @internal */
|
|
13
24
|
export interface UsePaymentAmountsEditorReturn {
|
|
14
|
-
virtualContractorPayments:
|
|
15
|
-
isTouched: boolean;
|
|
16
|
-
})[];
|
|
25
|
+
virtualContractorPayments: VirtualContractorPayment[];
|
|
17
26
|
totals: {
|
|
18
27
|
wage: number;
|
|
19
28
|
bonus: number;
|
|
@@ -29,4 +38,4 @@ export interface UsePaymentAmountsEditorReturn {
|
|
|
29
38
|
};
|
|
30
39
|
}
|
|
31
40
|
/** @internal */
|
|
32
|
-
export declare function usePaymentAmountsEditor({ contractors, allowedPaymentMethods, onEditOpen, onEditSave, }: UsePaymentAmountsEditorParams): UsePaymentAmountsEditorReturn;
|
|
41
|
+
export declare function usePaymentAmountsEditor({ contractors, allowedPaymentMethods, preservedContractorPayments, onEditOpen, onEditSave, }: UsePaymentAmountsEditorParams): UsePaymentAmountsEditorReturn;
|
|
@@ -1,46 +1,51 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { createEditContractorPaymentFormSchema as
|
|
5
|
-
function
|
|
6
|
-
return u.includes(
|
|
1
|
+
import { useState as h, useMemo as U } from "react";
|
|
2
|
+
import { useForm as v } from "react-hook-form";
|
|
3
|
+
import { zodResolver as S } from "@hookform/resolvers/zod";
|
|
4
|
+
import { createEditContractorPaymentFormSchema as T } from "./SetPaymentAmounts/EditContractorPaymentFormSchema.js";
|
|
5
|
+
function p(n, u) {
|
|
6
|
+
return u.includes(n) ? n : u[0] ?? "Check";
|
|
7
7
|
}
|
|
8
8
|
function O({
|
|
9
|
-
contractors:
|
|
9
|
+
contractors: n,
|
|
10
10
|
allowedPaymentMethods: u,
|
|
11
|
-
|
|
11
|
+
preservedContractorPayments: l,
|
|
12
|
+
onEditOpen: y,
|
|
12
13
|
onEditSave: g
|
|
13
14
|
}) {
|
|
14
|
-
const [f, m] =
|
|
15
|
-
() =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
const [f, m] = h(!1), [i, M] = h(
|
|
16
|
+
() => n.map((e) => {
|
|
17
|
+
const t = l?.find(
|
|
18
|
+
(o) => o.contractorUuid === e.uuid
|
|
19
|
+
);
|
|
20
|
+
return t || {
|
|
21
|
+
contractorUuid: e.uuid,
|
|
22
|
+
paymentMethod: p(
|
|
23
|
+
e.paymentMethod ?? "Direct Deposit",
|
|
24
|
+
u
|
|
25
|
+
),
|
|
26
|
+
wage: "0",
|
|
27
|
+
hours: "0",
|
|
28
|
+
bonus: "0",
|
|
29
|
+
reimbursement: "0",
|
|
30
|
+
isTouched: !1
|
|
31
|
+
};
|
|
32
|
+
})
|
|
33
|
+
), w = U(
|
|
29
34
|
() => i.reduce(
|
|
30
35
|
(e, t) => {
|
|
31
|
-
const o =
|
|
36
|
+
const o = n.find((P) => P.uuid === t.contractorUuid), r = o?.wageType === "Hourly", s = Number(t.hours || "0"), N = Number(t.wage || "0"), a = Number(t.bonus || "0"), b = Number(t.reimbursement || "0"), D = r ? s * Number(o.hourlyRate || "0") : 0, d = r ? 0 : N;
|
|
32
37
|
return {
|
|
33
|
-
wage: e.wage +
|
|
38
|
+
wage: e.wage + d,
|
|
34
39
|
bonus: e.bonus + a,
|
|
35
40
|
reimbursement: e.reimbursement + b,
|
|
36
|
-
total: e.total +
|
|
41
|
+
total: e.total + D + d + a + b
|
|
37
42
|
};
|
|
38
43
|
},
|
|
39
44
|
{ wage: 0, bonus: 0, reimbursement: 0, total: 0 }
|
|
40
45
|
),
|
|
41
|
-
[i,
|
|
42
|
-
), c =
|
|
43
|
-
resolver:
|
|
46
|
+
[i, n]
|
|
47
|
+
), c = v({
|
|
48
|
+
resolver: S(T()),
|
|
44
49
|
defaultValues: {
|
|
45
50
|
wageType: "Hourly",
|
|
46
51
|
hours: 0,
|
|
@@ -55,14 +60,14 @@ function O({
|
|
|
55
60
|
});
|
|
56
61
|
return {
|
|
57
62
|
virtualContractorPayments: i,
|
|
58
|
-
totals:
|
|
63
|
+
totals: w,
|
|
59
64
|
editModal: {
|
|
60
65
|
isOpen: f,
|
|
61
66
|
formMethods: c,
|
|
62
67
|
open: (e) => {
|
|
63
|
-
const t =
|
|
68
|
+
const t = n.find((s) => s.uuid === e), o = i.find(
|
|
64
69
|
(s) => s.contractorUuid === e
|
|
65
|
-
),
|
|
70
|
+
), r = p(
|
|
66
71
|
o?.paymentMethod || "Direct Deposit",
|
|
67
72
|
u
|
|
68
73
|
);
|
|
@@ -73,13 +78,13 @@ function O({
|
|
|
73
78
|
wage: Number(o?.wage || "0"),
|
|
74
79
|
bonus: Number(o?.bonus || "0"),
|
|
75
80
|
reimbursement: Number(o?.reimbursement || "0"),
|
|
76
|
-
paymentMethod:
|
|
81
|
+
paymentMethod: r,
|
|
77
82
|
hourlyRate: Number(t?.hourlyRate || "0"),
|
|
78
83
|
contractorUuid: e,
|
|
79
84
|
contractorPaymentMethod: t?.paymentMethod ?? void 0
|
|
80
85
|
},
|
|
81
86
|
{ keepDirty: !1, keepValues: !1 }
|
|
82
|
-
), m(!0),
|
|
87
|
+
), m(!0), y?.();
|
|
83
88
|
},
|
|
84
89
|
close: () => {
|
|
85
90
|
m(!1);
|
|
@@ -93,17 +98,17 @@ function O({
|
|
|
93
98
|
return;
|
|
94
99
|
}
|
|
95
100
|
const t = (e.wage ?? 0) > 0 || (e.hours ?? 0) > 0 || (e.bonus ?? 0) > 0 || (e.reimbursement ?? 0) > 0;
|
|
96
|
-
|
|
101
|
+
M(
|
|
97
102
|
(o) => o.map(
|
|
98
|
-
(
|
|
99
|
-
contractorUuid:
|
|
103
|
+
(r) => r.contractorUuid === e.contractorUuid ? {
|
|
104
|
+
contractorUuid: r.contractorUuid,
|
|
100
105
|
wage: String(e.wage ?? 0),
|
|
101
106
|
hours: String(e.hours ?? 0),
|
|
102
107
|
bonus: String(e.bonus ?? 0),
|
|
103
108
|
reimbursement: String(e.reimbursement ?? 0),
|
|
104
109
|
paymentMethod: e.paymentMethod,
|
|
105
110
|
isTouched: t
|
|
106
|
-
} :
|
|
111
|
+
} : r
|
|
107
112
|
)
|
|
108
113
|
), m(!1), g?.(e);
|
|
109
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaymentAmountsEditor.js","sources":["../../../../../src/components/Contractor/Payments/shared/usePaymentAmountsEditor.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type {\n PostV1CompaniesCompanyIdContractorPaymentGroupsContractorPayments as ContractorPayments,\n PostV1CompaniesCompanyIdContractorPaymentGroupsPaymentMethod as ContractorPaymentMethod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidcontractorpaymentgroups'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport {\n createEditContractorPaymentFormSchema,\n type EditContractorPaymentFormValues,\n} from './SetPaymentAmounts/EditContractorPaymentFormSchema'\n\n/** @internal */\nexport interface UsePaymentAmountsEditorParams {\n contractors: Contractor[]\n allowedPaymentMethods: ContractorPaymentMethod[]\n onEditOpen?: () => void\n onEditSave?: (data: EditContractorPaymentFormValues) => void\n}\n\n/** @internal */\nexport interface UsePaymentAmountsEditorReturn {\n virtualContractorPayments: (ContractorPayments & { isTouched: boolean })[]\n totals: { wage: number; bonus: number; reimbursement: number; total: number }\n editModal: {\n isOpen: boolean\n formMethods: ReturnType<typeof useForm<EditContractorPaymentFormValues>>\n open: (contractorUuid: string) => void\n close: () => void\n submit: (data: EditContractorPaymentFormValues) => void\n }\n}\n\nfunction sanitizePaymentMethod(\n rawPaymentMethod: string | undefined,\n allowedPaymentMethods: ContractorPaymentMethod[],\n): ContractorPaymentMethod {\n return allowedPaymentMethods.includes(rawPaymentMethod as ContractorPaymentMethod)\n ? (rawPaymentMethod as ContractorPaymentMethod)\n : (allowedPaymentMethods[0] ?? 'Check')\n}\n\n/** @internal */\nexport function usePaymentAmountsEditor({\n contractors,\n allowedPaymentMethods,\n onEditOpen,\n onEditSave,\n}: UsePaymentAmountsEditorParams): UsePaymentAmountsEditorReturn {\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const initialContractorPayments: (ContractorPayments & { isTouched: boolean })[] = useMemo(\n () =>\n contractors.map(contractor => ({\n contractorUuid: contractor.uuid,\n paymentMethod: sanitizePaymentMethod(\n contractor.paymentMethod ?? 'Direct Deposit',\n allowedPaymentMethods,\n ),\n wage: '0',\n hours: '0',\n bonus: '0',\n reimbursement: '0',\n isTouched: false,\n })),\n [contractors, allowedPaymentMethods],\n )\n\n const [virtualContractorPayments, setVirtualContractorPayments] =\n useState(initialContractorPayments)\n\n const totals = useMemo(\n () =>\n virtualContractorPayments.reduce(\n (acc, payment) => {\n const contractor = contractors.find(c => c.uuid === payment.contractorUuid)\n const isHourly = contractor?.wageType === 'Hourly'\n const hours = Number(payment.hours || '0')\n const wage = Number(payment.wage || '0')\n const bonus = Number(payment.bonus || '0')\n const reimbursement = Number(payment.reimbursement || '0')\n const hourlyAmount = isHourly ? hours * Number(contractor.hourlyRate || '0') : 0\n const fixedWage = isHourly ? 0 : wage\n\n return {\n wage: acc.wage + fixedWage,\n bonus: acc.bonus + bonus,\n reimbursement: acc.reimbursement + reimbursement,\n total: acc.total + hourlyAmount + fixedWage + bonus + reimbursement,\n }\n },\n { wage: 0, bonus: 0, reimbursement: 0, total: 0 },\n ),\n [virtualContractorPayments, contractors],\n )\n\n const formMethods = useForm<EditContractorPaymentFormValues>({\n resolver: zodResolver(createEditContractorPaymentFormSchema()),\n defaultValues: {\n wageType: 'Hourly',\n hours: 0,\n wage: 0,\n bonus: 0,\n reimbursement: 0,\n paymentMethod: 'Direct Deposit',\n hourlyRate: 0,\n contractorUuid: '',\n contractorPaymentMethod: undefined,\n },\n })\n\n const close = () => {\n setIsModalOpen(false)\n }\n\n const open = (contractorUuid: string) => {\n const contractor = contractors.find(c => c.uuid === contractorUuid)\n const contractorPayment = virtualContractorPayments.find(\n p => p.contractorUuid === contractorUuid,\n )\n\n const sanitizedPaymentMethod = sanitizePaymentMethod(\n contractorPayment?.paymentMethod || 'Direct Deposit',\n allowedPaymentMethods,\n )\n\n formMethods.reset(\n {\n wageType: contractor?.wageType || 'Hourly',\n hours: Number(contractorPayment?.hours || '0'),\n wage: Number(contractorPayment?.wage || '0'),\n bonus: Number(contractorPayment?.bonus || '0'),\n reimbursement: Number(contractorPayment?.reimbursement || '0'),\n paymentMethod: sanitizedPaymentMethod,\n hourlyRate: Number(contractor?.hourlyRate || '0'),\n contractorUuid: contractorUuid,\n contractorPaymentMethod: contractor?.paymentMethod ?? undefined,\n },\n { keepDirty: false, keepValues: false },\n )\n setIsModalOpen(true)\n onEditOpen?.()\n }\n\n const submit = (data: EditContractorPaymentFormValues) => {\n if (!allowedPaymentMethods.includes(data.paymentMethod)) {\n formMethods.setError('paymentMethod', {\n type: 'manual',\n message: 'unsupportedPaymentMethod',\n })\n return\n }\n\n const hasAnyPayment =\n (data.wage ?? 0) > 0 ||\n (data.hours ?? 0) > 0 ||\n (data.bonus ?? 0) > 0 ||\n (data.reimbursement ?? 0) > 0\n\n setVirtualContractorPayments(prev =>\n prev.map(payment =>\n payment.contractorUuid === data.contractorUuid\n ? {\n contractorUuid: payment.contractorUuid,\n wage: String(data.wage ?? 0),\n hours: String(data.hours ?? 0),\n bonus: String(data.bonus ?? 0),\n reimbursement: String(data.reimbursement ?? 0),\n paymentMethod: data.paymentMethod,\n isTouched: hasAnyPayment,\n }\n : payment,\n ),\n )\n\n setIsModalOpen(false)\n onEditSave?.(data)\n }\n\n return {\n virtualContractorPayments,\n totals,\n editModal: {\n isOpen: isModalOpen,\n formMethods,\n open,\n close,\n submit,\n },\n }\n}\n"],"names":["sanitizePaymentMethod","rawPaymentMethod","allowedPaymentMethods","usePaymentAmountsEditor","contractors","onEditOpen","onEditSave","isModalOpen","setIsModalOpen","useState","initialContractorPayments","useMemo","contractor","virtualContractorPayments","setVirtualContractorPayments","totals","acc","payment","c","isHourly","hours","wage","bonus","reimbursement","hourlyAmount","fixedWage","formMethods","useForm","zodResolver","createEditContractorPaymentFormSchema","contractorUuid","contractorPayment","p","sanitizedPaymentMethod","data","hasAnyPayment","prev"],"mappings":";;;;AAkCA,SAASA,EACPC,GACAC,GACyB;AACzB,SAAOA,EAAsB,SAASD,CAA2C,IAC5EA,IACAC,EAAsB,CAAC,KAAK;AACnC;AAGO,SAASC,EAAwB;AAAA,EACtC,aAAAC;AAAA,EACA,uBAAAF;AAAA,EACA,YAAAG;AAAA,EACA,YAAAC;AACF,GAAiE;AAC/D,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAA6EC;AAAA,IACjF,MACEP,EAAY,IAAI,CAAAQ,OAAe;AAAA,MAC7B,gBAAgBA,EAAW;AAAA,MAC3B,eAAeZ;AAAA,QACbY,EAAW,iBAAiB;AAAA,QAC5BV;AAAA,MAAA;AAAA,MAEF,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,MACP,eAA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;AAAA,cACxB,MAAM,OAAOiB,EAAK,QAAQ,CAAC;AAAA,cAC3B,OAAO,OAAOA,EAAK,SAAS,CAAC;AAAA,cAC7B,OAAO,OAAOA,EAAK,SAAS,CAAC;AAAA,cAC7B,eAAe,OAAOA,EAAK,iBAAiB,CAAC;AAAA,cAC7C,eAAeA,EAAK;AAAA,cACpB,WAAWC;AAAA,YAAA,IAEblB;AAAA,UAAA;AAAA,QACN,GAGFT,EAAe,EAAK,GACpBF,IAAa4B,CAAI;AAAA,MACnB;AAAA,IAUI;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"usePaymentAmountsEditor.js","sources":["../../../../../src/components/Contractor/Payments/shared/usePaymentAmountsEditor.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type {\n PostV1CompaniesCompanyIdContractorPaymentGroupsContractorPayments as ContractorPayments,\n PostV1CompaniesCompanyIdContractorPaymentGroupsPaymentMethod as ContractorPaymentMethod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidcontractorpaymentgroups'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport {\n createEditContractorPaymentFormSchema,\n type EditContractorPaymentFormValues,\n} from './SetPaymentAmounts/EditContractorPaymentFormSchema'\n\n/** @internal */\nexport type VirtualContractorPayment = ContractorPayments & { isTouched: boolean }\n\n/** @internal */\nexport interface UsePaymentAmountsEditorParams {\n contractors: Contractor[]\n allowedPaymentMethods: ContractorPaymentMethod[]\n /**\n * Payments to seed state with instead of the zeroed default, keyed by `contractorUuid`.\n * Contractors without a matching entry still get the zeroed default. Pass the previous\n * `virtualContractorPayments` here to survive this hook's owner unmounting and remounting\n * (e.g. a \"Back\" button that swaps the amounts screen out for another screen and back).\n */\n preservedContractorPayments?: VirtualContractorPayment[]\n onEditOpen?: () => void\n onEditSave?: (data: EditContractorPaymentFormValues) => void\n}\n\n/** @internal */\nexport interface UsePaymentAmountsEditorReturn {\n virtualContractorPayments: VirtualContractorPayment[]\n totals: { wage: number; bonus: number; reimbursement: number; total: number }\n editModal: {\n isOpen: boolean\n formMethods: ReturnType<typeof useForm<EditContractorPaymentFormValues>>\n open: (contractorUuid: string) => void\n close: () => void\n submit: (data: EditContractorPaymentFormValues) => void\n }\n}\n\nfunction sanitizePaymentMethod(\n rawPaymentMethod: string | undefined,\n allowedPaymentMethods: ContractorPaymentMethod[],\n): ContractorPaymentMethod {\n return allowedPaymentMethods.includes(rawPaymentMethod as ContractorPaymentMethod)\n ? (rawPaymentMethod as ContractorPaymentMethod)\n : (allowedPaymentMethods[0] ?? 'Check')\n}\n\n/** @internal */\nexport function usePaymentAmountsEditor({\n contractors,\n allowedPaymentMethods,\n preservedContractorPayments,\n onEditOpen,\n onEditSave,\n}: UsePaymentAmountsEditorParams): UsePaymentAmountsEditorReturn {\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const [virtualContractorPayments, setVirtualContractorPayments] = useState<\n VirtualContractorPayment[]\n >(() =>\n contractors.map(contractor => {\n const preserved = preservedContractorPayments?.find(\n payment => payment.contractorUuid === contractor.uuid,\n )\n if (preserved) return preserved\n\n return {\n contractorUuid: contractor.uuid,\n paymentMethod: sanitizePaymentMethod(\n contractor.paymentMethod ?? 'Direct Deposit',\n allowedPaymentMethods,\n ),\n wage: '0',\n hours: '0',\n bonus: '0',\n reimbursement: '0',\n isTouched: false,\n }\n }),\n )\n\n const totals = useMemo(\n () =>\n virtualContractorPayments.reduce(\n (acc, payment) => {\n const contractor = contractors.find(c => c.uuid === payment.contractorUuid)\n const isHourly = contractor?.wageType === 'Hourly'\n const hours = Number(payment.hours || '0')\n const wage = Number(payment.wage || '0')\n const bonus = Number(payment.bonus || '0')\n const reimbursement = Number(payment.reimbursement || '0')\n const hourlyAmount = isHourly ? hours * Number(contractor.hourlyRate || '0') : 0\n const fixedWage = isHourly ? 0 : wage\n\n return {\n wage: acc.wage + fixedWage,\n bonus: acc.bonus + bonus,\n reimbursement: acc.reimbursement + reimbursement,\n total: acc.total + hourlyAmount + fixedWage + bonus + reimbursement,\n }\n },\n { wage: 0, bonus: 0, reimbursement: 0, total: 0 },\n ),\n [virtualContractorPayments, contractors],\n )\n\n const formMethods = useForm<EditContractorPaymentFormValues>({\n resolver: zodResolver(createEditContractorPaymentFormSchema()),\n defaultValues: {\n wageType: 'Hourly',\n hours: 0,\n wage: 0,\n bonus: 0,\n reimbursement: 0,\n paymentMethod: 'Direct Deposit',\n hourlyRate: 0,\n contractorUuid: '',\n contractorPaymentMethod: undefined,\n },\n })\n\n const close = () => {\n setIsModalOpen(false)\n }\n\n const open = (contractorUuid: string) => {\n const contractor = contractors.find(c => c.uuid === contractorUuid)\n const contractorPayment = virtualContractorPayments.find(\n p => p.contractorUuid === contractorUuid,\n )\n\n const sanitizedPaymentMethod = sanitizePaymentMethod(\n contractorPayment?.paymentMethod || 'Direct Deposit',\n allowedPaymentMethods,\n )\n\n formMethods.reset(\n {\n wageType: contractor?.wageType || 'Hourly',\n hours: Number(contractorPayment?.hours || '0'),\n wage: Number(contractorPayment?.wage || '0'),\n bonus: Number(contractorPayment?.bonus || '0'),\n reimbursement: Number(contractorPayment?.reimbursement || '0'),\n paymentMethod: sanitizedPaymentMethod,\n hourlyRate: Number(contractor?.hourlyRate || '0'),\n contractorUuid: contractorUuid,\n contractorPaymentMethod: contractor?.paymentMethod ?? undefined,\n },\n { keepDirty: false, keepValues: false },\n )\n setIsModalOpen(true)\n onEditOpen?.()\n }\n\n const submit = (data: EditContractorPaymentFormValues) => {\n if (!allowedPaymentMethods.includes(data.paymentMethod)) {\n formMethods.setError('paymentMethod', {\n type: 'manual',\n message: 'unsupportedPaymentMethod',\n })\n return\n }\n\n const hasAnyPayment =\n (data.wage ?? 0) > 0 ||\n (data.hours ?? 0) > 0 ||\n (data.bonus ?? 0) > 0 ||\n (data.reimbursement ?? 0) > 0\n\n setVirtualContractorPayments(prev =>\n prev.map(payment =>\n payment.contractorUuid === data.contractorUuid\n ? {\n contractorUuid: payment.contractorUuid,\n wage: String(data.wage ?? 0),\n hours: String(data.hours ?? 0),\n bonus: String(data.bonus ?? 0),\n reimbursement: String(data.reimbursement ?? 0),\n paymentMethod: data.paymentMethod,\n isTouched: hasAnyPayment,\n }\n : payment,\n ),\n )\n\n setIsModalOpen(false)\n onEditSave?.(data)\n }\n\n return {\n virtualContractorPayments,\n totals,\n editModal: {\n isOpen: isModalOpen,\n formMethods,\n open,\n close,\n submit,\n },\n }\n}\n"],"names":["sanitizePaymentMethod","rawPaymentMethod","allowedPaymentMethods","usePaymentAmountsEditor","contractors","preservedContractorPayments","onEditOpen","onEditSave","isModalOpen","setIsModalOpen","useState","virtualContractorPayments","setVirtualContractorPayments","contractor","preserved","payment","totals","useMemo","acc","c","isHourly","hours","wage","bonus","reimbursement","hourlyAmount","fixedWage","formMethods","useForm","zodResolver","createEditContractorPaymentFormSchema","contractorUuid","contractorPayment","p","sanitizedPaymentMethod","data","hasAnyPayment","prev"],"mappings":";;;;AA4CA,SAASA,EACPC,GACAC,GACyB;AACzB,SAAOA,EAAsB,SAASD,CAA2C,IAC5EA,IACAC,EAAsB,CAAC,KAAK;AACnC;AAGO,SAASC,EAAwB;AAAA,EACtC,aAAAC;AAAA,EACA,uBAAAF;AAAA,EACA,6BAAAG;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACF,GAAiE;AAC/D,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9C,CAACC,GAA2BC,CAA4B,IAAIF;AAAA,IAEhE,MACAN,EAAY,IAAI,CAAAS,MAAc;AAC5B,YAAMC,IAAYT,GAA6B;AAAA,QAC7C,CAAAU,MAAWA,EAAQ,mBAAmBF,EAAW;AAAA,MAAA;AAEnD,aAAIC,KAEG;AAAA,QACL,gBAAgBD,EAAW;AAAA,QAC3B,eAAeb;AAAA,UACba,EAAW,iBAAiB;AAAA,UAC5BX;AAAA,QAAA;AAAA,QAEF,MAAM;AAAA,Q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B,EAAK,QAAQ,CAAC;AAAA,cAC3B,OAAO,OAAOA,EAAK,SAAS,CAAC;AAAA,cAC7B,OAAO,OAAOA,EAAK,SAAS,CAAC;AAAA,cAC7B,eAAe,OAAOA,EAAK,iBAAiB,CAAC;AAAA,cAC7C,eAAeA,EAAK;AAAA,cACpB,WAAWC;AAAA,YAAA,IAEbrB;AAAA,UAAA;AAAA,QACN,GAGFN,EAAe,EAAK,GACpBF,IAAa4B,CAAI;AAAA,MACnB;AAAA,IAUI;AAAA,EACF;AAEJ;"}
|
|
@@ -12,6 +12,7 @@ export type { CompensationProps, CompensationCardProps, CompensationEditFormProp
|
|
|
12
12
|
export { DocumentsCard, type DocumentsCardProps } from '../Documents/management';
|
|
13
13
|
export { PaymentFlow, type PaymentFlowProps } from '../Payments/PaymentFlow';
|
|
14
14
|
export { CreatePaymentFlow, type CreatePaymentFlowProps } from '../Payments/CreatePaymentFlow';
|
|
15
|
+
export { HistoricalPaymentFlow, type HistoricalPaymentFlowProps, } from '../Payments/HistoricalPaymentFlow';
|
|
15
16
|
export { ViewPaymentFlow, type ViewPaymentFlowProps } from '../Payments/ViewPaymentFlow';
|
|
16
17
|
export { PaymentsList, type PaymentsListProps } from '../Payments/PaymentsList/PaymentsList';
|
|
17
18
|
export { CreatePayment, type CreatePaymentProps } from '../Payments/CreatePayment/CreatePayment';
|
|
@@ -2,54 +2,56 @@ import { ManagementContractorList as t } from "../ContractorList/management/Mana
|
|
|
2
2
|
import { PaymentsList as m } from "../Payments/PaymentsList/PaymentsList.js";
|
|
3
3
|
import { CreatePayment as f } from "../Payments/CreatePayment/CreatePayment.js";
|
|
4
4
|
import { PaymentHistory as x } from "../Payments/PaymentHistory/PaymentHistory.js";
|
|
5
|
-
import { PaymentStatement as
|
|
6
|
-
import { Address as
|
|
5
|
+
import { PaymentStatement as i } from "../Payments/PaymentStatement/PaymentStatement.js";
|
|
6
|
+
import { Address as d } from "../Address/management/Address.js";
|
|
7
7
|
import { AddressCard as P } from "../Address/management/AddressCard/AddressCard.js";
|
|
8
8
|
import { AddressEditForm as l } from "../Address/management/AddressEditForm.js";
|
|
9
9
|
import { Compensation as c } from "../Compensation/management/Compensation.js";
|
|
10
|
-
import { CompensationCard as
|
|
11
|
-
import { CompensationEditForm as
|
|
12
|
-
import { CreateHistoricalPayment as
|
|
13
|
-
import { CreatePaymentFlow as
|
|
10
|
+
import { CompensationCard as h } from "../Compensation/management/CompensationCard/CompensationCard.js";
|
|
11
|
+
import { CompensationEditForm as H } from "../Compensation/management/CompensationEditForm.js";
|
|
12
|
+
import { CreateHistoricalPayment as u } from "../Payments/CreateHistoricalPayment/CreateHistoricalPayment.js";
|
|
13
|
+
import { CreatePaymentFlow as D } from "../Payments/CreatePaymentFlow/CreatePaymentFlow.js";
|
|
14
14
|
import { Dashboard as S } from "../Dashboard/Dashboard.js";
|
|
15
15
|
import { DashboardFlow as g } from "../Dashboard/DashboardFlow.js";
|
|
16
16
|
import { DocumentsCard as j } from "../Documents/management/DocumentsCard/DocumentsCard.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
17
|
+
import { HistoricalPaymentFlow as q } from "../Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.js";
|
|
18
|
+
import { HistoricalPaymentSummary as z } from "../Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js";
|
|
19
|
+
import { PaymentFlow as G } from "../Payments/PaymentFlow/PaymentFlow.js";
|
|
20
|
+
import { PaymentMethod as J } from "../PaymentMethod/management/PaymentMethod.js";
|
|
21
|
+
import { PaymentMethodCard as N } from "../PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.js";
|
|
22
|
+
import { PaymentMethodEditForm as Q } from "../PaymentMethod/management/PaymentMethodEditForm.js";
|
|
23
|
+
import { PaymentSummary as T } from "../Payments/PaymentSummary/PaymentSummary.js";
|
|
24
|
+
import { Profile as W } from "../Profile/management/Profile.js";
|
|
25
|
+
import { ProfileCard as Y } from "../Profile/management/ProfileCard/ProfileCard.js";
|
|
26
|
+
import { ProfileEditForm as _ } from "../Profile/management/ProfileEditForm.js";
|
|
27
|
+
import { ViewPaymentFlow as oo } from "../Payments/ViewPaymentFlow/ViewPaymentFlow.js";
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
d as Address,
|
|
29
30
|
P as AddressCard,
|
|
30
31
|
l as AddressEditForm,
|
|
31
32
|
c as Compensation,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
h as CompensationCard,
|
|
34
|
+
H as CompensationEditForm,
|
|
34
35
|
t as ContractorList,
|
|
35
|
-
|
|
36
|
+
u as CreateHistoricalPayment,
|
|
36
37
|
f as CreatePayment,
|
|
37
|
-
|
|
38
|
+
D as CreatePaymentFlow,
|
|
38
39
|
S as Dashboard,
|
|
39
40
|
g as DashboardFlow,
|
|
40
41
|
j as DocumentsCard,
|
|
41
|
-
q as
|
|
42
|
-
z as
|
|
42
|
+
q as HistoricalPaymentFlow,
|
|
43
|
+
z as HistoricalPaymentSummary,
|
|
44
|
+
G as PaymentFlow,
|
|
43
45
|
x as PaymentHistory,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
J as PaymentMethod,
|
|
47
|
+
N as PaymentMethodCard,
|
|
48
|
+
Q as PaymentMethodEditForm,
|
|
49
|
+
i as PaymentStatement,
|
|
50
|
+
T as PaymentSummary,
|
|
49
51
|
m as PaymentsList,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
W as Profile,
|
|
53
|
+
Y as ProfileCard,
|
|
54
|
+
_ as ProfileEditForm,
|
|
55
|
+
oo as ViewPaymentFlow
|
|
54
56
|
};
|
|
55
57
|
//# sourceMappingURL=contractorManagement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractorManagement.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contractorManagement.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|