@zeniai/client-epic-state 5.1.35-betaAK3 → 5.1.35-betaAK4
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/couponPayload.d.ts +1 -0
- package/lib/entity/invoicing/coupon/couponPayload.js +4 -5
- package/lib/entity/invoicing/dunningCase/dunningCasePayload.d.ts +1 -0
- package/lib/entity/invoicing/dunningCase/dunningCasePayload.js +4 -5
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -1
- package/lib/entity/invoicing/invoicingCommonState.d.ts +0 -5
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +1 -0
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +3 -4
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +1 -0
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +3 -4
- package/lib/entity/invoicing/plan/planPayload.d.ts +1 -0
- package/lib/entity/invoicing/plan/planPayload.js +5 -6
- package/lib/entity/invoicing/product/productPayload.d.ts +1 -0
- package/lib/entity/invoicing/product/productPayload.js +3 -4
- package/lib/esm/entity/invoicing/coupon/couponPayload.js +4 -5
- package/lib/esm/entity/invoicing/dunningCase/dunningCasePayload.js +4 -5
- package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +3 -4
- package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +3 -4
- package/lib/esm/entity/invoicing/plan/planPayload.js +5 -6
- package/lib/esm/entity/invoicing/product/productPayload.js +3 -4
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +1 -1
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +1 -1
- package/lib/esm/view/invoicing/paymentAction/paymentActionEpic.js +1 -1
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +1 -1
- package/lib/view/invoicing/dunningAction/dunningActionReducer.d.ts +1 -0
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +1 -1
- package/lib/view/invoicing/paymentAction/paymentActionEpic.js +1 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +1 -1
- package/package.json +1 -1
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingDiscountKPIsPayloadToState = exports.mapInvoicingCouponPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapInvoicingCouponPayloadToState = (payload) => {
|
|
10
|
-
const currencyCode = payload.currency_code ??
|
|
11
|
-
const currencySymbol =
|
|
9
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
10
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
12
11
|
return {
|
|
13
12
|
id: payload.id,
|
|
14
13
|
applyOn: payload.apply_on,
|
|
@@ -41,7 +40,7 @@ const mapInvoicingCouponPayloadToState = (payload) => {
|
|
|
41
40
|
exports.mapInvoicingCouponPayloadToState = mapInvoicingCouponPayloadToState;
|
|
42
41
|
const mapInvoicingDiscountKPIsPayloadToState = (payload) => ({
|
|
43
42
|
totalActive: payload.total_active,
|
|
44
|
-
totalDiscountedAmount: (0, amount_1.toAmount)(payload.total_discounted_amount,
|
|
43
|
+
totalDiscountedAmount: (0, amount_1.toAmount)(payload.total_discounted_amount, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
45
44
|
totalExpired: payload.total_expired,
|
|
46
45
|
totalRedemptions: payload.total_redemptions,
|
|
47
46
|
});
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingDunningKPIsPayloadToState = exports.mapInvoicingDunningCasePayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapInvoicingDunningCasePayloadToState = (payload) => {
|
|
10
|
-
const currencyCode = payload.currency_code ??
|
|
11
|
-
const currencySymbol =
|
|
9
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
10
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
12
11
|
return {
|
|
13
12
|
id: payload.id,
|
|
14
13
|
status: payload.status,
|
|
@@ -36,7 +35,7 @@ const mapInvoicingDunningCasePayloadToState = (payload) => {
|
|
|
36
35
|
exports.mapInvoicingDunningCasePayloadToState = mapInvoicingDunningCasePayloadToState;
|
|
37
36
|
const mapInvoicingDunningKPIsPayloadToState = (payload) => ({
|
|
38
37
|
activeCases: payload.active_cases,
|
|
39
|
-
atRiskAmount: (0, amount_1.toAmount)(payload.at_risk_amount,
|
|
38
|
+
atRiskAmount: (0, amount_1.toAmount)(payload.at_risk_amount, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
40
39
|
recoveryRate: payload.recovery_rate,
|
|
41
40
|
totalCases: payload.total_cases,
|
|
42
41
|
avgDaysToResolve: payload.avg_days_to_resolve,
|
|
@@ -23,8 +23,6 @@ export interface InvoicingSettings {
|
|
|
23
23
|
dateFormat: string;
|
|
24
24
|
defaultMemo: string;
|
|
25
25
|
phoneEnabled: boolean;
|
|
26
|
-
showServicePeriods: boolean;
|
|
27
|
-
showTaxId: boolean;
|
|
28
26
|
taxEnabled: boolean;
|
|
29
27
|
accentColor?: string;
|
|
30
28
|
address?: InvoicingBillingAddress;
|
|
@@ -34,12 +32,9 @@ export interface InvoicingSettings {
|
|
|
34
32
|
id?: ID;
|
|
35
33
|
invoicePrefix?: string;
|
|
36
34
|
logoUrl?: ZeniUrl;
|
|
37
|
-
netTermDays?: number;
|
|
38
|
-
paymentTerms?: string;
|
|
39
35
|
phone?: string;
|
|
40
36
|
stripeConnectedAccountId?: ID;
|
|
41
37
|
stripePublishableKey?: ID;
|
|
42
38
|
taxId?: ID;
|
|
43
39
|
taxRate?: number;
|
|
44
|
-
timezone?: string;
|
|
45
40
|
}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingCustomerPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
const invoicingSubscriptionPayload_1 = require("../invoicingSubscription/invoicingSubscriptionPayload");
|
|
7
8
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
8
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
9
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
10
9
|
const mapInvoicingCustomerPayloadToState = (payload) => {
|
|
11
|
-
const currencyCode = payload.preferred_currency_code ??
|
|
12
|
-
const currencySymbol =
|
|
10
|
+
const currencyCode = payload.preferred_currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
11
|
+
const currencySymbol = payload.preferred_currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
13
12
|
return {
|
|
14
13
|
id: payload.id,
|
|
15
14
|
allowDirectDebit: payload.allow_direct_debit,
|
|
@@ -45,6 +45,7 @@ export interface InvoicingSubscriptionPayload {
|
|
|
45
45
|
coupons?: InvoicingSubscriptionCouponPayload[];
|
|
46
46
|
created_at?: string;
|
|
47
47
|
currency_code?: string;
|
|
48
|
+
currency_symbol?: string;
|
|
48
49
|
current_term_end?: string;
|
|
49
50
|
current_term_start?: string;
|
|
50
51
|
customer_name?: string;
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingSubscriptionPayloadToState = exports.mapInvoicingContractTermPayloadToState = exports.mapInvoicingSubscriptionCouponPayloadToState = exports.mapInvoicingSubscriptionItemPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapInvoicingSubscriptionItemPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
10
9
|
amount: payload.amount != null
|
|
11
10
|
? (0, amount_1.toAmount)(payload.amount, currencyCode, currencySymbol)
|
|
@@ -43,8 +42,8 @@ const mapInvoicingContractTermPayloadToState = (payload, currencyCode, currencyS
|
|
|
43
42
|
});
|
|
44
43
|
exports.mapInvoicingContractTermPayloadToState = mapInvoicingContractTermPayloadToState;
|
|
45
44
|
const mapInvoicingSubscriptionPayloadToState = (payload) => {
|
|
46
|
-
const currencyCode = payload.currency_code ??
|
|
47
|
-
const currencySymbol =
|
|
45
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
46
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
48
47
|
return {
|
|
49
48
|
customerID: payload.customer_id,
|
|
50
49
|
id: payload.id,
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingCatalogKPIsPayloadToState = exports.mapInvoicingPlanPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
const productPayload_1 = require("../product/productPayload");
|
|
7
8
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
8
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
9
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
10
9
|
const mapInvoicingPlanPayloadToState = (payload) => {
|
|
11
|
-
const currencyCode = payload.currency_code ??
|
|
12
|
-
const currencySymbol =
|
|
10
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
11
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
13
12
|
return {
|
|
14
13
|
id: payload.id,
|
|
15
14
|
applicableItems: payload.applicable_items,
|
|
@@ -51,7 +50,7 @@ exports.mapInvoicingPlanPayloadToState = mapInvoicingPlanPayloadToState;
|
|
|
51
50
|
const mapInvoicingCatalogKPIsPayloadToState = (payload) => ({
|
|
52
51
|
activePlans: payload.active_plans,
|
|
53
52
|
activeProducts: payload.active_products,
|
|
54
|
-
avgPlanPrice: (0, amount_1.toAmount)(payload.avg_plan_price,
|
|
55
|
-
totalMrr: (0, amount_1.toAmount)(payload.total_mrr,
|
|
53
|
+
avgPlanPrice: (0, amount_1.toAmount)(payload.avg_plan_price, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
54
|
+
totalMrr: (0, amount_1.toAmount)(payload.total_mrr, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
56
55
|
});
|
|
57
56
|
exports.mapInvoicingCatalogKPIsPayloadToState = mapInvoicingCatalogKPIsPayloadToState;
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingProductPayloadToState = exports.mapInvoicingPlanTierPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapInvoicingPlanTierPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
10
9
|
price: (0, amount_1.toAmount)(payload.price, currencyCode, currencySymbol),
|
|
11
10
|
startingUnit: payload.starting_unit,
|
|
@@ -23,8 +22,8 @@ const mapInvoicingAccountingDetailPayloadToState = (payload) => ({
|
|
|
23
22
|
sku: payload.sku,
|
|
24
23
|
});
|
|
25
24
|
const mapInvoicingProductPayloadToState = (payload) => {
|
|
26
|
-
const currencyCode = payload.currency_code ??
|
|
27
|
-
const currencySymbol =
|
|
25
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
26
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
28
27
|
return {
|
|
29
28
|
id: payload.id,
|
|
30
29
|
accountingDetail: payload.accounting_detail != null
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
export const mapInvoicingCouponPayloadToState = (payload) => {
|
|
7
|
-
const currencyCode = payload.currency_code ??
|
|
8
|
-
const currencySymbol =
|
|
6
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
7
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
9
8
|
return {
|
|
10
9
|
id: payload.id,
|
|
11
10
|
applyOn: payload.apply_on,
|
|
@@ -37,7 +36,7 @@ export const mapInvoicingCouponPayloadToState = (payload) => {
|
|
|
37
36
|
};
|
|
38
37
|
export const mapInvoicingDiscountKPIsPayloadToState = (payload) => ({
|
|
39
38
|
totalActive: payload.total_active,
|
|
40
|
-
totalDiscountedAmount: toAmount(payload.total_discounted_amount,
|
|
39
|
+
totalDiscountedAmount: toAmount(payload.total_discounted_amount, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
41
40
|
totalExpired: payload.total_expired,
|
|
42
41
|
totalRedemptions: payload.total_redemptions,
|
|
43
42
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
export const mapInvoicingDunningCasePayloadToState = (payload) => {
|
|
7
|
-
const currencyCode = payload.currency_code ??
|
|
8
|
-
const currencySymbol =
|
|
6
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
7
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
9
8
|
return {
|
|
10
9
|
id: payload.id,
|
|
11
10
|
status: payload.status,
|
|
@@ -32,7 +31,7 @@ export const mapInvoicingDunningCasePayloadToState = (payload) => {
|
|
|
32
31
|
};
|
|
33
32
|
export const mapInvoicingDunningKPIsPayloadToState = (payload) => ({
|
|
34
33
|
activeCases: payload.active_cases,
|
|
35
|
-
atRiskAmount: toAmount(payload.at_risk_amount,
|
|
34
|
+
atRiskAmount: toAmount(payload.at_risk_amount, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
36
35
|
recoveryRate: payload.recovery_rate,
|
|
37
36
|
totalCases: payload.total_cases,
|
|
38
37
|
avgDaysToResolve: payload.avg_days_to_resolve,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
import { mapInvoicingSubscriptionPayloadToState, } from '../invoicingSubscription/invoicingSubscriptionPayload';
|
|
4
5
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
5
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
6
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
7
6
|
export const mapInvoicingCustomerPayloadToState = (payload) => {
|
|
8
|
-
const currencyCode = payload.preferred_currency_code ??
|
|
9
|
-
const currencySymbol =
|
|
7
|
+
const currencyCode = payload.preferred_currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
8
|
+
const currencySymbol = payload.preferred_currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
10
9
|
return {
|
|
11
10
|
id: payload.id,
|
|
12
11
|
allowDirectDebit: payload.allow_direct_debit,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
export const mapInvoicingSubscriptionItemPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
7
6
|
amount: payload.amount != null
|
|
8
7
|
? toAmount(payload.amount, currencyCode, currencySymbol)
|
|
@@ -37,8 +36,8 @@ export const mapInvoicingContractTermPayloadToState = (payload, currencyCode, cu
|
|
|
37
36
|
: undefined,
|
|
38
37
|
});
|
|
39
38
|
export const mapInvoicingSubscriptionPayloadToState = (payload) => {
|
|
40
|
-
const currencyCode = payload.currency_code ??
|
|
41
|
-
const currencySymbol =
|
|
39
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
40
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
42
41
|
return {
|
|
43
42
|
customerID: payload.customer_id,
|
|
44
43
|
id: payload.id,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
import { mapInvoicingPlanTierPayloadToState, mapInvoicingProductPayloadToState, } from '../product/productPayload';
|
|
4
5
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
5
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
6
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
7
6
|
export const mapInvoicingPlanPayloadToState = (payload) => {
|
|
8
|
-
const currencyCode = payload.currency_code ??
|
|
9
|
-
const currencySymbol =
|
|
7
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
8
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
10
9
|
return {
|
|
11
10
|
id: payload.id,
|
|
12
11
|
applicableItems: payload.applicable_items,
|
|
@@ -47,6 +46,6 @@ export const mapInvoicingPlanPayloadToState = (payload) => {
|
|
|
47
46
|
export const mapInvoicingCatalogKPIsPayloadToState = (payload) => ({
|
|
48
47
|
activePlans: payload.active_plans,
|
|
49
48
|
activeProducts: payload.active_products,
|
|
50
|
-
avgPlanPrice: toAmount(payload.avg_plan_price,
|
|
51
|
-
totalMrr: toAmount(payload.total_mrr,
|
|
49
|
+
avgPlanPrice: toAmount(payload.avg_plan_price, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
50
|
+
totalMrr: toAmount(payload.total_mrr, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
52
51
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
export const mapInvoicingPlanTierPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
7
6
|
price: toAmount(payload.price, currencyCode, currencySymbol),
|
|
8
7
|
startingUnit: payload.starting_unit,
|
|
@@ -19,8 +18,8 @@ const mapInvoicingAccountingDetailPayloadToState = (payload) => ({
|
|
|
19
18
|
sku: payload.sku,
|
|
20
19
|
});
|
|
21
20
|
export const mapInvoicingProductPayloadToState = (payload) => {
|
|
22
|
-
const currencyCode = payload.currency_code ??
|
|
23
|
-
const currencySymbol =
|
|
21
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
22
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
24
23
|
return {
|
|
25
24
|
id: payload.id,
|
|
26
25
|
accountingDetail: payload.accounting_detail != null
|
|
@@ -7,7 +7,7 @@ export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => act
|
|
|
7
7
|
const { action: kind, body, id } = action.payload;
|
|
8
8
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/dunning/${encodeURIComponent(id)}/${kind}`;
|
|
9
9
|
return zeniAPI
|
|
10
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
10
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
11
11
|
.pipe(mergeMap((response) => {
|
|
12
12
|
if (isSuccessResponse(response) && response.data != null) {
|
|
13
13
|
return [
|
|
@@ -7,7 +7,7 @@ export const runInvoicingInvoiceActionEpic = (actions$, _state$, zeniAPI) => act
|
|
|
7
7
|
const { action: kind, body, invoiceId } = action.payload;
|
|
8
8
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/invoices/${encodeURIComponent(invoiceId)}/${kind}`;
|
|
9
9
|
return zeniAPI
|
|
10
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
10
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
11
11
|
.pipe(mergeMap((response) => {
|
|
12
12
|
if (isSuccessResponse(response) && response.data != null) {
|
|
13
13
|
return [
|
|
@@ -7,7 +7,7 @@ export const runInvoicingPaymentActionEpic = (actions$, _state$, zeniAPI) => act
|
|
|
7
7
|
const { action: kind, body, id } = action.payload;
|
|
8
8
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/payments/${encodeURIComponent(id)}/${kind}`;
|
|
9
9
|
return zeniAPI
|
|
10
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
10
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
11
11
|
.pipe(mergeMap((response) => {
|
|
12
12
|
if (isSuccessResponse(response) && response.data != null) {
|
|
13
13
|
return [
|
|
@@ -7,7 +7,7 @@ export const runInvoicingSubscriptionActionEpic = (actions$, _state$, zeniAPI) =
|
|
|
7
7
|
const { action: kind, body, id } = action.payload;
|
|
8
8
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/subscriptions/${encodeURIComponent(id)}/${kind}`;
|
|
9
9
|
return zeniAPI
|
|
10
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
10
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
11
11
|
.pipe(mergeMap((response) => {
|
|
12
12
|
if (isSuccessResponse(response) && response.data != null) {
|
|
13
13
|
return [
|
package/lib/index.d.ts
CHANGED
|
@@ -1001,7 +1001,7 @@ export type { InvoicingDunningCase, InvoicingDunningKPIs, } from './entity/invoi
|
|
|
1001
1001
|
export type { InvoicingDunningStatus } from './entity/invoicing/dunningCase/dunningCasePayload';
|
|
1002
1002
|
export type { InvoicingInvoicePayload, InvoicingInvoiceStatus, } from './entity/invoicing/invoice/invoicePayload';
|
|
1003
1003
|
export type { InvoicingDunningAttempt, InvoicingInvoice, InvoicingInvoiceKPIs, InvoicingInvoiceNote, InvoicingIssuedCreditNote, InvoicingLineItem, InvoicingLinkedPayment, } from './entity/invoicing/invoice/invoiceState';
|
|
1004
|
-
export type { InvoicingBillingAddressPayload
|
|
1004
|
+
export type { InvoicingBillingAddressPayload, InvoicingFormOption, InvoicingListCounts, InvoicingPaginatedList, InvoicingPriceType, InvoicingSettingsPayload as InvoicingSettings, } from './entity/invoicing/invoicingCommonPayload';
|
|
1005
1005
|
export type { InvoicingCatalogKPIs, InvoicingPlan, } from './entity/invoicing/plan/planState';
|
|
1006
1006
|
export type { InvoicingAccountingDetail, InvoicingPlanTier, InvoicingProduct, } from './entity/invoicing/product/productState';
|
|
1007
1007
|
export type { InvoicingBillingPeriodUnit, InvoicingSubscriptionStatus, } from './entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload';
|
|
@@ -10,7 +10,7 @@ const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
10
10
|
const { action: kind, body, id } = action.payload;
|
|
11
11
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/dunning/${encodeURIComponent(id)}/${kind}`;
|
|
12
12
|
return zeniAPI
|
|
13
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
13
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
14
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
15
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
16
16
|
return [
|
|
@@ -9,6 +9,7 @@ export interface RunInvoicingDunningActionPayload {
|
|
|
9
9
|
body?: InvoicingDunningActionBody;
|
|
10
10
|
}
|
|
11
11
|
export declare const initialState: InvoicingDunningActionState;
|
|
12
|
+
export type { InvoicingDunningActionState } from './dunningActionState';
|
|
12
13
|
export declare const runInvoicingDunningAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<RunInvoicingDunningActionPayload, "invoicingDunningAction/runInvoicingDunningAction">, runInvoicingDunningActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
14
|
id: ID;
|
|
14
15
|
}, "invoicingDunningAction/runInvoicingDunningActionSuccess">, runInvoicingDunningActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -10,7 +10,7 @@ const runInvoicingInvoiceActionEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
10
10
|
const { action: kind, body, invoiceId } = action.payload;
|
|
11
11
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/invoices/${encodeURIComponent(invoiceId)}/${kind}`;
|
|
12
12
|
return zeniAPI
|
|
13
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
13
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
14
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
15
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
16
16
|
return [
|
|
@@ -10,7 +10,7 @@ const runInvoicingPaymentActionEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
10
10
|
const { action: kind, body, id } = action.payload;
|
|
11
11
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/payments/${encodeURIComponent(id)}/${kind}`;
|
|
12
12
|
return zeniAPI
|
|
13
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
13
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
14
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
15
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
16
16
|
return [
|
|
@@ -10,7 +10,7 @@ const runInvoicingSubscriptionActionEpic = (actions$, _state$, zeniAPI) => actio
|
|
|
10
10
|
const { action: kind, body, id } = action.payload;
|
|
11
11
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/subscriptions/${encodeURIComponent(id)}/${kind}`;
|
|
12
12
|
return zeniAPI
|
|
13
|
-
.postAndGetJSON(apiUrl, body ?? {})
|
|
13
|
+
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
14
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
15
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
16
16
|
return [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.35-
|
|
3
|
+
"version": "5.1.35-betaAK4",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|