@zeniai/client-epic-state 5.1.35-betaAK1 → 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/expenseAutomationView/selectors/reconciliationViewSelector.js +1 -2
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +1 -2
- package/lib/view/invoicing/dunningAction/dunningActionReducer.d.ts +1 -0
- package/lib/view/invoicing/dunningAction/dunningActionRequestPayload.d.ts +8 -8
- package/lib/view/invoicing/invoiceAction/invoiceActionRequestPayload.d.ts +16 -16
- package/lib/view/invoicing/paymentAction/paymentActionRequestPayload.d.ts +2 -2
- package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +14 -14
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.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
|
|
@@ -451,8 +451,7 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
451
451
|
summary: summaryWithTimeSaved,
|
|
452
452
|
};
|
|
453
453
|
});
|
|
454
|
-
export const getReparseStatementStatusByAccountId = (state, accountId) => getExpenseAutomationReconciliationView(state)
|
|
455
|
-
.accountReconciliationsByAccountID[accountId]?.reparseStatementStatus;
|
|
454
|
+
export const getReparseStatementStatusByAccountId = (state, accountId) => getExpenseAutomationReconciliationView(state).accountReconciliationsByAccountID[accountId]?.reparseStatementStatus;
|
|
456
455
|
export const isAccountReconReport = (reportId) => {
|
|
457
456
|
return reportId.endsWith('reconciliation');
|
|
458
457
|
};
|
|
@@ -3,7 +3,6 @@ import { from, of } from 'rxjs';
|
|
|
3
3
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
4
4
|
import { toRecommendationPayload } from '../../../commonPayloadTypes/recommendationPayload';
|
|
5
5
|
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
-
import { getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, } from '../../../entity/tenant/tenantSelector';
|
|
7
6
|
import { toCustomerTransactionPayload } from '../../../entity/transaction/payloadTypes/customerTransactionPayload';
|
|
8
7
|
import { toTransferTransactionPayload } from '../../../entity/transaction/payloadTypes/otherTransactionPayload';
|
|
9
8
|
import { toTransactionID } from '../../../entity/transaction/payloadTypes/transactionIDPayload';
|
|
@@ -20,6 +19,7 @@ import { getSupportedTransactionById } from '../../../entity/transaction/transac
|
|
|
20
19
|
import { updateVendors } from '../../../entity/vendor/vendorReducer';
|
|
21
20
|
import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
|
|
22
21
|
import { createZeniAPIStatus, isActionNotAllowed, isSuccessResponse, } from '../../../responsePayload';
|
|
22
|
+
import { getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, } from '../../../entity/tenant/tenantSelector';
|
|
23
23
|
import { getUncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
24
24
|
import { getPendingReviewLineIdsFromTransaction } from '../../expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
|
|
25
25
|
import { syncTransactionCategorizationFromDetailSave } from '../../expenseAutomationView/reducers/transactionsViewReducer';
|
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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { updateAccountReconReparseStatement } from '../../../../entity/accountRecon/accountReconReducer';
|
|
3
2
|
import { RootState } from '../../../../reducer';
|
|
3
|
+
import { updateAccountReconReparseStatement } from '../../../../entity/accountRecon/accountReconReducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
5
|
import { reparseStatement, reparseStatementFailure, reparseStatementSuccess } from '../../reducers/reconciliationViewReducer';
|
|
6
6
|
export type ActionType = ReturnType<typeof reparseStatement> | ReturnType<typeof reparseStatementSuccess> | ReturnType<typeof reparseStatementFailure> | ReturnType<typeof updateAccountReconReparseStatement>;
|
|
@@ -457,8 +457,7 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
457
457
|
summary: summaryWithTimeSaved,
|
|
458
458
|
};
|
|
459
459
|
});
|
|
460
|
-
const getReparseStatementStatusByAccountId = (state, accountId) => (0, exports.getExpenseAutomationReconciliationView)(state)
|
|
461
|
-
.accountReconciliationsByAccountID[accountId]?.reparseStatementStatus;
|
|
460
|
+
const getReparseStatementStatusByAccountId = (state, accountId) => (0, exports.getExpenseAutomationReconciliationView)(state).accountReconciliationsByAccountID[accountId]?.reparseStatementStatus;
|
|
462
461
|
exports.getReparseStatementStatusByAccountId = getReparseStatementStatusByAccountId;
|
|
463
462
|
const isAccountReconReport = (reportId) => {
|
|
464
463
|
return reportId.endsWith('reconciliation');
|
|
@@ -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<{
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/** Snake_case request bodies for dunning action endpoints. */
|
|
2
|
-
export
|
|
2
|
+
export type DunningPauseBody = {
|
|
3
3
|
duration?: number;
|
|
4
4
|
reason?: string;
|
|
5
5
|
resume_date?: string;
|
|
6
|
-
}
|
|
7
|
-
export
|
|
6
|
+
};
|
|
7
|
+
export type DunningCollectBody = {
|
|
8
8
|
amount?: number;
|
|
9
9
|
payment_method?: string;
|
|
10
|
-
}
|
|
11
|
-
export
|
|
10
|
+
};
|
|
11
|
+
export type DunningEmailBody = {
|
|
12
12
|
body?: string;
|
|
13
13
|
cc?: string;
|
|
14
14
|
subject?: string;
|
|
15
15
|
to?: string;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
};
|
|
17
|
+
export type DunningBulkEmailBody = {
|
|
18
18
|
body?: string;
|
|
19
19
|
case_ids?: string[];
|
|
20
20
|
cc?: string;
|
|
21
21
|
subject?: string;
|
|
22
22
|
to?: string;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
export type InvoicingDunningActionBody = DunningPauseBody | DunningCollectBody | DunningEmailBody | DunningBulkEmailBody | Record<string, never>;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
/** Snake_case request bodies for invoice action endpoints. */
|
|
2
|
-
export
|
|
2
|
+
export type RecordPaymentBody = {
|
|
3
3
|
amount: number;
|
|
4
4
|
date?: string;
|
|
5
5
|
gateway?: string;
|
|
6
6
|
installment_id?: string;
|
|
7
7
|
payment_method?: string;
|
|
8
8
|
reference_number?: string;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
9
|
+
};
|
|
10
|
+
export type WriteOffBody = {
|
|
11
11
|
amount: number;
|
|
12
12
|
reason?: string;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
};
|
|
14
|
+
export type IssueCreditNoteLineItemBody = {
|
|
15
15
|
amount?: number;
|
|
16
16
|
description?: string;
|
|
17
17
|
entity_type?: string;
|
|
18
18
|
id?: string;
|
|
19
19
|
quantity?: number;
|
|
20
20
|
unit_amount?: number;
|
|
21
|
-
}
|
|
22
|
-
export
|
|
21
|
+
};
|
|
22
|
+
export type IssueCreditNoteBody = {
|
|
23
23
|
amount?: number;
|
|
24
24
|
line_items?: IssueCreditNoteLineItemBody[];
|
|
25
25
|
reason_code?: string;
|
|
26
26
|
type?: 'adjustment' | 'refundable' | 'store';
|
|
27
|
-
}
|
|
28
|
-
export
|
|
27
|
+
};
|
|
28
|
+
export type RemovePaymentBody = {
|
|
29
29
|
txn_id: string;
|
|
30
|
-
}
|
|
31
|
-
export
|
|
30
|
+
};
|
|
31
|
+
export type ApplyExcessBody = {
|
|
32
32
|
amount: number;
|
|
33
33
|
target_invoice_id: string;
|
|
34
|
-
}
|
|
35
|
-
export
|
|
34
|
+
};
|
|
35
|
+
export type PaymentInstallmentBody = {
|
|
36
36
|
amount: number;
|
|
37
37
|
due_date: string;
|
|
38
38
|
id?: string;
|
|
39
39
|
seq?: number;
|
|
40
|
-
}
|
|
41
|
-
export
|
|
40
|
+
};
|
|
41
|
+
export type PaymentScheduleBody = {
|
|
42
42
|
installments: PaymentInstallmentBody[];
|
|
43
43
|
interval_count?: number;
|
|
44
44
|
interval_unit?: 'month' | 'year' | 'week' | 'day';
|
|
45
45
|
type?: 'fixed' | 'flexible';
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
export type InvoicingInvoiceActionBody = RecordPaymentBody | WriteOffBody | IssueCreditNoteBody | RemovePaymentBody | ApplyExcessBody | PaymentScheduleBody | Record<string, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Snake_case request bodies for payment action endpoints. */
|
|
2
|
-
export
|
|
2
|
+
export type RefundPaymentBody = {
|
|
3
3
|
amount?: number;
|
|
4
4
|
reason?: string;
|
|
5
5
|
refund_method?: string;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export type InvoicingPaymentActionBody = RefundPaymentBody | Record<string, never>;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/** Snake_case request bodies for subscription action endpoints. */
|
|
2
|
-
export
|
|
2
|
+
export type ApplyCouponBody = {
|
|
3
3
|
coupon_code: string;
|
|
4
|
-
}
|
|
5
|
-
export
|
|
4
|
+
};
|
|
5
|
+
export type SubscriptionChargeItemBody = {
|
|
6
6
|
unit_price: number;
|
|
7
7
|
description?: string;
|
|
8
8
|
item_price_id?: string;
|
|
9
9
|
quantity?: number;
|
|
10
|
-
}
|
|
11
|
-
export
|
|
10
|
+
};
|
|
11
|
+
export type AddChargesBody = {
|
|
12
12
|
charges: SubscriptionChargeItemBody[];
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
};
|
|
14
|
+
export type PauseSubscriptionBody = {
|
|
15
15
|
pause_reason?: string;
|
|
16
16
|
resume_date?: string;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
};
|
|
18
|
+
export type CancelSubscriptionBody = {
|
|
19
19
|
cancel_reason?: string;
|
|
20
20
|
cancel_reason_code?: string;
|
|
21
21
|
end_of_term?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type ChangePlanBody = {
|
|
24
24
|
billing_period?: number;
|
|
25
25
|
billing_period_unit?: 'month' | 'year' | 'week' | 'day';
|
|
26
26
|
item_price_id?: string;
|
|
@@ -33,11 +33,11 @@ export interface ChangePlanBody {
|
|
|
33
33
|
quantity?: number;
|
|
34
34
|
unit_price?: number;
|
|
35
35
|
}[];
|
|
36
|
-
}
|
|
37
|
-
export
|
|
36
|
+
};
|
|
37
|
+
export type ScheduleChargeBody = {
|
|
38
38
|
amount: number;
|
|
39
39
|
charge_date: string;
|
|
40
40
|
description: string;
|
|
41
41
|
payment_method?: string;
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
export type InvoicingSubscriptionActionBody = ApplyCouponBody | AddChargesBody | PauseSubscriptionBody | CancelSubscriptionBody | ChangePlanBody | ScheduleChargeBody | Record<string, never>;
|
|
@@ -9,7 +9,6 @@ const rxjs_1 = require("rxjs");
|
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
10
10
|
const recommendationPayload_1 = require("../../../commonPayloadTypes/recommendationPayload");
|
|
11
11
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
12
|
-
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
13
12
|
const customerTransactionPayload_1 = require("../../../entity/transaction/payloadTypes/customerTransactionPayload");
|
|
14
13
|
const otherTransactionPayload_1 = require("../../../entity/transaction/payloadTypes/otherTransactionPayload");
|
|
15
14
|
const transactionIDPayload_1 = require("../../../entity/transaction/payloadTypes/transactionIDPayload");
|
|
@@ -26,6 +25,7 @@ const transactionSelector_1 = require("../../../entity/transaction/transactionSe
|
|
|
26
25
|
const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
|
|
27
26
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
28
27
|
const responsePayload_1 = require("../../../responsePayload");
|
|
28
|
+
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
29
29
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
30
30
|
const transactionCategorizationLocalDataHelper_1 = require("../../expenseAutomationView/helpers/transactionCategorizationLocalDataHelper");
|
|
31
31
|
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
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",
|