@zeniai/client-epic-state 5.2.70 → 5.2.72-beta0ND
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 +3 -1
- package/lib/entity/actualMatching/actualMatchingReducer.js +11 -2
- 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/{product/productPayload.d.ts → invoicingCatalog/invoicingCatalogPayload.d.ts} +44 -6
- package/lib/entity/invoicing/{product/productPayload.js → invoicingCatalog/invoicingCatalogPayload.js} +50 -6
- package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +12 -0
- package/lib/entity/invoicing/{plan/planReducer.js → invoicingCatalog/invoicingCatalogReducer.js} +20 -21
- package/lib/entity/invoicing/{plan/planSelector.d.ts → invoicingCatalog/invoicingCatalogSelector.d.ts} +5 -6
- package/lib/entity/invoicing/{plan/planSelector.js → invoicingCatalog/invoicingCatalogSelector.js} +12 -12
- package/lib/entity/invoicing/{product/productState.d.ts → invoicingCatalog/invoicingCatalogState.d.ts} +42 -6
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/epic.d.ts +4 -2
- package/lib/epic.js +5 -1
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +9 -1
- package/lib/esm/entity/invoicing/{product/productPayload.js → invoicingCatalog/invoicingCatalogPayload.js} +46 -3
- package/lib/esm/entity/invoicing/{plan/planReducer.js → invoicingCatalog/invoicingCatalogReducer.js} +19 -20
- package/lib/esm/entity/invoicing/{plan/planSelector.js → invoicingCatalog/invoicingCatalogSelector.js} +8 -8
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/epic.js +5 -1
- package/lib/esm/index.js +9 -12
- package/lib/esm/reducer.js +4 -7
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +4 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +50 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +26 -13
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +2 -23
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +89 -38
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +68 -62
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +15 -0
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +9 -1
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +5 -3
- 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 +3 -7
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +5 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +27 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +5 -1
- package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +8 -1
- 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 +55 -22
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +1 -20
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +18 -9
- package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +11 -2
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +33 -13
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +2 -1
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -30
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +37 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +21 -1
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
- package/lib/index.d.ts +15 -19
- package/lib/index.js +65 -63
- package/lib/reducer.d.ts +1 -2
- package/lib/reducer.js +4 -7
- package/lib/rootStateTypes.d.ts +3 -5
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +3 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +54 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +24 -11
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +1 -22
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +12 -1
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +19 -8
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +90 -39
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +24 -10
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +7 -4
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +71 -62
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +19 -4
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +18 -1
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +3 -2
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +8 -0
- 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 +8 -9
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +5 -3
- 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 +3 -4
- 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 +2 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -7
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +6 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +3 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +29 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +5 -1
- package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +3 -1
- package/lib/view/invoicing/invoiceList/invoiceListReducer.js +9 -2
- 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 +33 -15
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +57 -23
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +0 -15
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +0 -22
- 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 +12 -3
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +17 -8
- package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +11 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +33 -13
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +3 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +2 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +4 -0
- 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 +4 -30
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +8 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +41 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +22 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -0
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +2 -1
- 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 -26
- package/lib/entity/invoicing/plan/planPayload.d.ts +0 -40
- package/lib/entity/invoicing/plan/planPayload.js +0 -51
- package/lib/entity/invoicing/plan/planReducer.d.ts +0 -14
- package/lib/entity/invoicing/plan/planState.d.ts +0 -43
- package/lib/entity/invoicing/product/productReducer.d.ts +0 -9
- package/lib/entity/invoicing/product/productReducer.js +0 -50
- package/lib/entity/invoicing/product/productSelector.d.ts +0 -4
- package/lib/entity/invoicing/product/productSelector.js +0 -17
- package/lib/entity/invoicing/product/productState.js +0 -2
- package/lib/esm/entity/invoicing/plan/planPayload.js +0 -47
- package/lib/esm/entity/invoicing/product/productReducer.js +0 -43
- package/lib/esm/entity/invoicing/product/productSelector.js +0 -10
- package/lib/esm/entity/invoicing/product/productState.js +0 -1
- /package/lib/entity/invoicing/{plan/planState.js → invoicingCatalog/invoicingCatalogState.js} +0 -0
- /package/lib/esm/entity/invoicing/{plan/planState.js → invoicingCatalog/invoicingCatalogState.js} +0 -0
package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { updateInvoicingCatalogItems } from '../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
|
|
4
4
|
import { RootState } from '../../../../rootStateTypes';
|
|
5
5
|
import { fetchInvoicingCatalogCounts, fetchInvoicingCatalogListPage, fetchInvoicingCatalogPlanList, fetchInvoicingCatalogProductList, updateInvoicingCatalogCounts, updateInvoicingCatalogCountsFailure, updateInvoicingCatalogPlanList, updateInvoicingCatalogPlanListFailure, updateInvoicingCatalogProductList, updateInvoicingCatalogProductListFailure } from '../invoicingCatalogListViewReducer';
|
|
6
6
|
/**
|
|
7
7
|
* Aggregate of every action emitted across the catalog list view epics. Wired
|
|
8
8
|
* into the root action union for this view.
|
|
9
9
|
*/
|
|
10
|
-
export type ActionType = ReturnType<typeof fetchInvoicingCatalogPlanList> | ReturnType<typeof fetchInvoicingCatalogProductList> | ReturnType<typeof fetchInvoicingCatalogListPage> | ReturnType<typeof fetchInvoicingCatalogCounts> | ReturnType<typeof updateInvoicingCatalogPlanList> | ReturnType<typeof updateInvoicingCatalogPlanListFailure> | ReturnType<typeof updateInvoicingCatalogProductList> | ReturnType<typeof updateInvoicingCatalogProductListFailure> | ReturnType<typeof updateInvoicingCatalogCounts> | ReturnType<typeof updateInvoicingCatalogCountsFailure> | ReturnType<typeof
|
|
10
|
+
export type ActionType = ReturnType<typeof fetchInvoicingCatalogPlanList> | ReturnType<typeof fetchInvoicingCatalogProductList> | ReturnType<typeof fetchInvoicingCatalogListPage> | ReturnType<typeof fetchInvoicingCatalogCounts> | ReturnType<typeof updateInvoicingCatalogPlanList> | ReturnType<typeof updateInvoicingCatalogPlanListFailure> | ReturnType<typeof updateInvoicingCatalogProductList> | ReturnType<typeof updateInvoicingCatalogProductListFailure> | ReturnType<typeof updateInvoicingCatalogCounts> | ReturnType<typeof updateInvoicingCatalogCountsFailure> | ReturnType<typeof updateInvoicingCatalogItems>;
|
|
11
11
|
/**
|
|
12
12
|
* Orchestrates the catalog page: on `fetchInvoicingCatalogListPage`, fans out to
|
|
13
13
|
* the plan-list, product-list and counts fetches, skipping any whose data is
|
package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { updateInvoicingCatalogItems } from '../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
|
|
4
4
|
import { RootState } from '../../../../rootStateTypes';
|
|
5
5
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
6
|
import { fetchInvoicingCatalogPlanList, updateInvoicingCatalogPlanList, updateInvoicingCatalogPlanListFailure } from '../invoicingCatalogListViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchInvoicingCatalogPlanList> | ReturnType<typeof updateInvoicingCatalogPlanList> | ReturnType<typeof updateInvoicingCatalogPlanListFailure> | ReturnType<typeof
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchInvoicingCatalogPlanList> | ReturnType<typeof updateInvoicingCatalogPlanList> | ReturnType<typeof updateInvoicingCatalogPlanListFailure> | ReturnType<typeof updateInvoicingCatalogItems>;
|
|
8
8
|
export declare const fetchInvoicingCatalogPlanListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchInvoicingCatalogPlanListEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const
|
|
6
|
+
const invoicingCatalogReducer_1 = require("../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
8
|
const invoicingApiHelper_1 = require("../../invoicingApiHelper");
|
|
9
9
|
const invoicingCatalogListViewReducer_1 = require("../invoicingCatalogListViewReducer");
|
|
@@ -32,7 +32,7 @@ const fetchInvoicingCatalogPlanListEpic = (actions$, _state$, zeniAPI) => action
|
|
|
32
32
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
33
33
|
const items = response.data?.items ?? [];
|
|
34
34
|
return [
|
|
35
|
-
(0,
|
|
35
|
+
(0, invoicingCatalogReducer_1.updateInvoicingCatalogItems)(items, 'merge'),
|
|
36
36
|
(0, invoicingCatalogListViewReducer_1.updateInvoicingCatalogPlanList)({
|
|
37
37
|
ids: items.map((item) => item.id),
|
|
38
38
|
nextCursor: response.data?.next_cursor ?? null,
|
package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { updateInvoicingCatalogItems } from '../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
|
|
4
4
|
import { RootState } from '../../../../rootStateTypes';
|
|
5
5
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
6
|
import { fetchInvoicingCatalogProductList, updateInvoicingCatalogProductList, updateInvoicingCatalogProductListFailure } from '../invoicingCatalogListViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchInvoicingCatalogProductList> | ReturnType<typeof updateInvoicingCatalogProductList> | ReturnType<typeof updateInvoicingCatalogProductListFailure> | ReturnType<typeof
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchInvoicingCatalogProductList> | ReturnType<typeof updateInvoicingCatalogProductList> | ReturnType<typeof updateInvoicingCatalogProductListFailure> | ReturnType<typeof updateInvoicingCatalogItems>;
|
|
8
8
|
export declare const fetchInvoicingCatalogProductListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchInvoicingCatalogProductListEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const
|
|
6
|
+
const invoicingCatalogReducer_1 = require("../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
8
|
const invoicingApiHelper_1 = require("../../invoicingApiHelper");
|
|
9
9
|
const invoicingCatalogListViewReducer_1 = require("../invoicingCatalogListViewReducer");
|
|
@@ -32,7 +32,7 @@ const fetchInvoicingCatalogProductListEpic = (actions$, _state$, zeniAPI) => act
|
|
|
32
32
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
33
33
|
const items = response.data?.items ?? [];
|
|
34
34
|
return [
|
|
35
|
-
(0,
|
|
35
|
+
(0, invoicingCatalogReducer_1.updateInvoicingCatalogItems)(items, 'merge'),
|
|
36
36
|
(0, invoicingCatalogListViewReducer_1.updateInvoicingCatalogProductList)({
|
|
37
37
|
ids: items.map((item) => item.id),
|
|
38
38
|
nextCursor: response.data?.next_cursor ?? null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { InvoicingCatalogItemPayload } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogPayload';
|
|
1
2
|
import { InvoicingListCounts, InvoicingPaginatedList } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
|
-
import { InvoicingPlanPayload } from '../../../entity/invoicing/plan/planPayload';
|
|
3
3
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
4
|
-
export type InvoicingCatalogPlanListResponse = ZeniAPIResponse<InvoicingPaginatedList<
|
|
5
|
-
export type InvoicingCatalogProductListResponse = ZeniAPIResponse<InvoicingPaginatedList<
|
|
4
|
+
export type InvoicingCatalogPlanListResponse = ZeniAPIResponse<InvoicingPaginatedList<InvoicingCatalogItemPayload>>;
|
|
5
|
+
export type InvoicingCatalogProductListResponse = ZeniAPIResponse<InvoicingPaginatedList<InvoicingCatalogItemPayload>>;
|
|
6
6
|
export type InvoicingCatalogCountsResponse = ZeniAPIResponse<InvoicingListCounts>;
|
|
@@ -1,31 +1,48 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
3
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
4
|
+
import { InvoicingCatalogItem, InvoicingCatalogPricePoint, InvoicingCatalogTier } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogState';
|
|
5
|
+
import { InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
6
6
|
import { RootState } from '../../../rootStateTypes';
|
|
7
7
|
import { InvoicingListSort } from '../invoicingApiHelper';
|
|
8
|
-
import { InvoicingCatalogPlanFilters, InvoicingCatalogProductFilters
|
|
8
|
+
import { InvoicingCatalogPlanFilters, InvoicingCatalogProductFilters } from './invoicingCatalogListViewState';
|
|
9
|
+
/**
|
|
10
|
+
* One row of the catalog table: a price point under its catalog item, so an
|
|
11
|
+
* item priced monthly and annually lists once per price. An item with no price
|
|
12
|
+
* points still gets a row, from the item's own fields.
|
|
13
|
+
*/
|
|
14
|
+
export interface InvoicingCatalogPlanRow {
|
|
15
|
+
/** The price point's id, or the item's when it has no price points. */
|
|
16
|
+
id: ID;
|
|
17
|
+
/** The row's catalog item: the row opens it and its menu acts on it. */
|
|
18
|
+
item: InvoicingCatalogItem;
|
|
19
|
+
tierCount: number;
|
|
20
|
+
/** The tier with the lowest starting unit — what "From" quotes. */
|
|
21
|
+
firstTier?: InvoicingCatalogTier;
|
|
22
|
+
period?: number;
|
|
23
|
+
periodUnit?: string;
|
|
24
|
+
planName?: string;
|
|
25
|
+
price?: Amount;
|
|
26
|
+
pricingModel?: string;
|
|
27
|
+
productFamily?: string;
|
|
28
|
+
status?: string;
|
|
29
|
+
}
|
|
9
30
|
export interface InvoicingCatalogListView extends SelectorView {
|
|
10
|
-
/** Config-owned; folded in so the screen reads one selector. */
|
|
11
|
-
catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
|
|
12
31
|
count: InvoicingListCounts;
|
|
13
32
|
countsFetchState: FetchStateAndError;
|
|
14
33
|
planFilters: InvoicingCatalogPlanFilters;
|
|
15
34
|
planNextCursor: string | null;
|
|
16
|
-
plans
|
|
17
|
-
|
|
35
|
+
/** {@link plans} flattened to one row per price point. */
|
|
36
|
+
planRows: InvoicingCatalogPlanRow[];
|
|
37
|
+
plans: InvoicingCatalogItem[];
|
|
18
38
|
productFetchState: FetchStateAndError;
|
|
19
39
|
productFilters: InvoicingCatalogProductFilters;
|
|
20
40
|
productNextCursor: string | null;
|
|
21
|
-
|
|
41
|
+
/** The add-on / charge rows: {@link products} flattened the same way. */
|
|
42
|
+
productRows: InvoicingCatalogPlanRow[];
|
|
43
|
+
products: InvoicingCatalogItem[];
|
|
22
44
|
planSort?: InvoicingListSort;
|
|
23
45
|
productSort?: InvoicingListSort;
|
|
24
|
-
/**
|
|
25
|
-
* The catalog item whose lifecycle action is in flight, so the list disables
|
|
26
|
-
* that row's menu without reaching into the action slice itself.
|
|
27
|
-
*/
|
|
28
|
-
runningActionId?: ID;
|
|
29
46
|
}
|
|
30
47
|
/**
|
|
31
48
|
* Flatten catalog items into the price rows the pickers render.
|
|
@@ -37,7 +54,8 @@ export interface InvoicingCatalogListView extends SelectorView {
|
|
|
37
54
|
* written after the spread so the item's own rule wins over any stale copy a
|
|
38
55
|
* price point payload may carry.
|
|
39
56
|
*/
|
|
40
|
-
export declare const getInvoicingCatalogPrices: (items:
|
|
57
|
+
export declare const getInvoicingCatalogPrices: (items: InvoicingCatalogItem[]) => InvoicingCatalogPricePoint[];
|
|
58
|
+
export declare const getInvoicingCatalogPlanRows: (items: InvoicingCatalogItem[]) => InvoicingCatalogPlanRow[];
|
|
41
59
|
/**
|
|
42
60
|
* Bundled read view for the single catalog page (plans + products tabs).
|
|
43
61
|
* Memoized over the plan + product entity slices and the list-view slice so the
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingCatalogListView = exports.getInvoicingCatalogPrices = void 0;
|
|
3
|
+
exports.getInvoicingCatalogListView = exports.getInvoicingCatalogPlanRows = exports.getInvoicingCatalogPrices = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const
|
|
6
|
-
const runningInvoicingActionId_1 = require("../runningInvoicingActionId");
|
|
7
|
-
const invoicingCatalogListViewState_1 = require("./invoicingCatalogListViewState");
|
|
5
|
+
const invoicingCatalogSelector_1 = require("../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector");
|
|
8
6
|
/**
|
|
9
7
|
* Flatten catalog items into the price rows the pickers render.
|
|
10
8
|
*
|
|
@@ -26,28 +24,64 @@ const getInvoicingCatalogPrices = (items) => items.flatMap((item) => (item.subFa
|
|
|
26
24
|
productCode: item.productCode,
|
|
27
25
|
})));
|
|
28
26
|
exports.getInvoicingCatalogPrices = getInvoicingCatalogPrices;
|
|
27
|
+
const lowestStartingTier = (tiers) => tiers.reduce((lowest, tier) => lowest == null || tier.startingUnit < lowest.startingUnit ? tier : lowest, undefined);
|
|
28
|
+
const getInvoicingCatalogPlanRows = (items) => items.flatMap((item) => {
|
|
29
|
+
const pricePoints = item.subFamilies ?? [];
|
|
30
|
+
if (pricePoints.length === 0) {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
id: item.id,
|
|
34
|
+
item,
|
|
35
|
+
period: item.period,
|
|
36
|
+
periodUnit: item.periodUnit,
|
|
37
|
+
price: item.price,
|
|
38
|
+
productFamily: item.name,
|
|
39
|
+
status: item.status,
|
|
40
|
+
tierCount: item.tiers?.length ?? 0,
|
|
41
|
+
firstTier: lowestStartingTier(item.tiers ?? []),
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
return pricePoints.map((pricePoint) => ({
|
|
46
|
+
id: pricePoint.id,
|
|
47
|
+
item,
|
|
48
|
+
period: pricePoint.period,
|
|
49
|
+
periodUnit: pricePoint.periodUnit,
|
|
50
|
+
planName: pricePoint.name,
|
|
51
|
+
price: (0, invoicingCatalogSelector_1.invoicingPricePointDisplayAmount)(pricePoint),
|
|
52
|
+
pricingModel: pricePoint.pricingModel,
|
|
53
|
+
productFamily: item.name,
|
|
54
|
+
status: pricePoint.status,
|
|
55
|
+
tierCount: pricePoint.tiers?.length ?? 0,
|
|
56
|
+
firstTier: lowestStartingTier(pricePoint.tiers ?? []),
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
exports.getInvoicingCatalogPlanRows = getInvoicingCatalogPlanRows;
|
|
29
60
|
/**
|
|
30
61
|
* Bundled read view for the single catalog page (plans + products tabs).
|
|
31
62
|
* Memoized over the plan + product entity slices and the list-view slice so the
|
|
32
63
|
* denormalized arrays keep referential identity. The base `fetchState`/`error`
|
|
33
64
|
* track the plan list; the product list has its own `productFetchState`.
|
|
34
65
|
*/
|
|
35
|
-
exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.invoicingCatalogState, (state) => state.invoicingCatalogListViewState, (catalogState, listViewState) => {
|
|
67
|
+
const plans = (0, invoicingCatalogSelector_1.getInvoicingCatalogItemsByIds)(catalogState, listViewState.planIds);
|
|
68
|
+
const products = (0, invoicingCatalogSelector_1.getInvoicingCatalogItemsByIds)(catalogState, listViewState.productIds);
|
|
69
|
+
return {
|
|
70
|
+
planRows: (0, exports.getInvoicingCatalogPlanRows)(plans),
|
|
71
|
+
plans,
|
|
72
|
+
planSort: listViewState.planSort,
|
|
73
|
+
productRows: (0, exports.getInvoicingCatalogPlanRows)(products),
|
|
74
|
+
products,
|
|
75
|
+
productSort: listViewState.productSort,
|
|
76
|
+
count: listViewState.counts,
|
|
77
|
+
countsFetchState: listViewState.countsFetchState,
|
|
78
|
+
planFilters: listViewState.planFilters,
|
|
79
|
+
planNextCursor: listViewState.planNextCursor,
|
|
80
|
+
productFilters: listViewState.productFilters,
|
|
81
|
+
productNextCursor: listViewState.productNextCursor,
|
|
82
|
+
productFetchState: listViewState.productFetchState,
|
|
83
|
+
fetchState: listViewState.fetchState,
|
|
84
|
+
error: listViewState.error,
|
|
85
|
+
version: 1.0,
|
|
86
|
+
};
|
|
87
|
+
});
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
3
|
import { InvoicingListSort } from '../invoicingApiHelper';
|
|
4
|
-
export declare const ALL_INVOICING_PRODUCT_SORT_KEYS: readonly ["product_name", "product_code", "type", "pricing", "usage", "updated", "status"];
|
|
5
|
-
export declare const toInvoicingProductSortKey: (v: string) => "type" | "status" | "product_name" | "product_code" | "pricing" | "usage" | "updated";
|
|
6
|
-
export type InvoicingProductSortKey = ReturnType<typeof toInvoicingProductSortKey>;
|
|
7
|
-
/**
|
|
8
|
-
* Structural column descriptor owned by CES for the catalog product table
|
|
9
|
-
* (add-ons / one-time charges), so the column set, order and sortability live
|
|
10
|
-
* next to the `InvoicingProduct` model rather than being hardcoded in
|
|
11
|
-
* web-components. Header labels, cell rendering and layout (alignment, widths)
|
|
12
|
-
* stay in the view layer. (The plans table keeps its own columns in web-c.)
|
|
13
|
-
*/
|
|
14
|
-
export interface InvoicingProductColumnConfig {
|
|
15
|
-
key: InvoicingProductSortKey;
|
|
16
|
-
sortable: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare const INVOICING_PRODUCT_COLUMNS: InvoicingProductColumnConfig[];
|
|
19
4
|
export interface InvoicingCatalogPlanFilters {
|
|
20
5
|
search?: string;
|
|
21
6
|
status?: string;
|
|
@@ -1,24 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INVOICING_PRODUCT_COLUMNS = exports.toInvoicingProductSortKey = exports.ALL_INVOICING_PRODUCT_SORT_KEYS = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.ALL_INVOICING_PRODUCT_SORT_KEYS = [
|
|
6
|
-
'product_name',
|
|
7
|
-
'product_code',
|
|
8
|
-
'type',
|
|
9
|
-
'pricing',
|
|
10
|
-
'usage',
|
|
11
|
-
'updated',
|
|
12
|
-
'status',
|
|
13
|
-
];
|
|
14
|
-
const toInvoicingProductSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_PRODUCT_SORT_KEYS);
|
|
15
|
-
exports.toInvoicingProductSortKey = toInvoicingProductSortKey;
|
|
16
|
-
exports.INVOICING_PRODUCT_COLUMNS = [
|
|
17
|
-
{ key: 'product_name', sortable: true },
|
|
18
|
-
{ key: 'product_code', sortable: true },
|
|
19
|
-
{ key: 'type', sortable: true },
|
|
20
|
-
{ key: 'pricing', sortable: false },
|
|
21
|
-
{ key: 'usage', sortable: true },
|
|
22
|
-
{ key: 'updated', sortable: true },
|
|
23
|
-
{ key: 'status', sortable: true },
|
|
24
|
-
];
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts
CHANGED
|
@@ -26,6 +26,6 @@ export declare const fetchInvoicingDunningCaseList: import("@reduxjs/toolkit").A
|
|
|
26
26
|
ids: ID[];
|
|
27
27
|
keepExistingListItems: boolean;
|
|
28
28
|
nextCursor: string | null;
|
|
29
|
-
}, "invoicingDunningCaseListView/updateInvoicingDunningCaseList">, updateInvoicingDunningCaseListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseListFailure">, fetchInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingDunningCaseListView/fetchInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingDunningCaseListView/updateInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseCountsFailure">, updateInvoicingDunningCaseFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingDunningCaseFilters, "invoicingDunningCaseListView/updateInvoicingDunningCaseFilters">, setInvoicingDunningCaseActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "
|
|
29
|
+
}, "invoicingDunningCaseListView/updateInvoicingDunningCaseList">, updateInvoicingDunningCaseListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseListFailure">, fetchInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingDunningCaseListView/fetchInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingDunningCaseListView/updateInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseCountsFailure">, updateInvoicingDunningCaseFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingDunningCaseFilters, "invoicingDunningCaseListView/updateInvoicingDunningCaseFilters">, setInvoicingDunningCaseActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paused" | "cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "all", "invoicingDunningCaseListView/setInvoicingDunningCaseActiveTab">;
|
|
30
30
|
declare const _default: import("redux").Reducer<InvoicingDunningCaseListViewState>;
|
|
31
31
|
export default _default;
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface InvoicingDunningCaseColumnConfig {
|
|
|
20
20
|
}
|
|
21
21
|
export declare const INVOICING_DUNNING_CASE_COLUMNS: InvoicingDunningCaseColumnConfig[];
|
|
22
22
|
export declare const ALL_INVOICING_DUNNING_CASE_TAB_IDS: readonly ["all", "retrying", "scheduled", "manual_review", "paused", "resolved", "cancelled"];
|
|
23
|
-
export declare const toInvoicingDunningCaseTabId: (v: string) => "cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "
|
|
23
|
+
export declare const toInvoicingDunningCaseTabId: (v: string) => "paused" | "cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "all";
|
|
24
24
|
export type InvoicingDunningCaseTabId = ReturnType<typeof toInvoicingDunningCaseTabId>;
|
|
25
25
|
export interface InvoicingDunningCaseListViewState extends FetchedState {
|
|
26
26
|
/** Selected status tab (CES-owned so it persists across page revisits). */
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const fetchInvoicingSubscriptionList: import("@reduxjs/toolkit").
|
|
|
27
27
|
ids: ID[];
|
|
28
28
|
keepExistingListItems: boolean;
|
|
29
29
|
nextCursor: string | null;
|
|
30
|
-
}, "invoicingSubscriptionListView/updateInvoicingSubscriptionList">, updateInvoicingSubscriptionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionListFailure">, fetchInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSubscriptionListView/fetchInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingSubscriptionListView/updateInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionCountsFailure">, updateInvoicingSubscriptionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSubscriptionFilters, "invoicingSubscriptionListView/updateInvoicingSubscriptionFilters">, setInvoicingSubscriptionActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
30
|
+
}, "invoicingSubscriptionListView/updateInvoicingSubscriptionList">, updateInvoicingSubscriptionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionListFailure">, fetchInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSubscriptionListView/fetchInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingSubscriptionListView/updateInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionCountsFailure">, updateInvoicingSubscriptionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSubscriptionFilters, "invoicingSubscriptionListView/updateInvoicingSubscriptionFilters">, setInvoicingSubscriptionActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paused" | "active" | "cancelled" | "future" | "in_trial" | "non_renewing" | "all", "invoicingSubscriptionListView/setInvoicingSubscriptionActiveTab">, addInvoicingSubscriptionToList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
31
|
id: ID;
|
|
32
32
|
status?: InvoicingSubscriptionStatus;
|
|
33
33
|
}, "invoicingSubscriptionListView/addInvoicingSubscriptionToList">;
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface InvoicingSubscriptionColumnConfig {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const INVOICING_SUBSCRIPTION_COLUMNS: InvoicingSubscriptionColumnConfig[];
|
|
25
25
|
export declare const ALL_INVOICING_SUBSCRIPTION_TAB_IDS: readonly ["all", "active", "in_trial", "future", "non_renewing", "paused", "cancelled"];
|
|
26
|
-
export declare const toInvoicingSubscriptionTabId: (v: string) => "
|
|
26
|
+
export declare const toInvoicingSubscriptionTabId: (v: string) => "paused" | "active" | "cancelled" | "future" | "in_trial" | "non_renewing" | "all";
|
|
27
27
|
export type InvoicingSubscriptionTabId = ReturnType<typeof toInvoicingSubscriptionTabId>;
|
|
28
28
|
export interface InvoicingSubscriptionListViewState extends FetchedState {
|
|
29
29
|
/** Selected status tab (CES-owned so it persists across page revisits). */
|
|
@@ -4,6 +4,7 @@ import { InvoicingDunningActionOption, InvoicingFieldHelpByCode, InvoicingNamedO
|
|
|
4
4
|
import { File } from '../../../entity/file/fileState';
|
|
5
5
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
6
6
|
import { RootState } from '../../../rootStateTypes';
|
|
7
|
+
import { AddressUpdatableInfo } from '../../addressView/addressViewState';
|
|
7
8
|
import { InvoicingQboConnection, InvoicingQboSyncHealth } from '../invoicingQboView/invoicingQboViewPayload';
|
|
8
9
|
import { InvoicingAccountingOption } from '../invoicingQboView/invoicingQboViewSelector';
|
|
9
10
|
import { InvoicingBrandingFormLocalData } from './invoicingBrandingFormConfig';
|
|
@@ -113,6 +114,8 @@ export interface InvoicingQboSettingsFormView {
|
|
|
113
114
|
localData: InvoicingQboSettingsLocalData;
|
|
114
115
|
nestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
115
116
|
retryFetchStateByTaskId: Record<string, FetchStateAndError>;
|
|
117
|
+
/** The saved values the draft is compared against. */
|
|
118
|
+
savedLocalData: InvoicingQboSettingsLocalData;
|
|
116
119
|
saveState: FetchStateAndError;
|
|
117
120
|
settingsFetchState: FetchState;
|
|
118
121
|
syncStatusOptions: InvoicingNamedOption[];
|
|
@@ -134,14 +137,20 @@ export interface InvoicingBrandingFormView {
|
|
|
134
137
|
fieldHelp: InvoicingFieldHelpByCode;
|
|
135
138
|
localData: InvoicingBrandingFormLocalData;
|
|
136
139
|
saveState: FetchStateAndError;
|
|
140
|
+
/** The business address to show: the in-progress edit, else what is saved. */
|
|
141
|
+
address?: AddressUpdatableInfo;
|
|
137
142
|
addressLabel?: string;
|
|
138
143
|
settings?: InvoicingSettingsPayload;
|
|
139
144
|
}
|
|
140
145
|
/**
|
|
141
146
|
* Bundled view for the branding settings form: the draft `localData` (seeded
|
|
142
|
-
* from the existing settings until the user edits), the business
|
|
143
|
-
* (
|
|
144
|
-
* settings (for the logo/preview), the backend date-format choices and the
|
|
147
|
+
* from the existing settings until the user edits), the business address, the
|
|
148
|
+
* raw settings (for the logo/preview), the backend date-format choices and the
|
|
145
149
|
* save fetch state.
|
|
150
|
+
*
|
|
151
|
+
* The address is resolved here rather than read from the Address screen's
|
|
152
|
+
* staging store alone: that store is only seeded when settings are fetched, and
|
|
153
|
+
* returning to this page does not refetch, so a saved address would otherwise
|
|
154
|
+
* have no way to reach the screen.
|
|
146
155
|
*/
|
|
147
156
|
export declare const getInvoicingBrandingFormView: (state: RootState) => InvoicingBrandingFormView;
|
|
@@ -3,6 +3,7 @@ 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");
|
|
6
7
|
const fileSelector_1 = require("../../../entity/file/fileSelector");
|
|
7
8
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
8
9
|
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
@@ -126,6 +127,7 @@ const getInvoicingQboSettingsFormView = (state) => {
|
|
|
126
127
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
127
128
|
accountMappingKindOptions: qboAccountMappingKindOptions,
|
|
128
129
|
accounts: qboView.accounts,
|
|
130
|
+
savedLocalData: (0, invoicingQboSettingsFormConfig_1.entityToInvoicingQboSettingsLocalData)(settings?.qbo),
|
|
129
131
|
backfillState: qboView.backfillState,
|
|
130
132
|
connection: qboView.connection,
|
|
131
133
|
configFetchState,
|
|
@@ -152,20 +154,27 @@ const getInvoicingQboSettingsFormView = (state) => {
|
|
|
152
154
|
exports.getInvoicingQboSettingsFormView = getInvoicingQboSettingsFormView;
|
|
153
155
|
/**
|
|
154
156
|
* Bundled view for the branding settings form: the draft `localData` (seeded
|
|
155
|
-
* from the existing settings until the user edits), the business
|
|
156
|
-
* (
|
|
157
|
-
* settings (for the logo/preview), the backend date-format choices and the
|
|
157
|
+
* from the existing settings until the user edits), the business address, the
|
|
158
|
+
* raw settings (for the logo/preview), the backend date-format choices and the
|
|
158
159
|
* 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.
|
|
159
165
|
*/
|
|
160
166
|
const getInvoicingBrandingFormView = (state) => {
|
|
161
167
|
const { brandingDraft, saveFetchState, settings } = state.invoicingSettingsViewState;
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
168
|
+
const savedAddressId = settings?.address?.address_id;
|
|
169
|
+
const address = state.addressViewState.newAddressState?.[invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE]
|
|
170
|
+
?.addressToCreate ??
|
|
171
|
+
(savedAddressId != null
|
|
172
|
+
? (0, addressSelector_1.getAddressByAddressId)(state.addressState, savedAddressId)
|
|
173
|
+
: undefined);
|
|
166
174
|
return {
|
|
167
175
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
168
|
-
|
|
176
|
+
address,
|
|
177
|
+
addressLabel: address != null ? (0, addressViewSelector_1.getFormattedAddress)(address) : undefined,
|
|
169
178
|
dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
|
|
170
179
|
localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
|
|
171
180
|
saveState: saveFetchState,
|
|
@@ -4,6 +4,7 @@ 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");
|
|
7
8
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
8
9
|
const responsePayload_1 = require("../../../responsePayload");
|
|
9
10
|
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
@@ -19,7 +20,11 @@ const submitInvoicingBrandingFormEpic = (actions$, state$, zeniAPI) => actions$.
|
|
|
19
20
|
const state = state$.value;
|
|
20
21
|
const { brandingDraft, settings } = state.invoicingSettingsViewState;
|
|
21
22
|
const localData = brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings);
|
|
22
|
-
const
|
|
23
|
+
const savedAddressId = settings?.address?.address_id;
|
|
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);
|
|
23
28
|
const data = (0, invoicingBrandingFormConfig_1.brandingLocalDataToSettingsPayload)(localData, address);
|
|
24
29
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings`;
|
|
25
30
|
return zeniAPI
|
|
@@ -40,7 +45,11 @@ const submitInvoicingBrandingFormEpic = (actions$, state$, zeniAPI) => actions$.
|
|
|
40
45
|
? [(0, fileReducer_1.updateFiles)({ files: [savedLogoFile] })]
|
|
41
46
|
: []),
|
|
42
47
|
(0, settingsViewReducer_1.saveInvoicingSettingsSuccess)(response.data),
|
|
43
|
-
(
|
|
48
|
+
...(savedAddress == null
|
|
49
|
+
? [
|
|
50
|
+
(0, addressViewReducer_1.resetNewAddressDataInLocalStore)(invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE),
|
|
51
|
+
]
|
|
52
|
+
: []),
|
|
44
53
|
];
|
|
45
54
|
}
|
|
46
55
|
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, } = action.payload;
|
|
22
|
+
const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, businessProfile, } = action.payload;
|
|
23
23
|
const { onboardingCustomerViewState } = state$.value;
|
|
24
24
|
const { companyDetails, primaryContactDetails, companyOfficerUpdateStatus, currentStep, currentSubStep, } = onboardingCustomerViewState;
|
|
25
25
|
const companyLocalData = companyDetails.localData;
|
|
@@ -31,12 +31,17 @@ 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;
|
|
34
35
|
if (companyLocalData != null) {
|
|
35
|
-
if (isBillingAddressUpdate === true &&
|
|
36
|
-
newAddressState?.subscription_billing_address.addressToCreate != null) {
|
|
37
|
-
payload = prepareEditBillingAddressPayload(companyLocalData, newAddressState.subscription_billing_address.addressToCreate);
|
|
38
|
-
}
|
|
39
36
|
const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, []);
|
|
37
|
+
const billingAddressToCreate = isBillingAddressUpdate === true
|
|
38
|
+
? newAddressState?.subscription_billing_address.addressToCreate
|
|
39
|
+
: undefined;
|
|
40
|
+
if (billingAddressToCreate != null || businessProfile != null) {
|
|
41
|
+
payload = prepareEditBillingAddressPayload(companyLocalData, billingAddressToCreate, businessProfile != null
|
|
42
|
+
? toBusinessProfilePayload(businessProfile, companyView?.company.company.incInfo)
|
|
43
|
+
: {});
|
|
44
|
+
}
|
|
40
45
|
const companyAddressToCreate = newAddressState?.company_address?.addressToCreate;
|
|
41
46
|
const registeredAddressToCreate = newAddressState?.company_registered_address?.addressToCreate;
|
|
42
47
|
const addressType = officerType
|
|
@@ -59,7 +64,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
59
64
|
// different payloads — currentSubStep is the source of truth here.
|
|
60
65
|
const isOfficerSave = currentStep === 'verification' &&
|
|
61
66
|
currentSubStep === 'company_officer';
|
|
62
|
-
if (isBillingAddressUpdate === false) {
|
|
67
|
+
if (isBillingAddressUpdate === false && businessProfile == null) {
|
|
63
68
|
if (isOfficerSave) {
|
|
64
69
|
payload = {
|
|
65
70
|
company: toBusinessVerificationMinimalCompanyDataPayload(companyLocalData),
|
|
@@ -73,7 +78,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
|
-
const section =
|
|
81
|
+
const section = isSetupBillingSave
|
|
77
82
|
? 'setup_billing'
|
|
78
83
|
: isOfficerSave
|
|
79
84
|
? 'company_officer'
|
|
@@ -88,12 +93,12 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
88
93
|
save: 'onboarding_customer_business_verification_save',
|
|
89
94
|
},
|
|
90
95
|
setup_billing: {
|
|
91
|
-
save: '
|
|
92
|
-
sendForVerification: '
|
|
96
|
+
save: 'common',
|
|
97
|
+
sendForVerification: 'common',
|
|
93
98
|
},
|
|
94
99
|
};
|
|
95
100
|
let messageSection;
|
|
96
|
-
if (
|
|
101
|
+
if (isSetupBillingSave) {
|
|
97
102
|
messageSection = messageSectionMapper[section].save;
|
|
98
103
|
}
|
|
99
104
|
else if (sendForVerification === true) {
|
|
@@ -177,13 +182,28 @@ const toBusinessVerificationMinimalCompanyDataPayload = (companyLocalData) => {
|
|
|
177
182
|
}
|
|
178
183
|
return company;
|
|
179
184
|
};
|
|
180
|
-
const
|
|
185
|
+
const toBusinessProfilePayload = (businessProfile, persistedIncInfo) => {
|
|
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) => {
|
|
181
199
|
const { syncToken } = companyDetailsLocalData;
|
|
182
|
-
const addressPayload = (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address);
|
|
183
200
|
return {
|
|
184
201
|
company: {
|
|
185
202
|
sync_token: syncToken,
|
|
186
|
-
|
|
203
|
+
...(address != null && {
|
|
204
|
+
subscription_billing_address: (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address),
|
|
205
|
+
}),
|
|
206
|
+
...businessProfilePayload,
|
|
187
207
|
},
|
|
188
208
|
};
|
|
189
209
|
};
|