@zeniai/client-epic-state 5.1.97-betaAK4 → 5.1.98
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/coupon/couponConstants.d.ts +11 -0
- package/lib/entity/invoicing/coupon/couponConstants.js +29 -0
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -12
- package/lib/entity/invoicing/invoicingCommonPayload.js +0 -18
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +26 -0
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +0 -16
- package/lib/esm/index.js +11 -12
- package/lib/esm/view/invoicing/auditView/auditViewSelector.js +0 -4
- package/lib/esm/view/invoicing/couponView/couponViewSelector.js +3 -10
- package/lib/esm/view/invoicing/couponView/couponViewState.js +9 -0
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +0 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +1 -2
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteSelector.js +2 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +6 -7
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +19 -3
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +5 -10
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +4 -6
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +17 -0
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +0 -5
- package/lib/esm/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +1 -2
- package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +6 -6
- package/lib/esm/view/invoicing/invoiceList/invoiceListSelector.js +4 -12
- package/lib/esm/view/invoicing/invoiceList/invoiceListState.js +9 -13
- package/lib/esm/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +1 -5
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +1 -2
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -26
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -9
- package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +3 -8
- package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +9 -0
- 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 +3 -9
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +9 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +3 -8
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +9 -1
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +3 -11
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +9 -0
- package/lib/esm/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +1 -2
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +5 -5
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +4 -9
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +9 -11
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +8 -1
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +1 -3
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +2 -5
- package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +26 -0
- package/lib/esm/view/invoicing/recordPayment/recordPaymentSelector.js +6 -27
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -7
- package/lib/index.d.ts +12 -13
- package/lib/index.js +24 -9
- package/lib/view/invoicing/auditView/auditViewSelector.d.ts +0 -4
- package/lib/view/invoicing/auditView/auditViewSelector.js +0 -4
- package/lib/view/invoicing/couponView/couponViewSelector.d.ts +1 -5
- package/lib/view/invoicing/couponView/couponViewSelector.js +2 -9
- package/lib/view/invoicing/couponView/couponViewState.d.ts +7 -0
- package/lib/view/invoicing/couponView/couponViewState.js +10 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +0 -1
- package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +1 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.d.ts +1 -3
- package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.js +2 -4
- package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +0 -6
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +5 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +5 -6
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.d.ts +6 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +20 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +7 -9
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +5 -10
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +3 -4
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +3 -5
- package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.d.ts +8 -0
- package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +18 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +0 -5
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +0 -5
- package/lib/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +1 -2
- package/lib/view/invoicing/invoiceList/invoiceListReducer.js +5 -5
- package/lib/view/invoicing/invoiceList/invoiceListSelector.d.ts +1 -3
- package/lib/view/invoicing/invoiceList/invoiceListSelector.js +3 -11
- package/lib/view/invoicing/invoiceList/invoiceListState.d.ts +9 -13
- package/lib/view/invoicing/invoiceList/invoiceListState.js +10 -15
- package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts +1 -9
- package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +1 -5
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +1 -3
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +1 -2
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -13
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -26
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +1 -19
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +1 -11
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -13
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.d.ts +1 -3
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +2 -7
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.d.ts +7 -0
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +10 -1
- 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 +1 -3
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +2 -8
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +7 -0
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +10 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.d.ts +1 -3
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +2 -7
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +9 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +10 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +1 -7
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +2 -10
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +7 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +10 -1
- package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +1 -2
- 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 +0 -3
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +3 -8
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.d.ts +10 -10
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +10 -13
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.d.ts +2 -0
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +9 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +2 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +1 -3
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +1 -3
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +1 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +0 -6
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.d.ts +6 -0
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +27 -1
- package/lib/view/invoicing/recordPayment/recordPaymentSelector.d.ts +2 -3
- package/lib/view/invoicing/recordPayment/recordPaymentSelector.js +6 -27
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +1 -11
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -7
- package/package.json +1 -1
- package/lib/esm/view/invoicing/invoicingTabHelper.js +0 -25
- package/lib/view/invoicing/invoicingTabHelper.d.ts +0 -27
- package/lib/view/invoicing/invoicingTabHelper.js +0 -28
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCreateCreditNoteFormView = exports.getCreateCreditNoteView = void 0;
|
|
4
|
-
const
|
|
4
|
+
const issueCreditNoteFormConfig_1 = require("../issueCreditNote/issueCreditNoteFormConfig");
|
|
5
5
|
const getCreateCreditNoteView = (state) => {
|
|
6
6
|
const { createdCreditNoteId, error, fetchState } = state.invoicingCreateCreditNoteState;
|
|
7
7
|
return {
|
|
@@ -14,11 +14,9 @@ const getCreateCreditNoteView = (state) => {
|
|
|
14
14
|
exports.getCreateCreditNoteView = getCreateCreditNoteView;
|
|
15
15
|
const getCreateCreditNoteFormView = (state) => {
|
|
16
16
|
const { draft, error, fetchState } = state.invoicingCreateCreditNoteState;
|
|
17
|
-
const { creditNoteReasonCodeOptions, creditNoteTypeOptions } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
18
17
|
return {
|
|
19
18
|
localData: draft,
|
|
20
|
-
|
|
21
|
-
typeOptions: creditNoteTypeOptions,
|
|
19
|
+
reasonCodeValues: [...issueCreditNoteFormConfig_1.INVOICING_CREDIT_NOTE_REASON_CODES],
|
|
22
20
|
error,
|
|
23
21
|
fetchState,
|
|
24
22
|
version: 1.0,
|
|
@@ -11,12 +11,6 @@ export interface CreateCreditNoteFormLocalData {
|
|
|
11
11
|
lineItems: CreateCreditNoteLineItemDraft[];
|
|
12
12
|
reasonCode: string;
|
|
13
13
|
referenceInvoiceId: string;
|
|
14
|
-
/**
|
|
15
|
-
* Credit-note type code from `credit_note_type_options`. Empty until the user
|
|
16
|
-
* picks one; the payload then omits it and lets the backend default, rather
|
|
17
|
-
* than the client asserting `adjustment` for every credit note as it used to.
|
|
18
|
-
*/
|
|
19
|
-
type: string;
|
|
20
14
|
}
|
|
21
15
|
export interface CreateCreditNoteState extends FetchedState {
|
|
22
16
|
draft: CreateCreditNoteFormLocalData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import {
|
|
3
|
+
import { 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 '../invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState';
|
|
@@ -32,13 +32,13 @@ export interface InvoicingCatalogItemFormView extends SelectorView {
|
|
|
32
32
|
applicableItemOptions: ApplicableCatalogItemOption[];
|
|
33
33
|
localData: InvoicingCatalogItemFormLocalData;
|
|
34
34
|
mode: 'create' | 'edit';
|
|
35
|
-
|
|
35
|
+
periodUnitValues: readonly string[];
|
|
36
36
|
pricingModelValues: readonly string[];
|
|
37
37
|
prorationValues: readonly string[];
|
|
38
38
|
tierTypeValues: readonly string[];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
trialEndActionValues: readonly string[];
|
|
40
|
+
trialUnitValues: readonly string[];
|
|
41
|
+
typeValues: readonly string[];
|
|
42
42
|
/**
|
|
43
43
|
* Backend tier-type choices per pricing model. Folded in here rather than left
|
|
44
44
|
* for the screen to pull off `getInvoicingConfigView` itself, so the form wires
|
|
@@ -54,20 +54,19 @@ const getInvoicingCatalogItemFormView = (state, id) => {
|
|
|
54
54
|
const applicableItemOptions = id != null
|
|
55
55
|
? allApplicableItemOptions.filter((option) => option.id !== id)
|
|
56
56
|
: allApplicableItemOptions;
|
|
57
|
-
const { billingPeriodUnitOptions, catalogItemTypeOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
58
57
|
return {
|
|
59
58
|
applicabilityValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_APPLICABILITY_VALUES,
|
|
60
59
|
applicableItemOptions,
|
|
61
60
|
localData,
|
|
62
61
|
mode: id != null ? 'edit' : 'create',
|
|
63
|
-
|
|
62
|
+
periodUnitValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_PERIOD_UNIT_VALUES,
|
|
64
63
|
pricingModelValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_PRICING_MODEL_VALUES,
|
|
65
64
|
prorationValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_PRORATION_VALUES,
|
|
66
65
|
tierTypeValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_TIER_TYPE_VALUES,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
catalogTierTypeOptionsByPricingModel,
|
|
66
|
+
trialEndActionValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_TRIAL_END_ACTION_VALUES,
|
|
67
|
+
trialUnitValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_TRIAL_UNIT_VALUES,
|
|
68
|
+
typeValues: invoicingCatalogItemFormConfig_1.INVOICING_CATALOG_TYPE_VALUES,
|
|
69
|
+
catalogTierTypeOptionsByPricingModel: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).catalogTierTypeOptionsByPricingModel,
|
|
71
70
|
kind,
|
|
72
71
|
plan,
|
|
73
72
|
savedItemId,
|
package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.d.ts
CHANGED
|
@@ -2,12 +2,15 @@ import { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
|
|
|
2
2
|
import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
3
3
|
import { InvoicingCatalogItemFormLocalData, InvoicingCatalogItemFormSubFamily, InvoicingCatalogItemFormTier } from './editInvoicingCatalogItemDetailViewState';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* here until it does. Everything else on this form comes from `/1.0/config`.
|
|
5
|
+
* Canonical value sets for the catalog item form. CES owns the values;
|
|
6
|
+
* web-components maps each value to a localized label.
|
|
8
7
|
*/
|
|
8
|
+
export declare const INVOICING_CATALOG_TYPE_VALUES: readonly ["plan", "addon", "charge"];
|
|
9
|
+
export declare const INVOICING_CATALOG_PERIOD_UNIT_VALUES: readonly ["day", "week", "month", "year"];
|
|
9
10
|
export declare const INVOICING_CATALOG_PRICING_MODEL_VALUES: readonly ["flat_fee", "per_unit", "tiered", "volume", "stairstep"];
|
|
10
11
|
export declare const INVOICING_CATALOG_TIER_TYPE_VALUES: readonly ["per_unit", "flat_fee", "package"];
|
|
12
|
+
export declare const INVOICING_CATALOG_TRIAL_UNIT_VALUES: readonly ["day", "month"];
|
|
13
|
+
export declare const INVOICING_CATALOG_TRIAL_END_ACTION_VALUES: readonly ["site_default", "activate_subscription", "cancel_subscription"];
|
|
11
14
|
export declare const INVOICING_CATALOG_PRORATION_VALUES: readonly ["site_default", "partial_term", "full_term"];
|
|
12
15
|
export declare const INVOICING_CATALOG_APPLICABILITY_VALUES: readonly ["all", "restricted"];
|
|
13
16
|
export declare const isTieredCatalogPricingModel: (model: string) => boolean;
|
package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityToInvoicingCatalogItemFormLocalData = exports.initialInvoicingCatalogItemFormLocalData = exports.invoicingProductToCatalogItemFormSubFamily = exports.blankInvoicingCatalogSubFamily = exports.blankInvoicingCatalogTier = exports.isTieredCatalogPricingModel = exports.INVOICING_CATALOG_APPLICABILITY_VALUES = exports.INVOICING_CATALOG_PRORATION_VALUES = exports.INVOICING_CATALOG_TIER_TYPE_VALUES = exports.INVOICING_CATALOG_PRICING_MODEL_VALUES = void 0;
|
|
3
|
+
exports.entityToInvoicingCatalogItemFormLocalData = exports.initialInvoicingCatalogItemFormLocalData = exports.invoicingProductToCatalogItemFormSubFamily = exports.blankInvoicingCatalogSubFamily = exports.blankInvoicingCatalogTier = exports.isTieredCatalogPricingModel = exports.INVOICING_CATALOG_APPLICABILITY_VALUES = exports.INVOICING_CATALOG_PRORATION_VALUES = exports.INVOICING_CATALOG_TRIAL_END_ACTION_VALUES = exports.INVOICING_CATALOG_TRIAL_UNIT_VALUES = exports.INVOICING_CATALOG_TIER_TYPE_VALUES = exports.INVOICING_CATALOG_PRICING_MODEL_VALUES = exports.INVOICING_CATALOG_PERIOD_UNIT_VALUES = exports.INVOICING_CATALOG_TYPE_VALUES = void 0;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* here until it does. Everything else on this form comes from `/1.0/config`.
|
|
5
|
+
* Canonical value sets for the catalog item form. CES owns the values;
|
|
6
|
+
* web-components maps each value to a localized label.
|
|
8
7
|
*/
|
|
8
|
+
exports.INVOICING_CATALOG_TYPE_VALUES = [
|
|
9
|
+
'plan',
|
|
10
|
+
'addon',
|
|
11
|
+
'charge',
|
|
12
|
+
];
|
|
13
|
+
exports.INVOICING_CATALOG_PERIOD_UNIT_VALUES = [
|
|
14
|
+
'day',
|
|
15
|
+
'week',
|
|
16
|
+
'month',
|
|
17
|
+
'year',
|
|
18
|
+
];
|
|
9
19
|
exports.INVOICING_CATALOG_PRICING_MODEL_VALUES = [
|
|
10
20
|
'flat_fee',
|
|
11
21
|
'per_unit',
|
|
@@ -18,6 +28,12 @@ exports.INVOICING_CATALOG_TIER_TYPE_VALUES = [
|
|
|
18
28
|
'flat_fee',
|
|
19
29
|
'package',
|
|
20
30
|
];
|
|
31
|
+
exports.INVOICING_CATALOG_TRIAL_UNIT_VALUES = ['day', 'month'];
|
|
32
|
+
exports.INVOICING_CATALOG_TRIAL_END_ACTION_VALUES = [
|
|
33
|
+
'site_default',
|
|
34
|
+
'activate_subscription',
|
|
35
|
+
'cancel_subscription',
|
|
36
|
+
];
|
|
21
37
|
exports.INVOICING_CATALOG_PRORATION_VALUES = [
|
|
22
38
|
'site_default',
|
|
23
39
|
'partial_term',
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { InvoicingCouponApplyOn, InvoicingCouponDurationType, InvoicingCouponPeriodUnit, InvoicingDiscountType } from '../../../entity/invoicing/coupon/couponPayload';
|
|
3
4
|
import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
|
|
4
|
-
import {
|
|
5
|
+
import { InvoicingFormOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { InvoicingCouponFormLocalData } from './editInvoicingCouponDetailViewState';
|
|
7
8
|
export interface EditInvoicingCouponDetailView extends SelectorView {
|
|
8
|
-
/** Config-owned; folded in so the screen reads one selector. */
|
|
9
|
-
configFetchState: FetchState;
|
|
10
|
-
discountLifecycleActionOptions: InvoicingDiscountLifecycleActionOption[];
|
|
11
9
|
coupon?: InvoicingCoupon;
|
|
12
10
|
savedCouponId?: ID;
|
|
13
11
|
}
|
|
@@ -18,12 +16,12 @@ export interface EditInvoicingCouponDetailView extends SelectorView {
|
|
|
18
16
|
*/
|
|
19
17
|
export declare const getEditInvoicingCouponDetailViewState: (state: RootState, couponId?: ID) => EditInvoicingCouponDetailView;
|
|
20
18
|
export interface InvoicingCouponFormView extends EditInvoicingCouponDetailView {
|
|
21
|
-
applyOnOptions: InvoicingFormOption[];
|
|
22
|
-
discountTypeOptions: InvoicingFormOption[];
|
|
23
|
-
durationTypeOptions: InvoicingFormOption[];
|
|
19
|
+
applyOnOptions: readonly InvoicingFormOption<InvoicingCouponApplyOn>[];
|
|
20
|
+
discountTypeOptions: readonly InvoicingFormOption<InvoicingDiscountType>[];
|
|
21
|
+
durationTypeOptions: readonly InvoicingFormOption<InvoicingCouponDurationType>[];
|
|
24
22
|
localData: InvoicingCouponFormLocalData;
|
|
25
23
|
mode: 'create' | 'edit';
|
|
26
|
-
periodUnitOptions: InvoicingFormOption[];
|
|
24
|
+
periodUnitOptions: readonly InvoicingFormOption<InvoicingCouponPeriodUnit>[];
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* Bundled view for the discount form screen: the edit view (save state + the
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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");
|
|
4
5
|
const couponSelector_1 = require("../../../entity/invoicing/coupon/couponSelector");
|
|
5
|
-
const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
|
|
6
|
-
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
7
6
|
const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetailViewState");
|
|
8
7
|
/**
|
|
9
8
|
* Bundled view for the discount create/edit form: the save fetch state/error,
|
|
@@ -12,10 +11,7 @@ const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetai
|
|
|
12
11
|
*/
|
|
13
12
|
const getEditInvoicingCouponDetailViewState = (state, couponId) => {
|
|
14
13
|
const { error, fetchState, savedCouponId } = state.editInvoicingCouponDetailViewState;
|
|
15
|
-
const { discountLifecycleActionOptions, fetchState: configFetchState } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
16
14
|
return {
|
|
17
|
-
configFetchState,
|
|
18
|
-
discountLifecycleActionOptions,
|
|
19
15
|
coupon: couponId != null
|
|
20
16
|
? (0, couponSelector_1.getInvoicingCouponById)(state.invoicingCouponState, couponId)
|
|
21
17
|
: undefined,
|
|
@@ -39,15 +35,14 @@ const getInvoicingCouponFormView = (state, couponId) => {
|
|
|
39
35
|
? (editDraftById[couponId] ??
|
|
40
36
|
(0, editInvoicingCouponDetailViewState_1.entityToInvoicingCouponFormLocalData)(base.coupon))
|
|
41
37
|
: newCouponDraft;
|
|
42
|
-
const { billingPeriodUnitOptions, discountApplyOnOptions, discountDurationTypeOptions, discountTypeOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
43
38
|
return {
|
|
44
39
|
...base,
|
|
45
|
-
applyOnOptions:
|
|
46
|
-
discountTypeOptions:
|
|
47
|
-
durationTypeOptions:
|
|
40
|
+
applyOnOptions: couponConstants_1.INVOICING_COUPON_APPLY_ON_OPTIONS,
|
|
41
|
+
discountTypeOptions: couponConstants_1.INVOICING_DISCOUNT_TYPE_OPTIONS,
|
|
42
|
+
durationTypeOptions: couponConstants_1.INVOICING_COUPON_DURATION_TYPE_OPTIONS,
|
|
48
43
|
localData,
|
|
49
44
|
mode: couponId != null ? 'edit' : 'create',
|
|
50
|
-
periodUnitOptions:
|
|
45
|
+
periodUnitOptions: couponConstants_1.INVOICING_COUPON_PERIOD_UNIT_OPTIONS,
|
|
51
46
|
};
|
|
52
47
|
};
|
|
53
48
|
exports.getInvoicingCouponFormView = getInvoicingCouponFormView;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
3
|
import { RootState } from '../../../reducer';
|
|
5
4
|
import { InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
|
|
6
5
|
export interface InvoicingCustomerFormView extends SelectorView {
|
|
7
|
-
|
|
6
|
+
customerTypeValues: string[];
|
|
8
7
|
localData: InvoicingCustomerFormLocalData;
|
|
9
8
|
mode: 'create' | 'edit';
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
netTermDayValues: string[];
|
|
10
|
+
taxabilityValues: string[];
|
|
12
11
|
billingAddressId?: ID;
|
|
13
12
|
billingAddressLabel?: string;
|
|
14
13
|
savedCustomerId?: ID;
|
|
@@ -3,7 +3,6 @@ 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");
|
|
7
6
|
const invoicingCustomerFormConfig_1 = require("./invoicingCustomerFormConfig");
|
|
8
7
|
/**
|
|
9
8
|
* Bundled view for the customer create/edit form. Exposes the draft `localData`
|
|
@@ -30,13 +29,12 @@ const getInvoicingCustomerFormView = (state, invoicingCustomerID) => {
|
|
|
30
29
|
const billingAddressLabel = newAddress?.addressToCreate != null
|
|
31
30
|
? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
|
|
32
31
|
: undefined;
|
|
33
|
-
const { customerTypeOptions, netTermDayOptions, taxabilityOptions } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
34
32
|
return {
|
|
35
|
-
|
|
33
|
+
customerTypeValues: [...invoicingCustomerFormConfig_1.INVOICING_CUSTOMER_TYPE_VALUES],
|
|
36
34
|
localData,
|
|
37
35
|
mode,
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
netTermDayValues: [...invoicingCustomerFormConfig_1.INVOICING_NET_TERM_DAY_VALUES],
|
|
37
|
+
taxabilityValues: [...invoicingCustomerFormConfig_1.INVOICING_TAXABILITY_VALUES],
|
|
40
38
|
billingAddressId,
|
|
41
39
|
billingAddressLabel,
|
|
42
40
|
savedCustomerId,
|
|
@@ -2,6 +2,14 @@ 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"];
|
|
5
13
|
export declare const initialInvoicingCustomerFormLocalData: InvoicingCustomerFormLocalData;
|
|
6
14
|
/** Seed the form draft from an existing customer entity (edit mode). */
|
|
7
15
|
export declare const entityToInvoicingCustomerFormLocalData: (customer?: InvoicingCustomer) => InvoicingCustomerFormLocalData;
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityToInvoicingCustomerFormLocalData = exports.initialInvoicingCustomerFormLocalData = exports.INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE = void 0;
|
|
3
|
+
exports.entityToInvoicingCustomerFormLocalData = exports.initialInvoicingCustomerFormLocalData = exports.INVOICING_NET_TERM_DAY_VALUES = exports.INVOICING_TAXABILITY_VALUES = exports.INVOICING_CUSTOMER_TYPE_VALUES = 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
|
+
];
|
|
6
23
|
exports.initialInvoicingCustomerFormLocalData = {
|
|
7
24
|
autoCollection: true,
|
|
8
25
|
company: '',
|
|
@@ -3,7 +3,6 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
3
3
|
import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
|
|
4
4
|
import { InvoicingCustomer } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerState';
|
|
5
5
|
import { InvoicingSubscription } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionState';
|
|
6
|
-
import { InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
7
6
|
import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
8
7
|
import { RootState } from '../../../reducer';
|
|
9
8
|
import { InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionDetailViewState';
|
|
@@ -14,10 +13,6 @@ import { InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionD
|
|
|
14
13
|
* prefill the form.
|
|
15
14
|
*/
|
|
16
15
|
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[];
|
|
21
16
|
savedSubscriptionId?: ID;
|
|
22
17
|
subscription?: InvoicingSubscription;
|
|
23
18
|
}
|
|
@@ -4,17 +4,12 @@ exports.getInvoicingSubscriptionFormView = exports.getEditInvoicingSubscriptionD
|
|
|
4
4
|
const invoicingSubscriptionSelector_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector");
|
|
5
5
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
6
6
|
const couponViewSelector_1 = require("../couponView/couponViewSelector");
|
|
7
|
-
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
8
7
|
const invoicingCatalogListViewSelector_1 = require("../invoicingCatalogListView/invoicingCatalogListViewSelector");
|
|
9
8
|
const invoicingCustomerListViewSelector_1 = require("../invoicingCustomerListView/invoicingCustomerListViewSelector");
|
|
10
9
|
const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
|
|
11
10
|
const getEditInvoicingSubscriptionDetailViewState = (state, invoicingSubscriptionID) => {
|
|
12
11
|
const { error, fetchState, savedSubscriptionId } = state.editInvoicingSubscriptionDetailViewState;
|
|
13
|
-
const { subscriptionCommercialEditAllowedFromStatuses, subscriptionLifecycleActionOptions, subscriptionMetadataEditAllowedFromStatuses, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
14
12
|
return {
|
|
15
|
-
subscriptionCommercialEditAllowedFromStatuses,
|
|
16
|
-
subscriptionLifecycleActionOptions,
|
|
17
|
-
subscriptionMetadataEditAllowedFromStatuses,
|
|
18
13
|
subscription: invoicingSubscriptionID != null
|
|
19
14
|
? (0, invoicingSubscriptionSelector_1.getInvoicingSubscriptionById)(state.invoicingSubscriptionState, invoicingSubscriptionID)
|
|
20
15
|
: undefined,
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchInvoiceListPageEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const invoiceListState_1 = require("./invoiceListState");
|
|
7
6
|
const invoiceListReducer_1 = require("./invoiceListReducer");
|
|
8
7
|
/**
|
|
9
8
|
* Fetch unless the endpoint is already loaded or in flight — or always when the
|
|
@@ -20,7 +19,7 @@ const shouldFetch = (fetchStateAndError, cacheOverride) => cacheOverride ||
|
|
|
20
19
|
const fetchInvoiceListPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(invoiceListReducer_1.fetchInvoiceListPage.match), (0, operators_1.mergeMap)((action) => {
|
|
21
20
|
const { cacheOverride, filters, sort } = action.payload;
|
|
22
21
|
const state = state$.value.invoicingInvoiceListState;
|
|
23
|
-
const activeTabState = state.invoiceByTab[state.activeTab]
|
|
22
|
+
const activeTabState = state.invoiceByTab[state.activeTab];
|
|
24
23
|
const pageActions = [];
|
|
25
24
|
if (shouldFetch({ fetchState: activeTabState.fetchState, error: activeTabState.error }, cacheOverride)) {
|
|
26
25
|
pageActions.push((0, invoiceListReducer_1.fetchInvoiceList)({ filters, sort }));
|
|
@@ -42,7 +42,7 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
42
42
|
reducers: {
|
|
43
43
|
fetchInvoiceList: {
|
|
44
44
|
reducer(draft, action) {
|
|
45
|
-
const tab =
|
|
45
|
+
const tab = draft.invoiceByTab[draft.activeTab];
|
|
46
46
|
if (!action.payload.keepExistingListItems) {
|
|
47
47
|
tab.invoiceIds = [];
|
|
48
48
|
tab.nextCursor = null;
|
|
@@ -85,7 +85,7 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
87
|
updateInvoiceList(draft, action) {
|
|
88
|
-
const tab =
|
|
88
|
+
const tab = draft.invoiceByTab[draft.activeTab];
|
|
89
89
|
const newIds = action.payload.invoices.map((invoice) => invoice.id);
|
|
90
90
|
tab.invoiceIds = action.payload.keepExistingListItems
|
|
91
91
|
? [...new Set([...tab.invoiceIds, ...newIds])]
|
|
@@ -95,7 +95,7 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
95
95
|
tab.error = undefined;
|
|
96
96
|
},
|
|
97
97
|
updateInvoiceListFailure(draft, action) {
|
|
98
|
-
const tab =
|
|
98
|
+
const tab = draft.invoiceByTab[draft.activeTab];
|
|
99
99
|
tab.fetchState = 'Error';
|
|
100
100
|
tab.error = action.payload;
|
|
101
101
|
},
|
|
@@ -141,14 +141,14 @@ const invoiceList = (0, toolkit_1.createSlice)({
|
|
|
141
141
|
// are left untouched and refetched lazily.
|
|
142
142
|
addInvoiceToList(draft, action) {
|
|
143
143
|
const { id, status } = action.payload;
|
|
144
|
-
const allTab =
|
|
144
|
+
const allTab = draft.invoiceByTab['all'];
|
|
145
145
|
if (allTab.invoiceIds.includes(id)) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
allTab.invoiceIds = [id, ...allTab.invoiceIds];
|
|
149
149
|
const statusTab = statusToTabId(status);
|
|
150
150
|
if (statusTab != null) {
|
|
151
|
-
const tab =
|
|
151
|
+
const tab = draft.invoiceByTab[statusTab];
|
|
152
152
|
if (!tab.invoiceIds.includes(id)) {
|
|
153
153
|
tab.invoiceIds = [id, ...tab.invoiceIds];
|
|
154
154
|
}
|
|
@@ -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
|
|
4
|
+
import { InvoicingListCounts } 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,8 +12,6 @@ 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[];
|
|
17
15
|
tabIds: InvoicingInvoiceTabId[];
|
|
18
16
|
kpis?: InvoicingInvoiceKPIs;
|
|
19
17
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
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");
|
|
6
5
|
const invoiceListState_1 = require("./invoiceListState");
|
|
7
6
|
/**
|
|
8
7
|
* Bundled read view for the invoices list page: the denormalized invoice rows
|
|
@@ -10,11 +9,8 @@ const invoiceListState_1 = require("./invoiceListState");
|
|
|
10
9
|
* array (and the wrapping view object) keep referential identity until the
|
|
11
10
|
* invoice entity slice or the list-view slice actually change.
|
|
12
11
|
*/
|
|
13
|
-
exports.getInvoiceListView = (0, toolkit_1.createSelector)((state) => state.invoicingInvoiceState, (state) => state.invoicingInvoiceListState, (
|
|
14
|
-
|
|
15
|
-
// cache entry until it is fetched, so default rather than crash.
|
|
16
|
-
const activeTabState = listViewState.invoiceByTab[listViewState.activeTab] ??
|
|
17
|
-
(0, invoiceListState_1.makeInvoiceTabState)();
|
|
12
|
+
exports.getInvoiceListView = (0, toolkit_1.createSelector)((state) => state.invoicingInvoiceState, (state) => state.invoicingInvoiceListState, (invoiceState, listViewState) => {
|
|
13
|
+
const activeTabState = listViewState.invoiceByTab[listViewState.activeTab];
|
|
18
14
|
return {
|
|
19
15
|
activeTab: listViewState.activeTab,
|
|
20
16
|
invoices: activeTabState.invoiceIds
|
|
@@ -26,11 +22,7 @@ exports.getInvoiceListView = (0, toolkit_1.createSelector)((state) => state.invo
|
|
|
26
22
|
kpis: listViewState.kpis,
|
|
27
23
|
kpisFetchState: listViewState.kpisFetchState,
|
|
28
24
|
nextCursor: activeTabState.nextCursor,
|
|
29
|
-
|
|
30
|
-
tabIds: (0, invoicingTabHelper_1.invoicingTabIdsFromConfig)({
|
|
31
|
-
allTabIds: invoiceListState_1.ALL_INVOICING_INVOICE_TAB_IDS,
|
|
32
|
-
statusOptions,
|
|
33
|
-
}),
|
|
25
|
+
tabIds: invoiceListState_1.INVOICING_INVOICE_TABS,
|
|
34
26
|
fetchState: activeTabState.fetchState,
|
|
35
27
|
error: activeTabState.error,
|
|
36
28
|
version: 1.0,
|
|
@@ -5,6 +5,13 @@ 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[];
|
|
8
15
|
/** Filters that drive the invoice list query (mirrors the Invoices hooks). */
|
|
9
16
|
export interface InvoiceListFilters {
|
|
10
17
|
customerId?: ID;
|
|
@@ -31,13 +38,7 @@ export interface InvoiceListState {
|
|
|
31
38
|
/** Base query shared across tabs (search / customer / subscription / dates). */
|
|
32
39
|
filters: InvoiceListFilters;
|
|
33
40
|
/** Per-tab cached invoice ids + cursor + fetch state. */
|
|
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>>;
|
|
41
|
+
invoiceByTab: Record<InvoicingInvoiceTabId, InvoiceTabState>;
|
|
41
42
|
kpisFetchState: FetchStateAndError;
|
|
42
43
|
/** Tab-independent money KPIs. */
|
|
43
44
|
kpis?: InvoicingInvoiceKPIs;
|
|
@@ -45,9 +46,4 @@ export interface InvoiceListState {
|
|
|
45
46
|
sort?: InvoicingListSort;
|
|
46
47
|
}
|
|
47
48
|
export declare const makeInvoiceTabState: () => InvoiceTabState;
|
|
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>>;
|
|
49
|
+
export declare const makeInvoiceByTab: () => 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.makeInvoiceTabState = exports.INVOICING_INVOICE_TABS = 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,6 +12,15 @@ 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
|
+
];
|
|
15
24
|
const makeInvoiceTabState = () => ({
|
|
16
25
|
invoiceIds: [],
|
|
17
26
|
nextCursor: null,
|
|
@@ -19,20 +28,6 @@ const makeInvoiceTabState = () => ({
|
|
|
19
28
|
error: undefined,
|
|
20
29
|
});
|
|
21
30
|
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;
|
|
36
31
|
const makeInvoiceByTab = () => exports.ALL_INVOICING_INVOICE_TAB_IDS.reduce((acc, tabId) => {
|
|
37
32
|
acc[tabId] = (0, exports.makeInvoiceTabState)();
|
|
38
33
|
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,
|
|
3
|
+
import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, 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,14 +20,6 @@ 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[];
|
|
31
23
|
catalogTierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey;
|
|
32
24
|
plan?: InvoicingPlan;
|
|
33
25
|
}
|
package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js
CHANGED
|
@@ -5,17 +5,13 @@ 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 {
|
|
8
|
+
const { catalogItemLifecycleActionOptions, catalogProductLifecycleActionOptions, catalogTierTypeOptionsByPricingModel, 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,
|
|
15
14
|
plan: (0, planSelector_1.getInvoicingPlanById)(state.invoicingPlanState, id),
|
|
16
|
-
trialEndActionOptions: catalogTrialEndActionOptions,
|
|
17
|
-
trialUnitOptions: catalogTrialUnitOptions,
|
|
18
|
-
typeOptions: catalogItemTypeOptions,
|
|
19
15
|
fetchState,
|
|
20
16
|
error,
|
|
21
17
|
version: 1.0,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import {
|
|
3
|
+
import { 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>[];
|
|
12
10
|
count: InvoicingListCounts;
|
|
13
11
|
countsFetchState: FetchStateAndError;
|
|
14
12
|
planFilters: InvoicingCatalogPlanFilters;
|