@zeniai/client-epic-state 5.1.97 → 5.1.99
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/invoicing/invoicingCommonPayload.d.ts +12 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +18 -0
- package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionPayload.d.ts +1 -1
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +16 -0
- package/lib/esm/epic.js +1 -5
- package/lib/esm/index.js +16 -18
- package/lib/esm/reducer.js +0 -3
- package/lib/esm/view/dashboard/dashboardEpic.js +0 -20
- package/lib/esm/view/dashboard/dashboardReducer.js +1 -13
- package/lib/esm/view/dashboard/dashboardSelector.js +2 -7
- package/lib/esm/view/invoicing/auditView/auditViewSelector.js +4 -0
- package/lib/esm/view/invoicing/couponView/couponViewSelector.js +18 -8
- package/lib/esm/view/invoicing/couponView/couponViewState.js +0 -9
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -0
- package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +4 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteSelector.js +4 -2
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +7 -6
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +3 -19
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +10 -5
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +6 -4
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +0 -17
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +5 -0
- package/lib/esm/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +2 -1
- package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +18 -17
- package/lib/esm/view/invoicing/invoiceList/invoiceListSelector.js +12 -4
- package/lib/esm/view/invoicing/invoiceList/invoiceListState.js +13 -9
- package/lib/esm/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +5 -1
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +2 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +26 -0
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +9 -0
- package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +9 -3
- package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +0 -9
- package/lib/esm/view/invoicing/invoicingCustomerDetailView/fetchInvoicingCustomerDetailPageEpic.js +2 -2
- package/lib/esm/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +1 -1
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +9 -3
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +0 -9
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +8 -3
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +1 -9
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +11 -3
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -9
- package/lib/esm/view/invoicing/invoicingTabHelper.js +27 -0
- package/lib/esm/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +2 -1
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +5 -5
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +12 -4
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +11 -9
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +1 -8
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +5 -1
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +5 -2
- package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -26
- package/lib/esm/view/invoicing/recordPayment/recordPaymentSelector.js +26 -6
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +8 -1
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +1 -67
- package/lib/index.d.ts +17 -20
- package/lib/index.js +41 -65
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/dashboard/dashboardEpic.d.ts +1 -3
- package/lib/view/dashboard/dashboardEpic.js +0 -20
- package/lib/view/dashboard/dashboardReducer.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.js +2 -14
- package/lib/view/dashboard/dashboardSelector.d.ts +0 -1
- package/lib/view/dashboard/dashboardSelector.js +2 -7
- package/lib/view/dashboard/dashboardState.d.ts +0 -1
- package/lib/view/invoicing/auditView/auditViewSelector.d.ts +4 -0
- package/lib/view/invoicing/auditView/auditViewSelector.js +4 -0
- package/lib/view/invoicing/couponView/couponViewSelector.d.ts +5 -1
- package/lib/view/invoicing/couponView/couponViewSelector.js +17 -7
- package/lib/view/invoicing/couponView/couponViewState.d.ts +0 -7
- package/lib/view/invoicing/couponView/couponViewState.js +1 -10
- package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -0
- package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +4 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.d.ts +3 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.js +4 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +6 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +5 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +6 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.d.ts +3 -6
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +4 -20
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +9 -7
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +10 -5
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +4 -3
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +5 -3
- package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.d.ts +0 -8
- package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +1 -18
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +5 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +5 -0
- package/lib/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +2 -1
- package/lib/view/invoicing/invoiceList/invoiceListReducer.js +17 -16
- package/lib/view/invoicing/invoiceList/invoiceListSelector.d.ts +3 -1
- package/lib/view/invoicing/invoiceList/invoiceListSelector.js +11 -3
- package/lib/view/invoicing/invoiceList/invoiceListState.d.ts +13 -9
- package/lib/view/invoicing/invoiceList/invoiceListState.js +15 -10
- package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts +9 -1
- package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +5 -1
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +3 -1
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +2 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +13 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +26 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +19 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +11 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +13 -0
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.d.ts +8 -1
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +8 -2
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.d.ts +0 -7
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +1 -10
- package/lib/view/invoicing/invoicingCustomerDetailView/fetchInvoicingCustomerDetailPageEpic.js +2 -2
- package/lib/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +1 -1
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.d.ts +3 -1
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +8 -2
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +0 -7
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +1 -10
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.d.ts +3 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +7 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -9
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +2 -10
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +7 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +10 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +0 -7
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +1 -10
- package/lib/view/invoicing/invoicingTabHelper.d.ts +27 -0
- package/lib/view/invoicing/invoicingTabHelper.js +30 -0
- package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +2 -1
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +4 -4
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.d.ts +8 -0
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +11 -3
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.d.ts +10 -10
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +13 -10
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.d.ts +0 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +2 -9
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +2 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +5 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +3 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +4 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +6 -0
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.d.ts +0 -6
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +1 -27
- package/lib/view/invoicing/recordPayment/recordPaymentSelector.d.ts +3 -2
- package/lib/view/invoicing/recordPayment/recordPaymentSelector.js +26 -6
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +12 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +8 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -68
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -3
- package/package.json +1 -1
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
- package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInvoicingCouponFormView = exports.getEditInvoicingCouponDetailViewState = void 0;
|
|
4
|
-
const couponConstants_1 = require("../../../entity/invoicing/coupon/couponConstants");
|
|
5
4
|
const couponSelector_1 = require("../../../entity/invoicing/coupon/couponSelector");
|
|
5
|
+
const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
|
|
6
|
+
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
6
7
|
const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetailViewState");
|
|
7
8
|
/**
|
|
8
9
|
* Bundled view for the discount create/edit form: the save fetch state/error,
|
|
@@ -11,7 +12,10 @@ const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetai
|
|
|
11
12
|
*/
|
|
12
13
|
const getEditInvoicingCouponDetailViewState = (state, couponId) => {
|
|
13
14
|
const { error, fetchState, savedCouponId } = state.editInvoicingCouponDetailViewState;
|
|
15
|
+
const { discountLifecycleActionOptions, fetchState: configFetchState } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
14
16
|
return {
|
|
17
|
+
configFetchState,
|
|
18
|
+
discountLifecycleActionOptions,
|
|
15
19
|
coupon: couponId != null
|
|
16
20
|
? (0, couponSelector_1.getInvoicingCouponById)(state.invoicingCouponState, couponId)
|
|
17
21
|
: undefined,
|
|
@@ -35,14 +39,15 @@ const getInvoicingCouponFormView = (state, couponId) => {
|
|
|
35
39
|
? (editDraftById[couponId] ??
|
|
36
40
|
(0, editInvoicingCouponDetailViewState_1.entityToInvoicingCouponFormLocalData)(base.coupon))
|
|
37
41
|
: newCouponDraft;
|
|
42
|
+
const { billingPeriodUnitOptions, discountApplyOnOptions, discountDurationTypeOptions, discountTypeOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
38
43
|
return {
|
|
39
44
|
...base,
|
|
40
|
-
applyOnOptions:
|
|
41
|
-
discountTypeOptions:
|
|
42
|
-
durationTypeOptions:
|
|
45
|
+
applyOnOptions: discountApplyOnOptions.map(invoicingCommonPayload_1.toInvoicingFormOption),
|
|
46
|
+
discountTypeOptions: discountTypeOptions.map(invoicingCommonPayload_1.toInvoicingFormOption),
|
|
47
|
+
durationTypeOptions: discountDurationTypeOptions.map(invoicingCommonPayload_1.toInvoicingFormOption),
|
|
43
48
|
localData,
|
|
44
49
|
mode: couponId != null ? 'edit' : 'create',
|
|
45
|
-
periodUnitOptions:
|
|
50
|
+
periodUnitOptions: billingPeriodUnitOptions.map(invoicingCommonPayload_1.toInvoicingFormOption),
|
|
46
51
|
};
|
|
47
52
|
};
|
|
48
53
|
exports.getInvoicingCouponFormView = getInvoicingCouponFormView;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
4
|
import { RootState } from '../../../reducer';
|
|
4
5
|
import { InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
|
|
5
6
|
export interface InvoicingCustomerFormView extends SelectorView {
|
|
6
|
-
|
|
7
|
+
customerTypeOptions: InvoicingNamedOption[];
|
|
7
8
|
localData: InvoicingCustomerFormLocalData;
|
|
8
9
|
mode: 'create' | 'edit';
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
netTermDayOptions: InvoicingNamedOption[];
|
|
11
|
+
taxabilityOptions: InvoicingNamedOption[];
|
|
11
12
|
billingAddressId?: ID;
|
|
12
13
|
billingAddressLabel?: string;
|
|
13
14
|
savedCustomerId?: ID;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInvoicingCustomerFormView = void 0;
|
|
4
4
|
const invoicingCustomerSelector_1 = require("../../../entity/invoicing/invoicingCustomer/invoicingCustomerSelector");
|
|
5
5
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
6
|
+
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
6
7
|
const invoicingCustomerFormConfig_1 = require("./invoicingCustomerFormConfig");
|
|
7
8
|
/**
|
|
8
9
|
* Bundled view for the customer create/edit form. Exposes the draft `localData`
|
|
@@ -29,12 +30,13 @@ const getInvoicingCustomerFormView = (state, invoicingCustomerID) => {
|
|
|
29
30
|
const billingAddressLabel = newAddress?.addressToCreate != null
|
|
30
31
|
? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
|
|
31
32
|
: undefined;
|
|
33
|
+
const { customerTypeOptions, netTermDayOptions, taxabilityOptions } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
32
34
|
return {
|
|
33
|
-
|
|
35
|
+
customerTypeOptions,
|
|
34
36
|
localData,
|
|
35
37
|
mode,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
netTermDayOptions,
|
|
39
|
+
taxabilityOptions,
|
|
38
40
|
billingAddressId,
|
|
39
41
|
billingAddressLabel,
|
|
40
42
|
savedCustomerId,
|
|
@@ -2,14 +2,6 @@ import { InvoicingCustomer } from '../../../entity/invoicing/invoicingCustomer/i
|
|
|
2
2
|
import { InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
|
|
3
3
|
/** `AddressType` key used when the customer form opens the shared Address screen. */
|
|
4
4
|
export declare const INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE: "invoicing_customer_billing_address";
|
|
5
|
-
/**
|
|
6
|
-
* Canonical option value sets for the customer form. CES owns the values;
|
|
7
|
-
* web-components maps each value to a localized label (same split as the
|
|
8
|
-
* invoicing list column/tab config).
|
|
9
|
-
*/
|
|
10
|
-
export declare const INVOICING_CUSTOMER_TYPE_VALUES: readonly ["business", "residential"];
|
|
11
|
-
export declare const INVOICING_TAXABILITY_VALUES: readonly ["taxable", "exempt"];
|
|
12
|
-
export declare const INVOICING_NET_TERM_DAY_VALUES: readonly ["0", "15", "30", "45", "60"];
|
|
13
5
|
export declare const initialInvoicingCustomerFormLocalData: InvoicingCustomerFormLocalData;
|
|
14
6
|
/** Seed the form draft from an existing customer entity (edit mode). */
|
|
15
7
|
export declare const entityToInvoicingCustomerFormLocalData: (customer?: InvoicingCustomer) => InvoicingCustomerFormLocalData;
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityToInvoicingCustomerFormLocalData = exports.initialInvoicingCustomerFormLocalData = exports.
|
|
3
|
+
exports.entityToInvoicingCustomerFormLocalData = exports.initialInvoicingCustomerFormLocalData = exports.INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE = void 0;
|
|
4
4
|
/** `AddressType` key used when the customer form opens the shared Address screen. */
|
|
5
5
|
exports.INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE = 'invoicing_customer_billing_address';
|
|
6
|
-
/**
|
|
7
|
-
* Canonical option value sets for the customer form. CES owns the values;
|
|
8
|
-
* web-components maps each value to a localized label (same split as the
|
|
9
|
-
* invoicing list column/tab config).
|
|
10
|
-
*/
|
|
11
|
-
exports.INVOICING_CUSTOMER_TYPE_VALUES = [
|
|
12
|
-
'business',
|
|
13
|
-
'residential',
|
|
14
|
-
];
|
|
15
|
-
exports.INVOICING_TAXABILITY_VALUES = ['taxable', 'exempt'];
|
|
16
|
-
exports.INVOICING_NET_TERM_DAY_VALUES = [
|
|
17
|
-
'0',
|
|
18
|
-
'15',
|
|
19
|
-
'30',
|
|
20
|
-
'45',
|
|
21
|
-
'60',
|
|
22
|
-
];
|
|
23
6
|
exports.initialInvoicingCustomerFormLocalData = {
|
|
24
7
|
autoCollection: true,
|
|
25
8
|
company: '',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
|
|
4
|
+
import { InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
5
|
import { InvoicingCustomer } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerState';
|
|
5
6
|
import { InvoicingSubscription } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionState';
|
|
6
7
|
import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
@@ -13,6 +14,10 @@ import { InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionD
|
|
|
13
14
|
* prefill the form.
|
|
14
15
|
*/
|
|
15
16
|
export interface EditInvoicingSubscriptionDetailView extends SelectorView {
|
|
17
|
+
/** Config-owned; folded in so the screen reads one selector. */
|
|
18
|
+
subscriptionCommercialEditAllowedFromStatuses: string[];
|
|
19
|
+
subscriptionLifecycleActionOptions: InvoicingSubscriptionLifecycleActionOption[];
|
|
20
|
+
subscriptionMetadataEditAllowedFromStatuses: string[];
|
|
16
21
|
savedSubscriptionId?: ID;
|
|
17
22
|
subscription?: InvoicingSubscription;
|
|
18
23
|
}
|
|
@@ -5,11 +5,16 @@ const invoicingSubscriptionSelector_1 = require("../../../entity/invoicing/invoi
|
|
|
5
5
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
6
6
|
const couponViewSelector_1 = require("../couponView/couponViewSelector");
|
|
7
7
|
const invoicingCatalogListViewSelector_1 = require("../invoicingCatalogListView/invoicingCatalogListViewSelector");
|
|
8
|
+
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
8
9
|
const invoicingCustomerListViewSelector_1 = require("../invoicingCustomerListView/invoicingCustomerListViewSelector");
|
|
9
10
|
const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
|
|
10
11
|
const getEditInvoicingSubscriptionDetailViewState = (state, invoicingSubscriptionID) => {
|
|
11
12
|
const { error, fetchState, savedSubscriptionId } = state.editInvoicingSubscriptionDetailViewState;
|
|
13
|
+
const { subscriptionCommercialEditAllowedFromStatuses, subscriptionLifecycleActionOptions, subscriptionMetadataEditAllowedFromStatuses, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
12
14
|
return {
|
|
15
|
+
subscriptionCommercialEditAllowedFromStatuses,
|
|
16
|
+
subscriptionLifecycleActionOptions,
|
|
17
|
+
subscriptionMetadataEditAllowedFromStatuses,
|
|
13
18
|
subscription: invoicingSubscriptionID != null
|
|
14
19
|
? (0, invoicingSubscriptionSelector_1.getInvoicingSubscriptionById)(state.invoicingSubscriptionState, invoicingSubscriptionID)
|
|
15
20
|
: undefined,
|
|
@@ -4,6 +4,7 @@ exports.fetchInvoiceListPageEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const invoiceListReducer_1 = require("./invoiceListReducer");
|
|
7
|
+
const invoiceListState_1 = require("./invoiceListState");
|
|
7
8
|
/**
|
|
8
9
|
* Fetch unless the endpoint is already loaded or in flight — or always when the
|
|
9
10
|
* caller forces a refresh via `cacheOverride` (e.g. on a filter/sort change).
|
|
@@ -19,7 +20,7 @@ const shouldFetch = (fetchStateAndError, cacheOverride) => cacheOverride ||
|
|
|
19
20
|
const fetchInvoiceListPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(invoiceListReducer_1.fetchInvoiceListPage.match), (0, operators_1.mergeMap)((action) => {
|
|
20
21
|
const { cacheOverride, filters, sort } = action.payload;
|
|
21
22
|
const state = state$.value.invoicingInvoiceListState;
|
|
22
|
-
const activeTabState = state.invoiceByTab[state.activeTab];
|
|
23
|
+
const activeTabState = state.invoiceByTab[state.activeTab] ?? (0, invoiceListState_1.makeInvoiceTabState)();
|
|
23
24
|
const pageActions = [];
|
|
24
25
|
if (shouldFetch({ fetchState: activeTabState.fetchState, error: activeTabState.error }, cacheOverride)) {
|
|
25
26
|
pageActions.push((0, invoiceListReducer_1.fetchInvoiceList)({ filters, sort }));
|
|
@@ -20,13 +20,17 @@ const sameInvoiceListQuery = (a, b) => a.filters.customerId === b.filters.custom
|
|
|
20
20
|
a.sort?.dir === b.sort?.dir;
|
|
21
21
|
exports.sameInvoiceListQuery = sameInvoiceListQuery;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* The status tab a newly created invoice belongs in — always its own status.
|
|
24
|
+
*
|
|
25
|
+
* This used to gate on `ALL_INVOICING_INVOICE_TAB_IDS`, which left a status the
|
|
26
|
+
* config added but this build's union does not know getting its count
|
|
27
|
+
* incremented while the id landed only in `all`: the tab rendered with a
|
|
28
|
+
* non-zero count and an empty list until a refetch. Per-tab cache entries are
|
|
29
|
+
* created on demand now, so every status is a valid key and the add path agrees
|
|
30
|
+
* with the count path. A status with no rendered tab just caches an entry nobody
|
|
31
|
+
* reads.
|
|
26
32
|
*/
|
|
27
|
-
const statusToTabId = (status) =>
|
|
28
|
-
? status
|
|
29
|
-
: undefined;
|
|
33
|
+
const statusToTabId = (status) => status;
|
|
30
34
|
exports.initialState = {
|
|
31
35
|
activeTab: 'all',
|
|
32
36
|
invoiceByTab: (0, invoiceListState_1.makeInvoiceByTab)(),
|
|
@@ -42,7 +46,7 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
42
46
|
reducers: {
|
|
43
47
|
fetchInvoiceList: {
|
|
44
48
|
reducer(draft, action) {
|
|
45
|
-
const tab = draft.invoiceByTab
|
|
49
|
+
const tab = (0, invoiceListState_1.invoiceTabStateFor)(draft.invoiceByTab, draft.activeTab);
|
|
46
50
|
if (!action.payload.keepExistingListItems) {
|
|
47
51
|
tab.invoiceIds = [];
|
|
48
52
|
tab.nextCursor = null;
|
|
@@ -85,7 +89,7 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
85
89
|
},
|
|
86
90
|
},
|
|
87
91
|
updateInvoiceList(draft, action) {
|
|
88
|
-
const tab = draft.invoiceByTab
|
|
92
|
+
const tab = (0, invoiceListState_1.invoiceTabStateFor)(draft.invoiceByTab, draft.activeTab);
|
|
89
93
|
const newIds = action.payload.invoices.map((invoice) => invoice.id);
|
|
90
94
|
tab.invoiceIds = action.payload.keepExistingListItems
|
|
91
95
|
? [...new Set([...tab.invoiceIds, ...newIds])]
|
|
@@ -95,7 +99,7 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
95
99
|
tab.error = undefined;
|
|
96
100
|
},
|
|
97
101
|
updateInvoiceListFailure(draft, action) {
|
|
98
|
-
const tab = draft.invoiceByTab
|
|
102
|
+
const tab = (0, invoiceListState_1.invoiceTabStateFor)(draft.invoiceByTab, draft.activeTab);
|
|
99
103
|
tab.fetchState = 'Error';
|
|
100
104
|
tab.error = action.payload;
|
|
101
105
|
},
|
|
@@ -141,17 +145,14 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
141
145
|
// are left untouched and refetched lazily.
|
|
142
146
|
addInvoiceToList(draft, action) {
|
|
143
147
|
const { id, status } = action.payload;
|
|
144
|
-
const allTab = draft.invoiceByTab
|
|
148
|
+
const allTab = (0, invoiceListState_1.invoiceTabStateFor)(draft.invoiceByTab, 'all');
|
|
145
149
|
if (allTab.invoiceIds.includes(id)) {
|
|
146
150
|
return;
|
|
147
151
|
}
|
|
148
152
|
allTab.invoiceIds = [id, ...allTab.invoiceIds];
|
|
149
|
-
const statusTab = statusToTabId(status);
|
|
150
|
-
if (statusTab
|
|
151
|
-
|
|
152
|
-
if (!tab.invoiceIds.includes(id)) {
|
|
153
|
-
tab.invoiceIds = [id, ...tab.invoiceIds];
|
|
154
|
-
}
|
|
153
|
+
const statusTab = (0, invoiceListState_1.invoiceTabStateFor)(draft.invoiceByTab, statusToTabId(status));
|
|
154
|
+
if (!statusTab.invoiceIds.includes(id)) {
|
|
155
|
+
statusTab.invoiceIds = [id, ...statusTab.invoiceIds];
|
|
155
156
|
}
|
|
156
157
|
draft.counts.all += 1;
|
|
157
158
|
draft.counts[status] = (draft.counts[status] ?? 0) + 1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { InvoicingInvoice, InvoicingInvoiceKPIs } from '../../../entity/invoicing/invoice/invoiceState';
|
|
4
|
-
import { InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
|
+
import { InvoicingListCounts, InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
5
5
|
import { RootState } from '../../../reducer';
|
|
6
6
|
import { InvoiceListFilters, InvoicingInvoiceTabId } from './invoiceListState';
|
|
7
7
|
export interface InvoiceListView extends SelectorView {
|
|
@@ -12,6 +12,8 @@ export interface InvoiceListView extends SelectorView {
|
|
|
12
12
|
invoices: InvoicingInvoice[];
|
|
13
13
|
kpisFetchState: FetchStateAndError;
|
|
14
14
|
nextCursor: string | null;
|
|
15
|
+
/** Config status list; the page labels tabs and row badges from it. */
|
|
16
|
+
statusOptions: InvoicingNamedOption[];
|
|
15
17
|
tabIds: InvoicingInvoiceTabId[];
|
|
16
18
|
kpis?: InvoicingInvoiceKPIs;
|
|
17
19
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInvoiceListView = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
+
const invoicingTabHelper_1 = require("../invoicingTabHelper");
|
|
5
6
|
const invoiceListState_1 = require("./invoiceListState");
|
|
6
7
|
/**
|
|
7
8
|
* Bundled read view for the invoices list page: the denormalized invoice rows
|
|
@@ -9,8 +10,11 @@ const invoiceListState_1 = require("./invoiceListState");
|
|
|
9
10
|
* array (and the wrapping view object) keep referential identity until the
|
|
10
11
|
* invoice entity slice or the list-view slice actually change.
|
|
11
12
|
*/
|
|
12
|
-
exports.getInvoiceListView = (0, toolkit_1.createSelector)((state) => state.invoicingInvoiceState, (state) => state.invoicingInvoiceListState, (invoiceState, listViewState) => {
|
|
13
|
-
|
|
13
|
+
exports.getInvoiceListView = (0, toolkit_1.createSelector)((state) => state.invoicingInvoiceState, (state) => state.invoicingInvoiceListState, (state) => state.invoicingConfigViewState.invoiceStatusOptions, (invoiceState, listViewState, statusOptions) => {
|
|
14
|
+
// Config-driven tabs: a status this build's union does not know has no
|
|
15
|
+
// cache entry until it is fetched, so default rather than crash.
|
|
16
|
+
const activeTabState = listViewState.invoiceByTab[listViewState.activeTab] ??
|
|
17
|
+
(0, invoiceListState_1.makeInvoiceTabState)();
|
|
14
18
|
return {
|
|
15
19
|
activeTab: listViewState.activeTab,
|
|
16
20
|
invoices: activeTabState.invoiceIds
|
|
@@ -22,7 +26,11 @@ exports.getInvoiceListView = (0, toolkit_1.createSelector)((state) => state.invo
|
|
|
22
26
|
kpis: listViewState.kpis,
|
|
23
27
|
kpisFetchState: listViewState.kpisFetchState,
|
|
24
28
|
nextCursor: activeTabState.nextCursor,
|
|
25
|
-
|
|
29
|
+
statusOptions,
|
|
30
|
+
tabIds: (0, invoicingTabHelper_1.invoicingTabIdsFromConfig)({
|
|
31
|
+
allTabIds: invoiceListState_1.ALL_INVOICING_INVOICE_TAB_IDS,
|
|
32
|
+
statusOptions,
|
|
33
|
+
}),
|
|
26
34
|
fetchState: activeTabState.fetchState,
|
|
27
35
|
error: activeTabState.error,
|
|
28
36
|
version: 1.0,
|
|
@@ -5,13 +5,6 @@ import { InvoicingListSort } from '../invoicingApiHelper';
|
|
|
5
5
|
export declare const ALL_INVOICING_INVOICE_TAB_IDS: readonly ["all", "paid", "partially_paid", "payment_due", "not_paid", "voided"];
|
|
6
6
|
export declare const toInvoicingInvoiceTabId: (v: string) => "paid" | "voided" | "partially_paid" | "payment_due" | "not_paid" | "all";
|
|
7
7
|
export type InvoicingInvoiceTabId = ReturnType<typeof toInvoicingInvoiceTabId>;
|
|
8
|
-
/**
|
|
9
|
-
* Ordered filter-tab id set owned by CES so the invoice-list tabs live next to
|
|
10
|
-
* the model rather than being hardcoded in web-components. Tab labels and the
|
|
11
|
-
* per-tab count lookup stay in the view layer; this only carries the id set and
|
|
12
|
-
* display order.
|
|
13
|
-
*/
|
|
14
|
-
export declare const INVOICING_INVOICE_TABS: InvoicingInvoiceTabId[];
|
|
15
8
|
/** Filters that drive the invoice list query (mirrors the Invoices hooks). */
|
|
16
9
|
export interface InvoiceListFilters {
|
|
17
10
|
customerId?: ID;
|
|
@@ -38,7 +31,13 @@ export interface InvoiceListState {
|
|
|
38
31
|
/** Base query shared across tabs (search / customer / subscription / dates). */
|
|
39
32
|
filters: InvoiceListFilters;
|
|
40
33
|
/** Per-tab cached invoice ids + cursor + fetch state. */
|
|
41
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Per-tab cache. `Partial` because the tab set comes from `/1.0/config`: a
|
|
36
|
+
* status the backend added that this build's tab-id union does not know still
|
|
37
|
+
* renders a tab, and its cache entry is created on first use rather than
|
|
38
|
+
* pre-seeded. Readers must default a missing entry.
|
|
39
|
+
*/
|
|
40
|
+
invoiceByTab: Partial<Record<InvoicingInvoiceTabId, InvoiceTabState>>;
|
|
42
41
|
kpisFetchState: FetchStateAndError;
|
|
43
42
|
/** Tab-independent money KPIs. */
|
|
44
43
|
kpis?: InvoicingInvoiceKPIs;
|
|
@@ -46,4 +45,9 @@ export interface InvoiceListState {
|
|
|
46
45
|
sort?: InvoicingListSort;
|
|
47
46
|
}
|
|
48
47
|
export declare const makeInvoiceTabState: () => InvoiceTabState;
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The cache entry for a tab, created on first use. The tab set is config-driven,
|
|
50
|
+
* so a status this build's union does not know still needs somewhere to cache.
|
|
51
|
+
*/
|
|
52
|
+
export declare const invoiceTabStateFor: (invoiceByTab: Partial<Record<InvoicingInvoiceTabId, InvoiceTabState>>, tabId: InvoicingInvoiceTabId) => InvoiceTabState;
|
|
53
|
+
export declare const makeInvoiceByTab: () => Partial<Record<InvoicingInvoiceTabId, InvoiceTabState>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeInvoiceByTab = exports.
|
|
3
|
+
exports.makeInvoiceByTab = exports.invoiceTabStateFor = exports.makeInvoiceTabState = exports.toInvoicingInvoiceTabId = exports.ALL_INVOICING_INVOICE_TAB_IDS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.ALL_INVOICING_INVOICE_TAB_IDS = [
|
|
6
6
|
'all',
|
|
@@ -12,15 +12,6 @@ exports.ALL_INVOICING_INVOICE_TAB_IDS = [
|
|
|
12
12
|
];
|
|
13
13
|
const toInvoicingInvoiceTabId = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_INVOICE_TAB_IDS);
|
|
14
14
|
exports.toInvoicingInvoiceTabId = toInvoicingInvoiceTabId;
|
|
15
|
-
/**
|
|
16
|
-
* Ordered filter-tab id set owned by CES so the invoice-list tabs live next to
|
|
17
|
-
* the model rather than being hardcoded in web-components. Tab labels and the
|
|
18
|
-
* per-tab count lookup stay in the view layer; this only carries the id set and
|
|
19
|
-
* display order.
|
|
20
|
-
*/
|
|
21
|
-
exports.INVOICING_INVOICE_TABS = [
|
|
22
|
-
...exports.ALL_INVOICING_INVOICE_TAB_IDS,
|
|
23
|
-
];
|
|
24
15
|
const makeInvoiceTabState = () => ({
|
|
25
16
|
invoiceIds: [],
|
|
26
17
|
nextCursor: null,
|
|
@@ -28,6 +19,20 @@ const makeInvoiceTabState = () => ({
|
|
|
28
19
|
error: undefined,
|
|
29
20
|
});
|
|
30
21
|
exports.makeInvoiceTabState = makeInvoiceTabState;
|
|
22
|
+
/**
|
|
23
|
+
* The cache entry for a tab, created on first use. The tab set is config-driven,
|
|
24
|
+
* so a status this build's union does not know still needs somewhere to cache.
|
|
25
|
+
*/
|
|
26
|
+
const invoiceTabStateFor = (invoiceByTab, tabId) => {
|
|
27
|
+
const existing = invoiceByTab[tabId];
|
|
28
|
+
if (existing != null) {
|
|
29
|
+
return existing;
|
|
30
|
+
}
|
|
31
|
+
const created = (0, exports.makeInvoiceTabState)();
|
|
32
|
+
invoiceByTab[tabId] = created;
|
|
33
|
+
return created;
|
|
34
|
+
};
|
|
35
|
+
exports.invoiceTabStateFor = invoiceTabStateFor;
|
|
31
36
|
const makeInvoiceByTab = () => exports.ALL_INVOICING_INVOICE_TAB_IDS.reduce((acc, tabId) => {
|
|
32
37
|
acc[tabId] = (0, exports.makeInvoiceTabState)();
|
|
33
38
|
return acc;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingNamedOptionsByKey } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
+
import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingNamedOption, InvoicingNamedOptionsByKey } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
4
|
import { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
|
|
5
5
|
import { RootState } from '../../../reducer';
|
|
6
6
|
import { InvoicingCatalogItemKind } from './invoicingCatalogItemDetailViewState';
|
|
@@ -20,6 +20,14 @@ export interface InvoicingCatalogItemDetailView extends SelectorView {
|
|
|
20
20
|
catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
|
|
21
21
|
catalogProductLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogProductLifecycleAction>[];
|
|
22
22
|
configFetchState: FetchState;
|
|
23
|
+
/**
|
|
24
|
+
* Config option lists the detail page's inline pricing editor renders, so the
|
|
25
|
+
* screen reads them off this view instead of `getInvoicingConfigView`.
|
|
26
|
+
*/
|
|
27
|
+
periodUnitOptions: InvoicingNamedOption[];
|
|
28
|
+
trialEndActionOptions: InvoicingNamedOption[];
|
|
29
|
+
trialUnitOptions: InvoicingNamedOption[];
|
|
30
|
+
typeOptions: InvoicingNamedOption[];
|
|
23
31
|
catalogTierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey;
|
|
24
32
|
plan?: InvoicingPlan;
|
|
25
33
|
}
|
package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js
CHANGED
|
@@ -5,13 +5,17 @@ const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
|
|
|
5
5
|
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
6
6
|
const getInvoicingCatalogItemDetail = (state, _kind, id) => {
|
|
7
7
|
const { error, fetchState } = state.invoicingCatalogItemDetailViewState;
|
|
8
|
-
const { catalogItemLifecycleActionOptions, catalogProductLifecycleActionOptions, catalogTierTypeOptionsByPricingModel, fetchState: configFetchState, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
8
|
+
const { billingPeriodUnitOptions, catalogItemLifecycleActionOptions, catalogItemTypeOptions, catalogProductLifecycleActionOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, fetchState: configFetchState, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
9
9
|
return {
|
|
10
10
|
catalogItemLifecycleActionOptions,
|
|
11
11
|
catalogProductLifecycleActionOptions,
|
|
12
12
|
catalogTierTypeOptionsByPricingModel,
|
|
13
13
|
configFetchState,
|
|
14
|
+
periodUnitOptions: billingPeriodUnitOptions,
|
|
14
15
|
plan: (0, planSelector_1.getInvoicingPlanById)(state.invoicingPlanState, id),
|
|
16
|
+
trialEndActionOptions: catalogTrialEndActionOptions,
|
|
17
|
+
trialUnitOptions: catalogTrialUnitOptions,
|
|
18
|
+
typeOptions: catalogItemTypeOptions,
|
|
15
19
|
fetchState,
|
|
16
20
|
error,
|
|
17
21
|
version: 1.0,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
+
import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
4
|
import { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
|
|
5
5
|
import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
6
6
|
import { RootState } from '../../../reducer';
|
|
7
7
|
import { InvoicingListSort } from '../invoicingApiHelper';
|
|
8
8
|
import { InvoicingCatalogPlanFilters, InvoicingCatalogProductFilters, InvoicingProductColumnConfig } from './invoicingCatalogListViewState';
|
|
9
9
|
export interface InvoicingCatalogListView extends SelectorView {
|
|
10
|
+
/** Config-owned; folded in so the screen reads one selector. */
|
|
11
|
+
catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
|
|
10
12
|
count: InvoicingListCounts;
|
|
11
13
|
countsFetchState: FetchStateAndError;
|
|
12
14
|
planFilters: InvoicingCatalogPlanFilters;
|
|
@@ -19,7 +19,8 @@ exports.getInvoicingCatalogPrices = getInvoicingCatalogPrices;
|
|
|
19
19
|
* denormalized arrays keep referential identity. The base `fetchState`/`error`
|
|
20
20
|
* track the plan list; the product list has its own `productFetchState`.
|
|
21
21
|
*/
|
|
22
|
-
exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (planState, listViewState) => ({
|
|
22
|
+
exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (state) => state.invoicingConfigViewState.catalogItemLifecycleActionOptions, (planState, listViewState, catalogItemLifecycleActionOptions) => ({
|
|
23
|
+
catalogItemLifecycleActionOptions,
|
|
23
24
|
plans: (0, planSelector_1.getInvoicingPlansByIds)(planState, listViewState.planIds),
|
|
24
25
|
productColumns: invoicingCatalogListViewState_1.INVOICING_PRODUCT_COLUMNS,
|
|
25
26
|
products: (0, planSelector_1.getInvoicingPlansByIds)(planState, listViewState.productIds),
|
|
@@ -23,15 +23,25 @@ export interface InvoicingConfigPayload {
|
|
|
23
23
|
subscription_metadata_edit_allowed_from_statuses: string[];
|
|
24
24
|
auto_collection_options?: InvoicingNamedOptionWire[];
|
|
25
25
|
billing_period_unit_options?: InvoicingNamedOptionWire[];
|
|
26
|
+
card_status_options?: InvoicingNamedOptionWire[];
|
|
27
|
+
catalog_item_status_options?: InvoicingNamedOptionWire[];
|
|
28
|
+
catalog_item_type_options?: InvoicingNamedOptionWire[];
|
|
26
29
|
catalog_tier_type_options_by_pricing_model?: InvoicingNamedOptionsByKeyWire;
|
|
27
30
|
catalog_trial_end_action_options?: InvoicingNamedOptionWire[];
|
|
28
31
|
catalog_trial_unit_options?: InvoicingNamedOptionWire[];
|
|
29
32
|
created_at?: string | null;
|
|
33
|
+
credit_note_reason_code_options?: InvoicingNamedOptionWire[];
|
|
34
|
+
credit_note_status_options?: InvoicingNamedOptionWire[];
|
|
35
|
+
credit_note_type_options?: InvoicingNamedOptionWire[];
|
|
36
|
+
customer_status_options?: InvoicingNamedOptionWire[];
|
|
30
37
|
customer_type_options?: InvoicingNamedOptionWire[];
|
|
31
38
|
date_format_options?: InvoicingNamedOptionWire[];
|
|
32
39
|
discount_apply_on_options?: InvoicingNamedOptionWire[];
|
|
33
40
|
discount_duration_type_options?: InvoicingNamedOptionWire[];
|
|
41
|
+
discount_status_options?: InvoicingNamedOptionWire[];
|
|
34
42
|
discount_type_options?: InvoicingNamedOptionWire[];
|
|
43
|
+
dunning_case_status_options?: InvoicingNamedOptionWire[];
|
|
44
|
+
invoice_status_options?: InvoicingNamedOptionWire[];
|
|
35
45
|
invoicing_tos_acceptance_ip?: string | null;
|
|
36
46
|
invoicing_tos_acceptance_time?: string | null;
|
|
37
47
|
invoicing_tos_acceptance_user_agent?: string | null;
|
|
@@ -43,7 +53,10 @@ export interface InvoicingConfigPayload {
|
|
|
43
53
|
qbo_account_mapping_kind_options?: InvoicingQboAccountMappingKindOptionWire[];
|
|
44
54
|
qbo_customer_matching_options?: InvoicingNamedOptionWire[];
|
|
45
55
|
qbo_sync_status_options?: InvoicingNamedOptionWire[];
|
|
56
|
+
subscription_status_options?: InvoicingNamedOptionWire[];
|
|
46
57
|
taxability_options?: InvoicingNamedOptionWire[];
|
|
58
|
+
transaction_status_options?: InvoicingNamedOptionWire[];
|
|
59
|
+
transaction_type_options?: InvoicingNamedOptionWire[];
|
|
47
60
|
updated_at?: string | null;
|
|
48
61
|
}
|
|
49
62
|
export type InvoicingConfigResponse = ZeniAPIResponse<InvoicingConfigPayload>;
|
|
@@ -2,7 +2,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
|
|
|
2
2
|
import { InvoicingConfigPayload } from './invoicingConfigViewPayload';
|
|
3
3
|
import { InvoicingConfigViewState } from './invoicingConfigViewState';
|
|
4
4
|
export declare const initialState: InvoicingConfigViewState;
|
|
5
|
-
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
5
|
+
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'cardStatusOptions' | 'catalogItemStatusOptions' | 'catalogItemTypeOptions' | 'creditNoteReasonCodeOptions' | 'creditNoteStatusOptions' | 'creditNoteTypeOptions' | 'customerStatusOptions' | 'discountStatusOptions' | 'dunningCaseStatusOptions' | 'invoiceStatusOptions' | 'subscriptionStatusOptions' | 'transactionStatusOptions' | 'transactionTypeOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
6
6
|
export declare const fetchInvoicingConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
7
7
|
cacheOverride?: boolean;
|
|
8
8
|
} | undefined], {
|
|
@@ -28,6 +28,19 @@ exports.initialState = {
|
|
|
28
28
|
netTermDayOptions: [],
|
|
29
29
|
paymentGatewayOptions: [],
|
|
30
30
|
taxabilityOptions: [],
|
|
31
|
+
cardStatusOptions: [],
|
|
32
|
+
catalogItemStatusOptions: [],
|
|
33
|
+
catalogItemTypeOptions: [],
|
|
34
|
+
creditNoteReasonCodeOptions: [],
|
|
35
|
+
creditNoteStatusOptions: [],
|
|
36
|
+
creditNoteTypeOptions: [],
|
|
37
|
+
customerStatusOptions: [],
|
|
38
|
+
discountStatusOptions: [],
|
|
39
|
+
dunningCaseStatusOptions: [],
|
|
40
|
+
invoiceStatusOptions: [],
|
|
41
|
+
subscriptionStatusOptions: [],
|
|
42
|
+
transactionStatusOptions: [],
|
|
43
|
+
transactionTypeOptions: [],
|
|
31
44
|
enableFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
32
45
|
subscriptionLifecycleActionOptions: [],
|
|
33
46
|
subscriptionCommercialEditAllowedFromStatuses: [],
|
|
@@ -81,6 +94,19 @@ function mapInvoicingConfigPayloadToState(payload) {
|
|
|
81
94
|
netTermDayOptions: (payload.net_term_day_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
82
95
|
paymentGatewayOptions: (payload.payment_gateway_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
83
96
|
taxabilityOptions: (payload.taxability_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
97
|
+
cardStatusOptions: (payload.card_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
98
|
+
catalogItemStatusOptions: (payload.catalog_item_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
99
|
+
catalogItemTypeOptions: (payload.catalog_item_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
100
|
+
creditNoteReasonCodeOptions: (payload.credit_note_reason_code_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
101
|
+
creditNoteStatusOptions: (payload.credit_note_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
102
|
+
creditNoteTypeOptions: (payload.credit_note_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
103
|
+
customerStatusOptions: (payload.customer_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
104
|
+
discountStatusOptions: (payload.discount_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
105
|
+
dunningCaseStatusOptions: (payload.dunning_case_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
106
|
+
invoiceStatusOptions: (payload.invoice_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
107
|
+
subscriptionStatusOptions: (payload.subscription_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
108
|
+
transactionStatusOptions: (payload.transaction_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
109
|
+
transactionTypeOptions: (payload.transaction_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
84
110
|
createdAt: payload.created_at ?? undefined,
|
|
85
111
|
updatedAt: payload.updated_at ?? undefined,
|
|
86
112
|
dunningScheduleActionOptions: payload.dunning_schedule_action_options.map((option) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
2
|
import { RootState } from '../../../reducer';
|
|
3
3
|
import { InvoicingOnboardingStatus } from './invoicingConfigViewPayload';
|
|
4
4
|
import { InvoicingConfigViewState } from './invoicingConfigViewState';
|
|
@@ -16,3 +16,21 @@ export interface InvoicingConfigView extends Omit<InvoicingConfigViewState, 'acc
|
|
|
16
16
|
status?: InvoicingOnboardingStatus;
|
|
17
17
|
}
|
|
18
18
|
export declare const getInvoicingConfigView: (state: RootState) => InvoicingConfigView;
|
|
19
|
+
/**
|
|
20
|
+
* The onboarding/route gate's slice of the config: whether invoicing is routed to
|
|
21
|
+
* the promo, the settings step or the live module, plus the two action fetch
|
|
22
|
+
* states those surfaces render against.
|
|
23
|
+
*
|
|
24
|
+
* Exists so the drawers, the invoicing route gate and the promo screen have a
|
|
25
|
+
* concern-scoped view to read instead of reaching into
|
|
26
|
+
* {@link getInvoicingConfigView} — they are nav and routing, not pages, so there
|
|
27
|
+
* is no page-level view for them to use. The whole config shape stays out of
|
|
28
|
+
* their props either way.
|
|
29
|
+
*/
|
|
30
|
+
export interface InvoicingOnboardingGateView {
|
|
31
|
+
acceptTermsState: FetchStateAndError;
|
|
32
|
+
enableState: FetchStateAndError;
|
|
33
|
+
fetchState: FetchState;
|
|
34
|
+
status?: InvoicingOnboardingStatus;
|
|
35
|
+
}
|
|
36
|
+
export declare const getInvoicingOnboardingGateView: (state: RootState) => InvoicingOnboardingGateView;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingConfigView = void 0;
|
|
3
|
+
exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = void 0;
|
|
4
4
|
const invoicingConfigViewPayload_1 = require("./invoicingConfigViewPayload");
|
|
5
5
|
const getInvoicingConfigView = (state) => {
|
|
6
6
|
const { acceptTermsFetchState, enableFetchState, ...configState } = state.invoicingConfigViewState;
|
|
@@ -12,3 +12,13 @@ const getInvoicingConfigView = (state) => {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
exports.getInvoicingConfigView = getInvoicingConfigView;
|
|
15
|
+
const getInvoicingOnboardingGateView = (state) => {
|
|
16
|
+
const { acceptTermsFetchState, enableFetchState, fetchState } = state.invoicingConfigViewState;
|
|
17
|
+
return {
|
|
18
|
+
acceptTermsState: acceptTermsFetchState,
|
|
19
|
+
enableState: enableFetchState,
|
|
20
|
+
fetchState,
|
|
21
|
+
status: (0, invoicingConfigViewPayload_1.deriveInvoicingOnboardingStatus)(state.invoicingConfigViewState.isInvoicingTosAccepted, state.invoicingConfigViewState.isInvoicingEnabled),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.getInvoicingOnboardingGateView = getInvoicingOnboardingGateView;
|