@zeniai/client-epic-state 4.12.4 → 4.12.5

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.
@@ -34,27 +34,34 @@ function getApprovalRuleViewDetails(state) {
34
34
  }
35
35
  exports.getApprovalRuleViewDetails = getApprovalRuleViewDetails;
36
36
  function getBankConnectionsSetupViewDetails(state, companyId, isBillPayEnabled, isRemiEnabled, isAccountEnabled, isCardEnabled) {
37
- var _a, _b, _c, _d, _e, _f;
37
+ var _a, _b, _c, _d, _e, _f, _g, _h;
38
38
  const { accountState, settingsViewState, paymentAccountState, depositAccountState, depositAccountListState, paymentAccountListState, } = state;
39
39
  const { bankConnection } = settingsViewState;
40
40
  const { paymentAccountIds } = paymentAccountListState;
41
41
  const { accountIds: depositAccountIds } = depositAccountListState;
42
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
43
+ const isAccountsEnabled = Boolean((_b = (_a = currentTenant.companyZeniAccountInfo) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.isZeniAccountEnabled);
42
44
  const allBankAccounts = bankConnection.fetchState === 'Completed'
43
45
  ? bankConnection.bankAccountIds
44
46
  .map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, 'bill_pay'))
45
47
  .filter((account) => account != null)
46
48
  : [];
47
49
  const paymentAccounts = paymentAccountListState.hasValidState()
48
- ? (_a = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _a !== void 0 ? _a : []
50
+ ? (_c = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _c !== void 0 ? _c : []
49
51
  : [];
50
52
  const depositAccounts = depositAccountListState.hasValidState()
51
- ? (_b = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _b !== void 0 ? _b : []
53
+ ? (_d = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _d !== void 0 ? _d : []
52
54
  : [];
53
- const fetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
54
- settingsViewState.bankConnection,
55
- paymentAccountListState,
56
- depositAccountListState,
57
- ]);
55
+ const fetchState = isAccountsEnabled
56
+ ? (0, reduceFetchState_1.reduceAnyFetchState)([
57
+ settingsViewState.bankConnection,
58
+ paymentAccountListState,
59
+ depositAccountListState,
60
+ ])
61
+ : (0, reduceFetchState_1.reduceAnyFetchState)([
62
+ settingsViewState.bankConnection,
63
+ paymentAccountListState,
64
+ ]);
58
65
  const allFundingAccounts = fetchState.fetchState === 'Completed'
59
66
  ? (0, setupViewSelector_1.getAllFundingAccounts)(depositAccounts, paymentAccounts, false)
60
67
  : [];
@@ -72,10 +79,10 @@ function getBankConnectionsSetupViewDetails(state, companyId, isBillPayEnabled,
72
79
  primaryAccountsProductWise.push(Object.assign({ productType: 'reimbursement' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement', 'reimbursement_setup')));
73
80
  }
74
81
  const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
75
- const billPayPrimaryAccount = (_c = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.primaryFundingAccount) === null || _c === void 0 ? void 0 : _c.accountId; //companyBillPayInfo
76
- const remiPrimaryAccount = (_d = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyReimbursementInfo.primaryFundingAccount) === null || _d === void 0 ? void 0 : _d.accountId;
77
- const accountsPrimaryAccount = (_e = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyZeniAccountInfo.primaryFundingAccount) === null || _e === void 0 ? void 0 : _e.accountId; //companyZeniAccountInfo
78
- const chargeCardsPrimaryAccount = (_f = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyChargeCardInfo.primaryFundingAccount) === null || _f === void 0 ? void 0 : _f.accountId; //companyChargeCardInfo
82
+ const billPayPrimaryAccount = (_e = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.primaryFundingAccount) === null || _e === void 0 ? void 0 : _e.accountId; //companyBillPayInfo
83
+ const remiPrimaryAccount = (_f = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyReimbursementInfo.primaryFundingAccount) === null || _f === void 0 ? void 0 : _f.accountId;
84
+ const accountsPrimaryAccount = (_g = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyZeniAccountInfo.primaryFundingAccount) === null || _g === void 0 ? void 0 : _g.accountId; //companyZeniAccountInfo
85
+ const chargeCardsPrimaryAccount = (_h = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyChargeCardInfo.primaryFundingAccount) === null || _h === void 0 ? void 0 : _h.accountId; //companyChargeCardInfo
79
86
  const primaryAccounts = [];
80
87
  if (billPayPrimaryAccount != null) {
81
88
  primaryAccounts.push(billPayPrimaryAccount);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.4",
3
+ "version": "4.12.5",
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",