@zeniai/client-epic-state 5.2.72-beta0ND → 5.2.73
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/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/jeSchedulesTypes.d.ts +4 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/epic.d.ts +2 -3
- package/lib/epic.js +1 -3
- 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/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +9 -6
- package/lib/esm/reducer.js +7 -4
- 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/editInvoicingSubscriptionDetailViewSelector.js +1 -27
- 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 +22 -55
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +20 -1
- 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 +13 -9
- package/lib/index.js +45 -39
- package/lib/reducer.d.ts +2 -1
- package/lib/reducer.js +7 -4
- package/lib/rootStateTypes.d.ts +5 -3
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- 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 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +2 -29
- 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 +15 -33
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +23 -57
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +22 -0
- 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/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/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/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 +26 -1
- package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +0 -12
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -37
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingSubscriptionFormView = exports.
|
|
3
|
+
exports.getInvoicingSubscriptionFormView = exports.getInvoicingItemsAllowedForPlan = exports.getEditInvoicingSubscriptionDetailViewState = void 0;
|
|
4
4
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
5
5
|
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
6
6
|
const invoicingSubscriptionSelector_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector");
|
|
@@ -91,28 +91,6 @@ const getInvoicingItemsAllowedForPlan = (products, plan) => {
|
|
|
91
91
|
return products.filter((product) => product.itemID != null && allowedItemIDs.includes(product.itemID));
|
|
92
92
|
};
|
|
93
93
|
exports.getInvoicingItemsAllowedForPlan = getInvoicingItemsAllowedForPlan;
|
|
94
|
-
// Years count as months so they compare; any other unit only meets itself.
|
|
95
|
-
const billingPeriodInCommonUnit = (pricePoint) => {
|
|
96
|
-
const { period, periodUnit } = pricePoint;
|
|
97
|
-
if (period == null || periodUnit == null || periodUnit === '') {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
return periodUnit === 'year'
|
|
101
|
-
? { count: period * 12, unit: 'month' }
|
|
102
|
-
: { count: period, unit: periodUnit };
|
|
103
|
-
};
|
|
104
|
-
// The add-on's period must divide the plan's (create 422s otherwise); fails open when they cannot be compared.
|
|
105
|
-
const isInvoicingAddonPeriodCompatible = (addon, plan) => {
|
|
106
|
-
const addonPeriod = billingPeriodInCommonUnit(addon);
|
|
107
|
-
const planPeriod = plan != null ? billingPeriodInCommonUnit(plan) : undefined;
|
|
108
|
-
if (addonPeriod == null ||
|
|
109
|
-
planPeriod == null ||
|
|
110
|
-
addonPeriod.unit !== planPeriod.unit) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
return addonPeriod.count > 0 && planPeriod.count % addonPeriod.count === 0;
|
|
114
|
-
};
|
|
115
|
-
exports.isInvoicingAddonPeriodCompatible = isInvoicingAddonPeriodCompatible;
|
|
116
94
|
/**
|
|
117
95
|
* A price row can only be subscribed by its price code, so one without a code
|
|
118
96
|
* is not an option the form can offer.
|
|
@@ -201,12 +179,7 @@ const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID) => {
|
|
|
201
179
|
// pickers offer only those: subscription create rejects the rest with a 422,
|
|
202
180
|
// and an option that can only fail is not a choice. The applicability rides
|
|
203
181
|
// on the price rows already in the store, so this is a join, not a refetch.
|
|
204
|
-
const
|
|
205
|
-
// Add-ons also have to bill on the plan's cadence; charges are one-time.
|
|
206
|
-
const allowedCatalogPrices = (0, exports.getInvoicingItemsAllowedForPlan)((0, invoicingCatalogListViewSelector_1.getInvoicingCatalogPrices)(catalogListView.products), selectedPlanPrice)
|
|
207
|
-
.filter(hasInvoicingPriceCode)
|
|
208
|
-
.filter((product) => product.itemType !== 'addon' ||
|
|
209
|
-
(0, exports.isInvoicingAddonPeriodCompatible)(product, selectedPlanPrice));
|
|
182
|
+
const allowedCatalogPrices = (0, exports.getInvoicingItemsAllowedForPlan)((0, invoicingCatalogListViewSelector_1.getInvoicingCatalogPrices)(catalogListView.products), planPrices.find((plan) => plan.priceCode === localData.planPriceCode)).filter(hasInvoicingPriceCode);
|
|
210
183
|
const catalogItemOptionsOfType = (itemType) => allowedCatalogPrices
|
|
211
184
|
.filter((product) => product.itemType === itemType)
|
|
212
185
|
.map(toInvoicingCatalogItemOption);
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts
CHANGED
|
@@ -6,9 +6,7 @@ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
|
6
6
|
import { RootState } from '../../../rootStateTypes';
|
|
7
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
8
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
9
|
-
import { invalidateInvoicingCustomerDetail } from '../editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
|
|
10
|
-
import { invalidateInvoiceListForCustomer } from '../invoiceList/invoiceListReducer';
|
|
11
9
|
import { addInvoicingSubscriptionToList } from '../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
|
|
12
10
|
import { submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons } from './editInvoicingSubscriptionDetailViewReducer';
|
|
13
|
-
export type ActionType = ReturnType<typeof submitInvoicingSubscriptionForm> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof addInvoicingSubscriptionToList> | ReturnType<typeof
|
|
11
|
+
export type ActionType = ReturnType<typeof submitInvoicingSubscriptionForm> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof addInvoicingSubscriptionToList> | ReturnType<typeof openSnackbar>;
|
|
14
12
|
export declare const saveInvoicingSubscriptionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js
CHANGED
|
@@ -10,8 +10,6 @@ const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
|
|
|
10
10
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
11
11
|
const responsePayload_1 = require("../../../responsePayload");
|
|
12
12
|
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
13
|
-
const editInvoicingCustomerDetailViewReducer_1 = require("../editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer");
|
|
14
|
-
const invoiceListReducer_1 = require("../invoiceList/invoiceListReducer");
|
|
15
13
|
const invoicingSubscriptionListViewReducer_1 = require("../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer");
|
|
16
14
|
const editInvoicingSubscriptionDetailViewPayload_1 = require("./editInvoicingSubscriptionDetailViewPayload");
|
|
17
15
|
const editInvoicingSubscriptionDetailViewReducer_1 = require("./editInvoicingSubscriptionDetailViewReducer");
|
|
@@ -91,9 +89,7 @@ const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
91
89
|
resultActions.push((0, invoicingSubscriptionListViewReducer_1.addInvoicingSubscriptionToList)({
|
|
92
90
|
id: saved.id,
|
|
93
91
|
status: saved.status,
|
|
94
|
-
})
|
|
95
|
-
// The service may bill the first invoice on create.
|
|
96
|
-
(0, editInvoicingCustomerDetailViewReducer_1.invalidateInvoicingCustomerDetail)({ id: saved.customer_id }), (0, invoiceListReducer_1.invalidateInvoiceListForCustomer)({ customerId: saved.customer_id }));
|
|
92
|
+
}));
|
|
97
93
|
}
|
|
98
94
|
resultActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
99
95
|
messageSection: 'invoicing_subscription_saved',
|
|
@@ -45,8 +45,6 @@ export declare const fetchInvoiceList: import("@reduxjs/toolkit").ActionCreatorW
|
|
|
45
45
|
}, "invoicingInvoiceList/updateInvoiceList">, updateInvoiceListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingInvoiceList/updateInvoiceListFailure">, fetchInvoiceCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingInvoiceList/fetchInvoiceCounts">, updateInvoiceCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingInvoiceList/updateInvoiceCounts">, updateInvoiceCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingInvoiceList/updateInvoiceCountsFailure">, fetchInvoiceKPIs: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingInvoiceList/fetchInvoiceKPIs">, updateInvoiceKPIs: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingInvoiceKPIs, "invoicingInvoiceList/updateInvoiceKPIs">, updateInvoiceKPIsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingInvoiceList/updateInvoiceKPIsFailure">, updateInvoiceListFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoiceListFilters, "invoicingInvoiceList/updateInvoiceListFilters">, setInvoiceActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "voided" | "partially_paid" | "payment_due" | "not_paid" | "all", "invoicingInvoiceList/setInvoiceActiveTab">, addInvoiceToList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
46
|
id: ID;
|
|
47
47
|
status: InvoicingInvoiceStatus;
|
|
48
|
-
}, "invoicingInvoiceList/addInvoiceToList"
|
|
49
|
-
customerId: ID;
|
|
50
|
-
}, "invoicingInvoiceList/invalidateInvoiceListForCustomer">;
|
|
48
|
+
}, "invoicingInvoiceList/addInvoiceToList">;
|
|
51
49
|
declare const _default: import("redux").Reducer<InvoiceListState>;
|
|
52
50
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.addInvoiceToList = exports.setInvoiceActiveTab = exports.updateInvoiceListFilters = exports.updateInvoiceKPIsFailure = exports.updateInvoiceKPIs = exports.fetchInvoiceKPIs = exports.updateInvoiceCountsFailure = exports.updateInvoiceCounts = exports.fetchInvoiceCounts = exports.updateInvoiceListFailure = exports.updateInvoiceList = exports.fetchInvoiceListPage = exports.fetchInvoiceList = exports.initialState = exports.sameInvoiceListQuery = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../../rootActions");
|
|
7
7
|
const invoiceListState_1 = require("./invoiceListState");
|
|
@@ -129,13 +129,6 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
129
129
|
draft.kpisFetchState.fetchState = 'Error';
|
|
130
130
|
draft.kpisFetchState.error = action.payload;
|
|
131
131
|
},
|
|
132
|
-
// Counts are fetched under the same customer filter, so they go stale with the tabs.
|
|
133
|
-
invalidateInvoiceListForCustomer(draft, action) {
|
|
134
|
-
if (draft.filters.customerId === action.payload.customerId) {
|
|
135
|
-
draft.invoiceByTab = (0, invoiceListState_1.makeInvoiceByTab)();
|
|
136
|
-
draft.countsFetchState = { fetchState: 'Not-Started', error: undefined };
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
132
|
updateInvoiceListFilters(draft, action) {
|
|
140
133
|
draft.filters = action.payload;
|
|
141
134
|
},
|
|
@@ -178,5 +171,5 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
178
171
|
});
|
|
179
172
|
},
|
|
180
173
|
});
|
|
181
|
-
_a = invoiceList.actions, exports.fetchInvoiceList = _a.fetchInvoiceList, exports.fetchInvoiceListPage = _a.fetchInvoiceListPage, exports.updateInvoiceList = _a.updateInvoiceList, exports.updateInvoiceListFailure = _a.updateInvoiceListFailure, exports.fetchInvoiceCounts = _a.fetchInvoiceCounts, exports.updateInvoiceCounts = _a.updateInvoiceCounts, exports.updateInvoiceCountsFailure = _a.updateInvoiceCountsFailure, exports.fetchInvoiceKPIs = _a.fetchInvoiceKPIs, exports.updateInvoiceKPIs = _a.updateInvoiceKPIs, exports.updateInvoiceKPIsFailure = _a.updateInvoiceKPIsFailure, exports.updateInvoiceListFilters = _a.updateInvoiceListFilters, exports.setInvoiceActiveTab = _a.setInvoiceActiveTab, exports.addInvoiceToList = _a.addInvoiceToList
|
|
174
|
+
_a = invoiceList.actions, exports.fetchInvoiceList = _a.fetchInvoiceList, exports.fetchInvoiceListPage = _a.fetchInvoiceListPage, exports.updateInvoiceList = _a.updateInvoiceList, exports.updateInvoiceListFailure = _a.updateInvoiceListFailure, exports.fetchInvoiceCounts = _a.fetchInvoiceCounts, exports.updateInvoiceCounts = _a.updateInvoiceCounts, exports.updateInvoiceCountsFailure = _a.updateInvoiceCountsFailure, exports.fetchInvoiceKPIs = _a.fetchInvoiceKPIs, exports.updateInvoiceKPIs = _a.updateInvoiceKPIs, exports.updateInvoiceKPIsFailure = _a.updateInvoiceKPIsFailure, exports.updateInvoiceListFilters = _a.updateInvoiceListFilters, exports.setInvoiceActiveTab = _a.setInvoiceActiveTab, exports.addInvoiceToList = _a.addInvoiceToList;
|
|
182
175
|
exports.default = invoiceList.reducer;
|
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 { updateInvoicingPlans } from '../../../../entity/invoicing/plan/planReducer';
|
|
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 updateInvoicingPlans>;
|
|
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 { updateInvoicingPlans } from '../../../../entity/invoicing/plan/planReducer';
|
|
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 updateInvoicingPlans>;
|
|
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 planReducer_1 = require("../../../../entity/invoicing/plan/planReducer");
|
|
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, planReducer_1.updateInvoicingPlans)(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 { updateInvoicingPlans } from '../../../../entity/invoicing/plan/planReducer';
|
|
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 updateInvoicingPlans>;
|
|
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 planReducer_1 = require("../../../../entity/invoicing/plan/planReducer");
|
|
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, planReducer_1.updateInvoicingPlans)(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';
|
|
2
1
|
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<InvoicingPlanPayload>>;
|
|
5
|
+
export type InvoicingCatalogProductListResponse = ZeniAPIResponse<InvoicingPaginatedList<InvoicingPlanPayload>>;
|
|
6
6
|
export type InvoicingCatalogCountsResponse = ZeniAPIResponse<InvoicingListCounts>;
|
|
@@ -1,48 +1,31 @@
|
|
|
1
|
-
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
3
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
|
+
import { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
|
|
5
|
+
import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
6
6
|
import { RootState } from '../../../rootStateTypes';
|
|
7
7
|
import { InvoicingListSort } from '../invoicingApiHelper';
|
|
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
|
-
}
|
|
8
|
+
import { InvoicingCatalogPlanFilters, InvoicingCatalogProductFilters, InvoicingProductColumnConfig } from './invoicingCatalogListViewState';
|
|
30
9
|
export interface InvoicingCatalogListView extends SelectorView {
|
|
10
|
+
/** Config-owned; folded in so the screen reads one selector. */
|
|
11
|
+
catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
|
|
31
12
|
count: InvoicingListCounts;
|
|
32
13
|
countsFetchState: FetchStateAndError;
|
|
33
14
|
planFilters: InvoicingCatalogPlanFilters;
|
|
34
15
|
planNextCursor: string | null;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
plans: InvoicingCatalogItem[];
|
|
16
|
+
plans: InvoicingPlan[];
|
|
17
|
+
productColumns: InvoicingProductColumnConfig[];
|
|
38
18
|
productFetchState: FetchStateAndError;
|
|
39
19
|
productFilters: InvoicingCatalogProductFilters;
|
|
40
20
|
productNextCursor: string | null;
|
|
41
|
-
|
|
42
|
-
productRows: InvoicingCatalogPlanRow[];
|
|
43
|
-
products: InvoicingCatalogItem[];
|
|
21
|
+
products: InvoicingPlan[];
|
|
44
22
|
planSort?: InvoicingListSort;
|
|
45
23
|
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;
|
|
46
29
|
}
|
|
47
30
|
/**
|
|
48
31
|
* Flatten catalog items into the price rows the pickers render.
|
|
@@ -54,8 +37,7 @@ export interface InvoicingCatalogListView extends SelectorView {
|
|
|
54
37
|
* written after the spread so the item's own rule wins over any stale copy a
|
|
55
38
|
* price point payload may carry.
|
|
56
39
|
*/
|
|
57
|
-
export declare const getInvoicingCatalogPrices: (items:
|
|
58
|
-
export declare const getInvoicingCatalogPlanRows: (items: InvoicingCatalogItem[]) => InvoicingCatalogPlanRow[];
|
|
40
|
+
export declare const getInvoicingCatalogPrices: (items: InvoicingPlan[]) => InvoicingProduct[];
|
|
59
41
|
/**
|
|
60
42
|
* Bundled read view for the single catalog page (plans + products tabs).
|
|
61
43
|
* Memoized over the plan + product entity slices and the list-view slice so the
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingCatalogListView = exports.
|
|
3
|
+
exports.getInvoicingCatalogListView = exports.getInvoicingCatalogPrices = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const
|
|
5
|
+
const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
|
|
6
|
+
const runningInvoicingActionId_1 = require("../runningInvoicingActionId");
|
|
7
|
+
const invoicingCatalogListViewState_1 = require("./invoicingCatalogListViewState");
|
|
6
8
|
/**
|
|
7
9
|
* Flatten catalog items into the price rows the pickers render.
|
|
8
10
|
*
|
|
@@ -24,64 +26,28 @@ const getInvoicingCatalogPrices = (items) => items.flatMap((item) => (item.subFa
|
|
|
24
26
|
productCode: item.productCode,
|
|
25
27
|
})));
|
|
26
28
|
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;
|
|
60
29
|
/**
|
|
61
30
|
* Bundled read view for the single catalog page (plans + products tabs).
|
|
62
31
|
* Memoized over the plan + product entity slices and the list-view slice so the
|
|
63
32
|
* denormalized arrays keep referential identity. The base `fetchState`/`error`
|
|
64
33
|
* track the plan list; the product list has its own `productFetchState`.
|
|
65
34
|
*/
|
|
66
|
-
exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
version: 1.0,
|
|
86
|
-
};
|
|
87
|
-
});
|
|
35
|
+
exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (state) => state.invoicingConfigViewState.catalogItemLifecycleActionOptions, (state) => state.editInvoicingCatalogItemDetailViewState.actionStateById, (planState, listViewState, catalogItemLifecycleActionOptions, actionStateById) => ({
|
|
36
|
+
catalogItemLifecycleActionOptions,
|
|
37
|
+
runningActionId: (0, runningInvoicingActionId_1.runningInvoicingActionId)(actionStateById),
|
|
38
|
+
plans: (0, planSelector_1.getInvoicingPlansByIds)(planState, listViewState.planIds),
|
|
39
|
+
planSort: listViewState.planSort,
|
|
40
|
+
productColumns: invoicingCatalogListViewState_1.INVOICING_PRODUCT_COLUMNS,
|
|
41
|
+
products: (0, planSelector_1.getInvoicingPlansByIds)(planState, listViewState.productIds),
|
|
42
|
+
productSort: listViewState.productSort,
|
|
43
|
+
count: listViewState.counts,
|
|
44
|
+
countsFetchState: listViewState.countsFetchState,
|
|
45
|
+
planFilters: listViewState.planFilters,
|
|
46
|
+
planNextCursor: listViewState.planNextCursor,
|
|
47
|
+
productFilters: listViewState.productFilters,
|
|
48
|
+
productNextCursor: listViewState.productNextCursor,
|
|
49
|
+
productFetchState: listViewState.productFetchState,
|
|
50
|
+
fetchState: listViewState.fetchState,
|
|
51
|
+
error: listViewState.error,
|
|
52
|
+
version: 1.0,
|
|
53
|
+
}));
|
|
@@ -1,6 +1,21 @@
|
|
|
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[];
|
|
4
19
|
export interface InvoicingCatalogPlanFilters {
|
|
5
20
|
search?: string;
|
|
6
21
|
status?: string;
|
|
@@ -1,2 +1,24 @@
|
|
|
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<"
|
|
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" | "paused" | "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) => "
|
|
23
|
+
export declare const toInvoicingDunningCaseTabId: (v: string) => "cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "paused" | "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<"active" | "cancelled" | "future" | "paused" | "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) => "active" | "cancelled" | "future" | "paused" | "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). */
|
|
@@ -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;
|
|
@@ -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;
|