@zeniai/client-epic-state 5.2.69 → 5.2.70
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/lib/entity/actualMatching/actualMatchingReducer.d.ts +1 -3
- package/lib/entity/actualMatching/actualMatchingReducer.js +2 -11
- package/lib/entity/aiCfo/aiCfoState.d.ts +2 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/invoicing/plan/planPayload.d.ts +40 -0
- package/lib/entity/invoicing/plan/planPayload.js +51 -0
- package/lib/entity/invoicing/plan/planReducer.d.ts +14 -0
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +21 -20
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.d.ts → plan/planSelector.d.ts} +6 -5
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +12 -12
- package/lib/entity/invoicing/plan/planState.d.ts +43 -0
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.d.ts → product/productPayload.d.ts} +6 -44
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +6 -50
- package/lib/entity/invoicing/product/productReducer.d.ts +9 -0
- package/lib/entity/invoicing/product/productReducer.js +50 -0
- package/lib/entity/invoicing/product/productSelector.d.ts +4 -0
- package/lib/entity/invoicing/product/productSelector.js +17 -0
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.d.ts → product/productState.d.ts} +6 -42
- package/lib/entity/invoicing/product/productState.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
- package/lib/epic.d.ts +2 -4
- package/lib/epic.js +1 -5
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -9
- package/lib/esm/entity/invoicing/plan/planPayload.js +47 -0
- package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +20 -19
- package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +8 -8
- package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +3 -46
- package/lib/esm/entity/invoicing/product/productReducer.js +43 -0
- package/lib/esm/entity/invoicing/product/productSelector.js +10 -0
- package/lib/esm/entity/invoicing/product/productState.js +1 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
- package/lib/esm/epic.js +1 -5
- package/lib/esm/index.js +11 -9
- package/lib/esm/reducer.js +7 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +13 -26
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +23 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +38 -89
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -66
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -15
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +1 -9
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +1 -5
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
- package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +1 -8
- package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
- package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +4 -4
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +9 -18
- package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +1 -21
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/index.d.ts +16 -13
- package/lib/index.js +60 -65
- package/lib/reducer.d.ts +2 -1
- package/lib/reducer.js +7 -4
- package/lib/rootStateTypes.d.ts +5 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +1 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +11 -24
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +22 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +1 -12
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +8 -19
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +39 -90
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +8 -20
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +4 -7
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -69
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +4 -20
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +1 -18
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -3
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +0 -8
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +9 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +4 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.d.ts +3 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +3 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +2 -6
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
- package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +1 -3
- package/lib/view/invoicing/invoiceList/invoiceListReducer.js +2 -9
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewPayload.d.ts +3 -3
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +5 -4
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +4 -4
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +3 -12
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +8 -17
- package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +5 -5
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -22
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +5 -5
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +2 -2
- package/package.json +1 -1
- package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +0 -12
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -50
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -37
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +0 -10
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -54
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +0 -8
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -41
- /package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
- /package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInvoicingBrandingFormView = exports.getInvoicingQboSettingsFormView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = void 0;
|
|
4
4
|
exports.deriveInvoicingEnablePrerequisites = deriveInvoicingEnablePrerequisites;
|
|
5
5
|
const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
|
|
6
|
-
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
7
6
|
const fileSelector_1 = require("../../../entity/file/fileSelector");
|
|
8
7
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
9
8
|
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
@@ -127,7 +126,6 @@ const getInvoicingQboSettingsFormView = (state) => {
|
|
|
127
126
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
128
127
|
accountMappingKindOptions: qboAccountMappingKindOptions,
|
|
129
128
|
accounts: qboView.accounts,
|
|
130
|
-
savedLocalData: (0, invoicingQboSettingsFormConfig_1.entityToInvoicingQboSettingsLocalData)(settings?.qbo),
|
|
131
129
|
backfillState: qboView.backfillState,
|
|
132
130
|
connection: qboView.connection,
|
|
133
131
|
configFetchState,
|
|
@@ -154,27 +152,20 @@ const getInvoicingQboSettingsFormView = (state) => {
|
|
|
154
152
|
exports.getInvoicingQboSettingsFormView = getInvoicingQboSettingsFormView;
|
|
155
153
|
/**
|
|
156
154
|
* Bundled view for the branding settings form: the draft `localData` (seeded
|
|
157
|
-
* from the existing settings until the user edits), the business
|
|
158
|
-
*
|
|
155
|
+
* from the existing settings until the user edits), the business-address label
|
|
156
|
+
* (from the shared Address screen, seeded on load from `address_id`), the raw
|
|
157
|
+
* settings (for the logo/preview), the backend date-format choices and the
|
|
159
158
|
* save fetch state.
|
|
160
|
-
*
|
|
161
|
-
* The address is resolved here rather than read from the Address screen's
|
|
162
|
-
* staging store alone: that store is only seeded when settings are fetched, and
|
|
163
|
-
* returning to this page does not refetch, so a saved address would otherwise
|
|
164
|
-
* have no way to reach the screen.
|
|
165
159
|
*/
|
|
166
160
|
const getInvoicingBrandingFormView = (state) => {
|
|
167
161
|
const { brandingDraft, saveFetchState, settings } = state.invoicingSettingsViewState;
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
? (0, addressSelector_1.getAddressByAddressId)(state.addressState, savedAddressId)
|
|
173
|
-
: undefined);
|
|
162
|
+
const newAddress = state.addressViewState.newAddressState?.[invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE];
|
|
163
|
+
const addressLabel = newAddress?.addressToCreate != null
|
|
164
|
+
? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
|
|
165
|
+
: undefined;
|
|
174
166
|
return {
|
|
175
167
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
176
|
-
|
|
177
|
-
addressLabel: address != null ? (0, addressViewSelector_1.getFormattedAddress)(address) : undefined,
|
|
168
|
+
addressLabel,
|
|
178
169
|
dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
|
|
179
170
|
localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
|
|
180
171
|
saveState: saveFetchState,
|
|
@@ -4,7 +4,6 @@ exports.submitInvoicingBrandingFormEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
|
-
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
8
7
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
9
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
10
9
|
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
@@ -20,11 +19,7 @@ const submitInvoicingBrandingFormEpic = (actions$, state$, zeniAPI) => actions$.
|
|
|
20
19
|
const state = state$.value;
|
|
21
20
|
const { brandingDraft, settings } = state.invoicingSettingsViewState;
|
|
22
21
|
const localData = brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings);
|
|
23
|
-
const
|
|
24
|
-
const address = state.addressViewState.newAddressState?.[invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE]?.addressToCreate ??
|
|
25
|
-
(savedAddressId != null
|
|
26
|
-
? (0, addressSelector_1.getAddressByAddressId)(state.addressState, savedAddressId)
|
|
27
|
-
: undefined);
|
|
22
|
+
const address = state.addressViewState.newAddressState?.[invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE]?.addressToCreate;
|
|
28
23
|
const data = (0, invoicingBrandingFormConfig_1.brandingLocalDataToSettingsPayload)(localData, address);
|
|
29
24
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings`;
|
|
30
25
|
return zeniAPI
|
|
@@ -45,11 +40,7 @@ const submitInvoicingBrandingFormEpic = (actions$, state$, zeniAPI) => actions$.
|
|
|
45
40
|
? [(0, fileReducer_1.updateFiles)({ files: [savedLogoFile] })]
|
|
46
41
|
: []),
|
|
47
42
|
(0, settingsViewReducer_1.saveInvoicingSettingsSuccess)(response.data),
|
|
48
|
-
|
|
49
|
-
? [
|
|
50
|
-
(0, addressViewReducer_1.resetNewAddressDataInLocalStore)(invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE),
|
|
51
|
-
]
|
|
52
|
-
: []),
|
|
43
|
+
(0, addressViewReducer_1.resetNewAddressDataInLocalStore)(invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE),
|
|
53
44
|
];
|
|
54
45
|
}
|
|
55
46
|
return (0, rxjs_1.of)((0, settingsViewReducer_1.saveInvoicingSettingsFailure)(response.status));
|
|
@@ -19,7 +19,7 @@ const updateBusinessVerificationDetailsEpic_1 = require("../../../../spendManage
|
|
|
19
19
|
const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewReducer");
|
|
20
20
|
const onboardingCustomerViewSelector_1 = require("../../onboardingCustomerViewSelector");
|
|
21
21
|
const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.updateOnboardingCustomerView.match), (0, operators_1.mergeMap)((action) => {
|
|
22
|
-
const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate,
|
|
22
|
+
const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, } = action.payload;
|
|
23
23
|
const { onboardingCustomerViewState } = state$.value;
|
|
24
24
|
const { companyDetails, primaryContactDetails, companyOfficerUpdateStatus, currentStep, currentSubStep, } = onboardingCustomerViewState;
|
|
25
25
|
const companyLocalData = companyDetails.localData;
|
|
@@ -31,17 +31,12 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
31
31
|
}
|
|
32
32
|
const { newAddressState } = state$.value.addressViewState;
|
|
33
33
|
let payload = {};
|
|
34
|
-
const isSetupBillingSave = isBillingAddressUpdate === true || businessProfile != null;
|
|
35
34
|
if (companyLocalData != null) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
: undefined;
|
|
40
|
-
if (billingAddressToCreate != null || businessProfile != null) {
|
|
41
|
-
payload = prepareEditBillingAddressPayload(companyLocalData, billingAddressToCreate, businessProfile != null
|
|
42
|
-
? toBusinessProfilePayload(businessProfile, companyView?.company.company.incInfo)
|
|
43
|
-
: {});
|
|
35
|
+
if (isBillingAddressUpdate === true &&
|
|
36
|
+
newAddressState?.subscription_billing_address.addressToCreate != null) {
|
|
37
|
+
payload = prepareEditBillingAddressPayload(companyLocalData, newAddressState.subscription_billing_address.addressToCreate);
|
|
44
38
|
}
|
|
39
|
+
const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, []);
|
|
45
40
|
const companyAddressToCreate = newAddressState?.company_address?.addressToCreate;
|
|
46
41
|
const registeredAddressToCreate = newAddressState?.company_registered_address?.addressToCreate;
|
|
47
42
|
const addressType = officerType
|
|
@@ -64,7 +59,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
64
59
|
// different payloads — currentSubStep is the source of truth here.
|
|
65
60
|
const isOfficerSave = currentStep === 'verification' &&
|
|
66
61
|
currentSubStep === 'company_officer';
|
|
67
|
-
if (isBillingAddressUpdate === false
|
|
62
|
+
if (isBillingAddressUpdate === false) {
|
|
68
63
|
if (isOfficerSave) {
|
|
69
64
|
payload = {
|
|
70
65
|
company: toBusinessVerificationMinimalCompanyDataPayload(companyLocalData),
|
|
@@ -78,7 +73,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
78
73
|
};
|
|
79
74
|
}
|
|
80
75
|
}
|
|
81
|
-
const section =
|
|
76
|
+
const section = isBillingAddressUpdate === true
|
|
82
77
|
? 'setup_billing'
|
|
83
78
|
: isOfficerSave
|
|
84
79
|
? 'company_officer'
|
|
@@ -98,7 +93,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
98
93
|
},
|
|
99
94
|
};
|
|
100
95
|
let messageSection;
|
|
101
|
-
if (
|
|
96
|
+
if (isBillingAddressUpdate === true) {
|
|
102
97
|
messageSection = messageSectionMapper[section].save;
|
|
103
98
|
}
|
|
104
99
|
else if (sendForVerification === true) {
|
|
@@ -182,28 +177,13 @@ const toBusinessVerificationMinimalCompanyDataPayload = (companyLocalData) => {
|
|
|
182
177
|
}
|
|
183
178
|
return company;
|
|
184
179
|
};
|
|
185
|
-
const
|
|
186
|
-
const isIndustryTypeChanged = businessProfile.companyIndustryType !==
|
|
187
|
-
persistedIncInfo?.companyIndustryType;
|
|
188
|
-
return {
|
|
189
|
-
company_business_model: businessProfile.companyBusinessModel,
|
|
190
|
-
company_industry_type: businessProfile.companyIndustryType,
|
|
191
|
-
// A sub-industry kept from the old industry would fail the backend subtype check on the next KYB save.
|
|
192
|
-
...(isIndustryTypeChanged &&
|
|
193
|
-
persistedIncInfo?.companySubIndustry != null && {
|
|
194
|
-
company_industry_sub_type: null,
|
|
195
|
-
}),
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
const prepareEditBillingAddressPayload = (companyDetailsLocalData, address, businessProfilePayload) => {
|
|
180
|
+
const prepareEditBillingAddressPayload = (companyDetailsLocalData, address) => {
|
|
199
181
|
const { syncToken } = companyDetailsLocalData;
|
|
182
|
+
const addressPayload = (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address);
|
|
200
183
|
return {
|
|
201
184
|
company: {
|
|
202
185
|
sync_token: syncToken,
|
|
203
|
-
|
|
204
|
-
subscription_billing_address: (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address),
|
|
205
|
-
}),
|
|
206
|
-
...businessProfilePayload,
|
|
186
|
+
subscription_billing_address: addressPayload,
|
|
207
187
|
},
|
|
208
188
|
};
|
|
209
189
|
};
|
|
@@ -3,7 +3,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
|
|
|
3
3
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
4
4
|
import { CompanyDetailsLocalData, CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
5
5
|
import { PlaidLinkTokenType } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
6
|
-
import { AiAgentsActivationCounts, AiAgentsActivationPhase,
|
|
6
|
+
import { AiAgentsActivationCounts, AiAgentsActivationPhase, OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep, OnboardingSubStep } from './onboardingCustomerViewState';
|
|
7
7
|
export declare const initialState: OnboardingCustomerViewState;
|
|
8
8
|
export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride?: any, reCalculateCurrentStep?: any], {
|
|
9
9
|
companyId: string;
|
|
@@ -29,13 +29,12 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
|
|
|
29
29
|
phases: AiAgentsActivationPhase[];
|
|
30
30
|
}, "onboardingCustomerView/fetchAiAgentsActivationStatusSuccess", never, never>, fetchAiAgentsActivationStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/fetchAiAgentsActivationStatusFailure", never, never>, aiAgentsActivationCountsUpdated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Partial<AiAgentsActivationCounts>], Partial<AiAgentsActivationCounts>, "onboardingCustomerView/aiAgentsActivationCountsUpdated", never, never>, aiAgentsActivationPhaseChanged: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AiAgentsActivationPhase], AiAgentsActivationPhase, "onboardingCustomerView/aiAgentsActivationPhaseChanged", never, never>, updateOnboardingCustomerViewDashboardLoaded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
31
31
|
companyId: string;
|
|
32
|
-
}, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoaded", never, never>, updateOnboardingCustomerViewDashboardLoadedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedSuccess">, updateOnboardingCustomerViewDashboardLoadedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedFailure", never, never>, updateOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, sendForVerification: boolean, reCalculateCurrentStep?: boolean | undefined, isBillingAddressUpdate?: boolean | undefined, officerType?: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined
|
|
32
|
+
}, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoaded", never, never>, updateOnboardingCustomerViewDashboardLoadedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedSuccess">, updateOnboardingCustomerViewDashboardLoadedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedFailure", never, never>, updateOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, sendForVerification: boolean, reCalculateCurrentStep?: boolean | undefined, isBillingAddressUpdate?: boolean | undefined, officerType?: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined], {
|
|
33
33
|
companyId: string;
|
|
34
34
|
sendForVerification: boolean;
|
|
35
35
|
reCalculateCurrentStep: boolean | undefined;
|
|
36
36
|
isBillingAddressUpdate: boolean | undefined;
|
|
37
37
|
officerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined;
|
|
38
|
-
businessProfile: OnboardingBusinessProfileUpdate | undefined;
|
|
39
38
|
}, "onboardingCustomerView/updateOnboardingCustomerView", never, never>, updateOnboardingCustomerViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewSuccess">, updateOnboardingCustomerViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewFailure", never, never>, updateOnboardingPaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
40
39
|
verificationStatusCode: string;
|
|
41
40
|
paymentAccountId: string;
|
|
@@ -528,7 +528,7 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
|
|
|
528
528
|
reducer(draft) {
|
|
529
529
|
draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
|
|
530
530
|
},
|
|
531
|
-
prepare(companyId, sendForVerification, reCalculateCurrentStep, isBillingAddressUpdate, officerType
|
|
531
|
+
prepare(companyId, sendForVerification, reCalculateCurrentStep, isBillingAddressUpdate, officerType) {
|
|
532
532
|
return {
|
|
533
533
|
payload: {
|
|
534
534
|
companyId,
|
|
@@ -536,7 +536,6 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
|
|
|
536
536
|
reCalculateCurrentStep,
|
|
537
537
|
isBillingAddressUpdate,
|
|
538
538
|
officerType,
|
|
539
|
-
businessProfile,
|
|
540
539
|
},
|
|
541
540
|
};
|
|
542
541
|
},
|
|
@@ -20,10 +20,6 @@ export type OnboardingSubStep = ReturnType<typeof toOnboardingSubStepType>;
|
|
|
20
20
|
* Onboarding Custiner View Local Data - Intefaces
|
|
21
21
|
*/
|
|
22
22
|
export type OnboardingCustomerViewLocalData = SetupViewLocalData;
|
|
23
|
-
export interface OnboardingBusinessProfileUpdate {
|
|
24
|
-
companyBusinessModel: string;
|
|
25
|
-
companyIndustryType: string;
|
|
26
|
-
}
|
|
27
23
|
export interface OnboardingCustomerViewUIState {
|
|
28
24
|
isCardPaymentPopupOpen: boolean;
|
|
29
25
|
isQBOPopupOpen: boolean;
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "vendor" | "status" | "class" | "createTime" | "amount" | "memo" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "vendor" | "status" | "class" | "createTime" | "amount" | "memo" | "user" | "balanceAsOfToday" | "transactionType" | "scheduleCategory" | "startMonth" | "transactionDate" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth" | "assetId";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -10,18 +10,18 @@ export declare const fetchBillList: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
10
10
|
isShowDeletedBillsEnabled: boolean;
|
|
11
11
|
isBulkActionCompleteRefresh: any;
|
|
12
12
|
isInternationalWireEnabled: boolean;
|
|
13
|
-
}, "billList/fetchBillList", never, never>, fetchBillListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "
|
|
13
|
+
}, "billList/fetchBillList", never, never>, fetchBillListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedBillsEnabled: boolean], {
|
|
14
14
|
period: TimePeriod;
|
|
15
|
-
tab: "
|
|
15
|
+
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
16
16
|
isShowDeletedBillsEnabled: boolean;
|
|
17
17
|
}, "billList/fetchBillListPerTab", never, never>, updateBillListByStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
18
|
billList: BillListPayload;
|
|
19
19
|
tab: BillTab;
|
|
20
|
-
}, "billList/updateBillListByStatus">, updateBillListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "
|
|
20
|
+
}, "billList/updateBillListByStatus">, updateBillListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
21
21
|
period: TimePeriod;
|
|
22
|
-
tab: "
|
|
22
|
+
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
23
23
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
24
|
-
}, "billList/updateBillListFailure", never, never>, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
24
|
+
}, "billList/updateBillListFailure", never, never>, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "pending_approval" | "scheduled" | "draft", "billList/updateTab">, updateSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"failed" | "deleted" | "cancelled" | "rejected" | "ach" | "wire" | "all" | "overdue" | "awaiting_approval" | "awaiting_my_approval" | "offline", "billList/updateSubTab">, updateSelectedBillId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "billList/updateSelectedBillId">, updateBillDetailSaveBillCode: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<SaveBillStageCode, "billList/updateBillDetailSaveBillCode">, updateBillListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
25
|
period: TimePeriod;
|
|
26
26
|
uiState: Partial<BillListUIState>;
|
|
27
27
|
}, "billList/updateBillListUIState">, updateSearchResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "billList/updateSearchResult">, updateFilterResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -33,7 +33,7 @@ export interface BillListDownloadUIState extends BillListUIState {
|
|
|
33
33
|
}
|
|
34
34
|
export type SaveBillStageCode = 'draft' | 'pending_approval' | undefined;
|
|
35
35
|
export declare const ALL_BILL_TABS: readonly ["paid", "pending_approval", "scheduled", "draft"];
|
|
36
|
-
declare const toBillTabType: (v: string) => "
|
|
36
|
+
declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "scheduled" | "draft";
|
|
37
37
|
export type BillTab = ReturnType<typeof toBillTabType>;
|
|
38
38
|
declare const toBillsSubTabType: (v: string) => "failed" | "deleted" | "cancelled" | "rejected" | "ach" | "wire" | "all" | "overdue" | "awaiting_approval" | "awaiting_my_approval" | "offline";
|
|
39
39
|
export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
|
|
@@ -31,8 +31,8 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
31
31
|
updatesByLineId: Record<string, import("./editBillViewState").LineItemRecommendationsLocalData>;
|
|
32
32
|
}, "editBillView/updateBillLineRecommendationsInLocalStore", never, never>, discardBillUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
33
33
|
billId?: ID;
|
|
34
|
-
}, "editBillView/discardBillUpdatesInLocalStore">, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "
|
|
35
|
-
billStageCode: "
|
|
34
|
+
}, "editBillView/discardBillUpdatesInLocalStore">, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, isApproverMarkingAsPaid: boolean, billId?: string | undefined], {
|
|
35
|
+
billStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
36
36
|
isForMarkAsPaid: boolean;
|
|
37
37
|
isApproverMarkingAsPaid: boolean;
|
|
38
38
|
billId: string | undefined;
|
|
@@ -141,7 +141,7 @@ export declare const getWithdrawFrom: (state: RootState, fromAccountId?: ID, fro
|
|
|
141
141
|
accountId: ID;
|
|
142
142
|
accountType: AccountTypeSubConfigCodeKeyType;
|
|
143
143
|
}) => FundingAccount | undefined;
|
|
144
|
-
export declare const getDefaultWithdrawFromAccount: (state: RootState, companyId: ID, lastSelectedFromAccount?: {
|
|
144
|
+
export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAccounts: ID[], companyId: ID, lastSelectedFromAccount?: {
|
|
145
145
|
accountId: ID;
|
|
146
146
|
accountType: AccountTypeSubConfigCodeKeyType;
|
|
147
147
|
}) => FundingAccount | undefined;
|
|
@@ -640,7 +640,7 @@ const getDueDate = (billStageCode, dueDate, invoiceDate, bookCloseDate) => {
|
|
|
640
640
|
};
|
|
641
641
|
exports.getDueDate = getDueDate;
|
|
642
642
|
const getWithdrawFrom = (state, fromAccountId, fromAccountType, companyId, lastSelectedFromAccount) => {
|
|
643
|
-
const { paymentAccountState, depositAccountState, paymentAccountListState } = state;
|
|
643
|
+
const { paymentAccountState, depositAccountState, depositAccountListState, paymentAccountListState, } = state;
|
|
644
644
|
if (fromAccountId != null) {
|
|
645
645
|
const withdrawFromAsDepositAcc = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, fromAccountId);
|
|
646
646
|
const withdrawFromAsPaymentAcc = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, fromAccountId);
|
|
@@ -654,16 +654,42 @@ const getWithdrawFrom = (state, fromAccountId, fromAccountType, companyId, lastS
|
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
else {
|
|
657
|
-
return (0, exports.getDefaultWithdrawFromAccount)(state, companyId ?? '', lastSelectedFromAccount);
|
|
657
|
+
return (0, exports.getDefaultWithdrawFromAccount)(state, depositAccountListState.accountIds, companyId ?? '', lastSelectedFromAccount);
|
|
658
658
|
}
|
|
659
659
|
return undefined;
|
|
660
660
|
};
|
|
661
661
|
exports.getWithdrawFrom = getWithdrawFrom;
|
|
662
|
-
const getDefaultWithdrawFromAccount = (state, companyId, lastSelectedFromAccount) => {
|
|
662
|
+
const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSelectedFromAccount) => {
|
|
663
663
|
const { depositAccountState, paymentAccountState, paymentAccountListState } = state;
|
|
664
664
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
665
665
|
const primaryAccount = companyView?.company.company.companyBillPayInfo.primaryFundingAccount;
|
|
666
|
-
|
|
666
|
+
let defaultAccount = undefined;
|
|
667
|
+
// User paying bill for first time or previously paid with external account
|
|
668
|
+
if (lastSelectedFromAccount == null ||
|
|
669
|
+
lastSelectedFromAccount?.accountType === 'paymentAccount') {
|
|
670
|
+
if (depositAccounts.length === 0) {
|
|
671
|
+
defaultAccount = primaryAccount;
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
if (primaryAccount?.accountType === 'depositAccount') {
|
|
675
|
+
defaultAccount = primaryAccount;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
else {
|
|
680
|
+
// User paid with Zeni account previously
|
|
681
|
+
if (depositAccounts.length === 1) {
|
|
682
|
+
defaultAccount = lastSelectedFromAccount;
|
|
683
|
+
}
|
|
684
|
+
else {
|
|
685
|
+
if (primaryAccount?.accountType === 'depositAccount') {
|
|
686
|
+
defaultAccount = primaryAccount;
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
defaultAccount = lastSelectedFromAccount;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
667
693
|
if (defaultAccount != null) {
|
|
668
694
|
const defaultAccAsDepositAcc = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, defaultAccount?.accountId);
|
|
669
695
|
const defaultAccAsPaymentAcc = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, defaultAccount?.accountId);
|
|
@@ -14,7 +14,7 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
|
|
|
14
14
|
sendForVerification: any;
|
|
15
15
|
fromBillListScreen: any;
|
|
16
16
|
isSubmittingAdditionalDocuments: any;
|
|
17
|
-
}, "setupView/updateBusinessVerificationDetails", never, never>, updateBusinessVerificationDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/updateBusinessVerificationDetailsSuccess">, updateBusinessVerificationDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "setupView/updateBusinessVerificationDetailsFailure", never, never>,
|
|
17
|
+
}, "setupView/updateBusinessVerificationDetails", never, never>, updateBusinessVerificationDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/updateBusinessVerificationDetailsSuccess">, updateBusinessVerificationDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "setupView/updateBusinessVerificationDetailsFailure", never, never>, updateSelectedCompanyOfficer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedOfficerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10"], {
|
|
18
18
|
selectedOfficerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10";
|
|
19
19
|
}, "setupView/updateSelectedCompanyOfficer", never, never>, updateSetupViewLocalStoreData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
20
|
companyId: ID;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearKycKybAutofillForSetup = exports.applyKybDocumentAutofillForSetup = exports.applyKycDocumentAutofillForSetup = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveTreasuryAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.
|
|
4
|
+
exports.clearKycKybAutofillForSetup = exports.applyKybDocumentAutofillForSetup = exports.applyKycDocumentAutofillForSetup = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveTreasuryAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../../rootActions");
|
|
7
7
|
const kycKybAutofillActions_1 = require("./kycKybAutofillActions");
|
|
@@ -17,7 +17,6 @@ const emptyOfficerSlot = {
|
|
|
17
17
|
};
|
|
18
18
|
exports.initialState = {
|
|
19
19
|
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
20
|
-
kycKybResetStatus: { fetchState: 'Not-Started', error: undefined },
|
|
21
20
|
parsingDocumentFileIds: [],
|
|
22
21
|
companyDetails: { autoFilledFields: [] },
|
|
23
22
|
companyOfficerUpdateStatus: {
|
|
@@ -89,25 +88,6 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
89
88
|
};
|
|
90
89
|
},
|
|
91
90
|
},
|
|
92
|
-
resetKycKyb(draft) {
|
|
93
|
-
draft.kycKybResetStatus = { fetchState: 'In-Progress', error: undefined };
|
|
94
|
-
},
|
|
95
|
-
resetKycKybSuccess(draft) {
|
|
96
|
-
draft.kycKybResetStatus = { fetchState: 'Completed', error: undefined };
|
|
97
|
-
},
|
|
98
|
-
resetKycKybFailure: {
|
|
99
|
-
reducer(draft, action) {
|
|
100
|
-
draft.kycKybResetStatus = { fetchState: 'Error', error: action.payload };
|
|
101
|
-
},
|
|
102
|
-
prepare(error) {
|
|
103
|
-
return {
|
|
104
|
-
payload: error,
|
|
105
|
-
};
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
clearKycKybResetStatus(draft) {
|
|
109
|
-
draft.kycKybResetStatus = { fetchState: 'Not-Started', error: undefined };
|
|
110
|
-
},
|
|
111
91
|
updateSelectedCompanyOfficer: {
|
|
112
92
|
reducer(draft, action) {
|
|
113
93
|
const { selectedOfficerType } = action.payload;
|
|
@@ -383,5 +363,5 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
383
363
|
});
|
|
384
364
|
},
|
|
385
365
|
});
|
|
386
|
-
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.
|
|
366
|
+
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.saveTreasuryAdditionalDocumentsInLocalStore = _a.saveTreasuryAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.applyKycDocumentAutofillForSetup = _a.applyKycDocumentAutofillForSetup, exports.applyKybDocumentAutofillForSetup = _a.applyKybDocumentAutofillForSetup, exports.clearKycKybAutofillForSetup = _a.clearKycKybAutofillForSetup;
|
|
387
367
|
exports.default = setupView.reducer;
|
|
@@ -21,7 +21,6 @@ export interface SetupView {
|
|
|
21
21
|
}
|
|
22
22
|
export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData {
|
|
23
23
|
allNationalityCountries: Country[];
|
|
24
|
-
kycKybResetStatus: FetchStateAndError;
|
|
25
24
|
updateStatus: FetchStateAndError;
|
|
26
25
|
companyView?: CompanyView;
|
|
27
26
|
}
|
|
@@ -90,7 +90,7 @@ function getPrimaryAccountForTheProduct(state, companyId, setupViewType) {
|
|
|
90
90
|
}
|
|
91
91
|
function getBusinessVerificationDetails(state, companyId) {
|
|
92
92
|
const { setupViewState, countryListState } = state;
|
|
93
|
-
const { companyDetails, companyOfficerUpdateStatus,
|
|
93
|
+
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
|
|
94
94
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
95
95
|
const { companyDetailsLocalData, companyOfficerLocalData, parsingDocumentFileIds, } = (0, exports.getCompanyAndIdentityDetails)(state, companyId, {
|
|
96
96
|
companyDetails,
|
|
@@ -105,7 +105,6 @@ function getBusinessVerificationDetails(state, companyId) {
|
|
|
105
105
|
parsingDocumentFileIds,
|
|
106
106
|
companyView,
|
|
107
107
|
updateStatus,
|
|
108
|
-
kycKybResetStatus,
|
|
109
108
|
allNationalityCountries,
|
|
110
109
|
};
|
|
111
110
|
}
|
|
@@ -185,7 +185,6 @@ export interface CompanyAndIdentityDetails {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
export interface SetupViewState extends CompanyAndIdentityDetails {
|
|
188
|
-
kycKybResetStatus: FetchStateAndError;
|
|
189
188
|
/**
|
|
190
189
|
* File IDs currently being parsed by the AI autofill epic. Populated when
|
|
191
190
|
* `parseUploadedKyc/KybDocument` dispatches and cleared when the
|
|
@@ -92,10 +92,9 @@ export interface CompanyDetailsVerificationPayload {
|
|
|
92
92
|
source_of_funds: string;
|
|
93
93
|
sync_token: string;
|
|
94
94
|
tax_id: string;
|
|
95
|
-
company_business_model?: string;
|
|
96
95
|
company_countries_of_operations?: string[];
|
|
97
96
|
company_inc_state?: string | null;
|
|
98
|
-
company_industry_sub_type?: string
|
|
97
|
+
company_industry_sub_type?: string;
|
|
99
98
|
company_industry_type?: string;
|
|
100
99
|
company_purpose_of_account?: CompanyPurposeOfAccountCode;
|
|
101
100
|
company_purpose_of_account_desc?: string;
|
|
@@ -36,8 +36,8 @@ export declare const fetchEditRemiDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
36
36
|
}, "editRemiView/discardRemiUpdatesInLocalStore">, removeFileFromRemiUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
37
37
|
lineId: number;
|
|
38
38
|
reimbursementId?: ID;
|
|
39
|
-
}, "editRemiView/removeFileFromRemiUpdatesInLocalStore">, saveRemiDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[remiStageCode: "
|
|
40
|
-
remiStageCode: "
|
|
39
|
+
}, "editRemiView/removeFileFromRemiUpdatesInLocalStore">, saveRemiDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[remiStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isSubmitted: boolean, reimbursementId?: string | undefined], {
|
|
40
|
+
remiStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
41
41
|
reimbursementId: string | undefined;
|
|
42
42
|
isSubmitted: boolean;
|
|
43
43
|
}, "editRemiView/saveRemiDetail", never, never>, saveRemiSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, reimbursementId?: string | undefined, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
@@ -11,23 +11,23 @@ export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
11
11
|
isIncludeLineItems: boolean;
|
|
12
12
|
isRefreshAccountAndAccountingClass: boolean;
|
|
13
13
|
isBulkActionCompleteRefresh: any;
|
|
14
|
-
}, "remiList/fetchRemiList", never, never>, fetchRemiListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "
|
|
14
|
+
}, "remiList/fetchRemiList", never, never>, fetchRemiListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean, isRefreshAccountAndAccountingClass: boolean], {
|
|
15
15
|
period: TimePeriod;
|
|
16
|
-
tab: "
|
|
16
|
+
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
17
17
|
isShowDeletedReimbursementEnabled: boolean;
|
|
18
18
|
isIncludeLineItems: boolean;
|
|
19
19
|
isRefreshAccountAndAccountingClass: boolean;
|
|
20
20
|
}, "remiList/fetchRemiListPerTab", never, never>, updateRemiListByStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
remiList: RemiListPayload;
|
|
22
22
|
tab: RemiTabType;
|
|
23
|
-
}, "remiList/updateRemiListByStatus">, updateRemiListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "
|
|
23
|
+
}, "remiList/updateRemiListByStatus">, updateRemiListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
24
24
|
period: TimePeriod;
|
|
25
|
-
tab: "
|
|
25
|
+
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
26
26
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
27
27
|
}, "remiList/updateRemiListFailure", never, never>, updateRemiListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
28
|
period: TimePeriod;
|
|
29
29
|
uiState: Partial<RemiListUIState>;
|
|
30
|
-
}, "remiList/updateRemiListUIState">, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
30
|
+
}, "remiList/updateRemiListUIState">, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "pending_approval" | "scheduled" | "draft", "remiList/updateTab">, updateSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"failed" | "deleted" | "cancelled" | "rejected" | "ach" | "wire" | "all" | "overdue" | "myDrafts" | "awaitingApproval" | "awaitingMyApproval" | "awaitingAllApproval", "remiList/updateSubTab">, updateSelectedRemiId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "remiList/updateSelectedRemiId">, updateRemiDetailSaveRemiCode: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<SaveRemiStageCode, "remiList/updateRemiDetailSaveRemiCode">, updateSearchResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "remiList/updateSearchResult">, updateFilterResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
31
|
filters: ReimbursementFilters;
|
|
32
32
|
}, "remiList/updateFilterResult">, updateRemiListDownloadUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
33
33
|
uiState: Partial<RemiListDownloadUIState>;
|
|
@@ -30,8 +30,8 @@ export interface RemiListDownloadUIState extends RemiListUIState {
|
|
|
30
30
|
}
|
|
31
31
|
export type SaveRemiStageCode = 'draft' | 'pending_approval' | undefined;
|
|
32
32
|
export declare const ALL_REMI_TABS: readonly ["paid", "pending_approval", "scheduled", "draft"];
|
|
33
|
-
export declare const toRemiTabType: (v: string) => "
|
|
34
|
-
export declare const toRemiTabTypeStrict: (v: string) => "
|
|
33
|
+
export declare const toRemiTabType: (v: string) => "paid" | "pending_approval" | "scheduled" | "draft";
|
|
34
|
+
export declare const toRemiTabTypeStrict: (v: string) => "paid" | "pending_approval" | "scheduled" | "draft" | undefined;
|
|
35
35
|
export type RemiTabType = ReturnType<typeof toRemiTabType>;
|
|
36
36
|
export declare const toRemiSubTabType: (v: string) => "failed" | "deleted" | "cancelled" | "rejected" | "ach" | "wire" | "all" | "overdue" | "myDrafts" | "awaitingApproval" | "awaitingMyApproval" | "awaitingAllApproval";
|
|
37
37
|
export declare const toRemiSubTabTypeStrict: (v: string) => "failed" | "deleted" | "cancelled" | "rejected" | "ach" | "wire" | "all" | "overdue" | "myDrafts" | "awaitingApproval" | "awaitingMyApproval" | "awaitingAllApproval" | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.70",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UpdateType } from '../../../commonStateTypes/common';
|
|
2
|
-
import { InvoicingCatalogItemPayload, InvoicingCatalogPricePointPayload } from './invoicingCatalogPayload';
|
|
3
|
-
import { InvoicingCatalogPricePoint, InvoicingCatalogState } from './invoicingCatalogState';
|
|
4
|
-
export declare const initialState: InvoicingCatalogState;
|
|
5
|
-
export declare const updateInvoicingCatalogItems: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: InvoicingCatalogItemPayload[], updateType?: UpdateType | undefined], InvoicingCatalogItemPayload[], "invoicingCatalog/updateInvoicingCatalogItems", never, {
|
|
6
|
-
updateType: UpdateType;
|
|
7
|
-
}>, mergeInvoicingCatalogPricePoint: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[itemId: string, subFamilyPayload: InvoicingCatalogPricePointPayload], {
|
|
8
|
-
itemId: string;
|
|
9
|
-
subFamily: InvoicingCatalogPricePoint;
|
|
10
|
-
}, "invoicingCatalog/mergeInvoicingCatalogPricePoint", never, never>, removeInvoicingCatalogItem: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "invoicingCatalog/removeInvoicingCatalogItem">;
|
|
11
|
-
declare const _default: import("redux").Reducer<InvoicingCatalogState>;
|
|
12
|
-
export default _default;
|