@zeniai/client-epic-state 4.19.13-betaRR2 → 4.19.13-betaSS2
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/view/dashboard/dashboardSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +4 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +2 -6
- package/package.json +2 -2
|
@@ -12,4 +12,4 @@ export interface DashboardReport extends SelectorReport {
|
|
|
12
12
|
currentTenant?: Tenant;
|
|
13
13
|
}
|
|
14
14
|
export declare const getDashboard: (state: RootState, additionalExcludedReports: ReportID[], // used when reports are excluded through statsig
|
|
15
|
-
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean, isTreasuryFeatureEnabled: boolean) => DashboardReport;
|
|
15
|
+
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean, isDebitCardFeatureEnabled: boolean, isTreasuryFeatureEnabled: boolean) => DashboardReport;
|
|
@@ -45,7 +45,7 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
|
|
|
45
45
|
exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
|
|
46
46
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
47
47
|
return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
|
|
48
|
-
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryFeatureEnabled, isTreasuryVideoClosed) => {
|
|
48
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isDebitCardFeatureEnabled) => isDebitCardFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, _debitEnabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isDebitCardFeatureEnabled, isTreasuryFeatureEnabled, isTreasuryVideoClosed) => {
|
|
49
49
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
50
50
|
const isReimbursementFeatureEnabled = (_a = tenants.currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
|
|
51
51
|
const isBillPayFeatureEnabled = (_b = tenants.currentTenant.company) === null || _b === void 0 ? void 0 : _b.featuresActivationInfo.isBillPayFeatureEnabled;
|
|
@@ -70,7 +70,9 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
70
70
|
cardsToRemove.add('card_balance');
|
|
71
71
|
isZeniPromoCardOn4thPosition = false;
|
|
72
72
|
}
|
|
73
|
-
else if (isChargeCardEnabled ||
|
|
73
|
+
else if (isChargeCardEnabled ||
|
|
74
|
+
creditAccountLimit === -1 ||
|
|
75
|
+
(isDebitCardFeatureEnabled && creditAccountLimit === 0)) {
|
|
74
76
|
cardsToRemove.add('zeni_promo_card');
|
|
75
77
|
isZeniPromoCardOn4thPosition = false;
|
|
76
78
|
}
|
|
@@ -110,6 +110,7 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
110
110
|
const allRequiredStepsCompleted = requiredStepsData.every((step) => {
|
|
111
111
|
return completedSteps.includes(step);
|
|
112
112
|
});
|
|
113
|
+
console.log('completedSteps', completedSteps, requiredStepsData);
|
|
113
114
|
const allStepsCompleted = allStepsData.every((step) => {
|
|
114
115
|
return completedSteps.includes(step);
|
|
115
116
|
});
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts
CHANGED
|
@@ -8,12 +8,11 @@ export declare const fetchChargeCardSetupView: import("@reduxjs/toolkit").Action
|
|
|
8
8
|
}, "chargeCardSetupView/fetchChargeCardSetupView", never, never>, fetchChargeCardSetupViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/fetchChargeCardSetupViewSuccess">, fetchChargeCardSetupViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/fetchChargeCardSetupViewFailure", never, never>, enableChargeCardAutoPay: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, isAutoPayEnabled: boolean], {
|
|
9
9
|
companyId: string;
|
|
10
10
|
isAutoPayEnabled: boolean;
|
|
11
|
-
}, "chargeCardSetupView/enableChargeCardAutoPay", never, never>, enableChargeCardAutoPaySuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/enableChargeCardAutoPaySuccess">, enableChargeCardAutoPayFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/enableChargeCardAutoPayFailure", never, never>, acceptChargeCardTerms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, enableChargeCard: boolean, chargeCardSetupViewType: "charge_cards" | "debit_cards" | "charge_cards__debit_cards", isEarlyPayEnabled: boolean
|
|
11
|
+
}, "chargeCardSetupView/enableChargeCardAutoPay", never, never>, enableChargeCardAutoPaySuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/enableChargeCardAutoPaySuccess">, enableChargeCardAutoPayFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/enableChargeCardAutoPayFailure", never, never>, acceptChargeCardTerms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, enableChargeCard: boolean, chargeCardSetupViewType: "charge_cards" | "debit_cards" | "charge_cards__debit_cards", isEarlyPayEnabled: boolean], {
|
|
12
12
|
companyId: string;
|
|
13
13
|
enableChargeCard: boolean;
|
|
14
14
|
chargeCardSetupViewType: "charge_cards" | "debit_cards" | "charge_cards__debit_cards";
|
|
15
15
|
isEarlyPayEnabled: boolean;
|
|
16
|
-
isCompanyInterestedInChargeCard: boolean;
|
|
17
16
|
}, "chargeCardSetupView/acceptChargeCardTerms", never, never>, acceptChargeCardTermsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/acceptChargeCardTermsSuccess">, acceptChargeCardTermsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/acceptChargeCardTermsFailure", never, never>, expressInterestInChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
18
17
|
companyId: string;
|
|
19
18
|
}, "chargeCardSetupView/expressInterestInChargeCard", never, never>, expressInterestInChargeCardSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/expressInterestInChargeCardSuccess">, expressInterestInChargeCardFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/expressInterestInChargeCardFailure">, clearChargeCardSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/clearChargeCardSetupView">;
|
|
@@ -91,14 +91,13 @@ const chargeCardSetupView = (0, toolkit_1.createSlice)({
|
|
|
91
91
|
},
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
|
-
prepare(companyId, enableChargeCard, chargeCardSetupViewType, isEarlyPayEnabled
|
|
94
|
+
prepare(companyId, enableChargeCard, chargeCardSetupViewType, isEarlyPayEnabled) {
|
|
95
95
|
return {
|
|
96
96
|
payload: {
|
|
97
97
|
companyId,
|
|
98
98
|
enableChargeCard,
|
|
99
99
|
chargeCardSetupViewType,
|
|
100
100
|
isEarlyPayEnabled,
|
|
101
|
-
isCompanyInterestedInChargeCard,
|
|
102
101
|
},
|
|
103
102
|
};
|
|
104
103
|
},
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js
CHANGED
|
@@ -10,7 +10,7 @@ const userRoleReducer_1 = require("../../../../../entity/userRole/userRoleReduce
|
|
|
10
10
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
11
|
const chargeCardSetUpViewReducer_1 = require("../chargeCardSetUpViewReducer");
|
|
12
12
|
const acceptChargeCardTermsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardSetUpViewReducer_1.acceptChargeCardTerms.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { companyId, enableChargeCard, chargeCardSetupViewType, isEarlyPayEnabled,
|
|
13
|
+
const { companyId, enableChargeCard, chargeCardSetupViewType, isEarlyPayEnabled, } = action.payload;
|
|
14
14
|
let payload;
|
|
15
15
|
switch (chargeCardSetupViewType) {
|
|
16
16
|
case 'charge_cards':
|
|
@@ -20,11 +20,7 @@ const acceptChargeCardTermsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(
|
|
|
20
20
|
payload = Object.assign({ is_charge_cards_tos_accepted: true, is_debit_cards_tos_accepted: true }, (enableChargeCard && Object.assign({ is_charge_cards_enabled: true, is_debit_cards_enabled: true }, (isEarlyPayEnabled && { is_auto_pay_enabled: true }))));
|
|
21
21
|
break;
|
|
22
22
|
case 'debit_cards':
|
|
23
|
-
payload = Object.assign(
|
|
24
|
-
is_debit_cards_enabled: true,
|
|
25
|
-
})), (isCompanyInterestedInChargeCard && {
|
|
26
|
-
is_company_interested_in_charge_card: true,
|
|
27
|
-
}));
|
|
23
|
+
payload = Object.assign({ is_debit_cards_tos_accepted: true }, (enableChargeCard && { is_debit_cards_enabled: true }));
|
|
28
24
|
break;
|
|
29
25
|
default:
|
|
30
26
|
payload = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.13-
|
|
3
|
+
"version": "4.19.13-betaSS2",
|
|
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
|
"types": "lib/index.d.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"scripts": {
|
|
78
78
|
"clean": "rimraf lib",
|
|
79
79
|
"test:typecheck": "echo 'Typechecking test files...' && time tsc -p tsconfig.typecheck.json",
|
|
80
|
-
"test": "vitest run --typecheck",
|
|
80
|
+
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
81
81
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
82
82
|
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
83
83
|
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|