@zeniai/client-epic-state 4.15.81 → 4.15.83

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.
@@ -45,16 +45,17 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
45
45
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
46
46
  return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
47
47
  }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, monthEndCloseChecksView, tenantState, additionalExcludedReports) => {
48
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
49
49
  const isReimbursementFeatureEnabled = (_a = tenants.currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
50
- const isAdmin = Boolean((_b = tenants.currentTenant) === null || _b === void 0 ? void 0 : _b.userRole) === true
50
+ const isBillPayFeatureEnabled = (_b = tenants.currentTenant.company) === null || _b === void 0 ? void 0 : _b.featuresActivationInfo.isBillPayFeatureEnabled;
51
+ const isAdmin = Boolean((_c = tenants.currentTenant) === null || _c === void 0 ? void 0 : _c.userRole) === true
51
52
  ? (0, userRoleType_1.hasAdminLevelAccess)(tenants.currentTenant.userRole)
52
53
  : false;
53
- const isInvestorBanker = Boolean((_c = tenants.currentTenant) === null || _c === void 0 ? void 0 : _c.userRole) === true
54
+ const isInvestorBanker = Boolean((_d = tenants.currentTenant) === null || _d === void 0 ? void 0 : _d.userRole) === true
54
55
  ? (0, userRoleType_1.hasInvestorBankerLevelAccess)(tenants.currentTenant.userRole)
55
56
  : false;
56
- const hasTopExAccess = ((_f = (_e = (_d = tenants.currentTenant) === null || _d === void 0 ? void 0 : _d.excludedResources) === null || _e === void 0 ? void 0 : _e.resources) === null || _f === void 0 ? void 0 : _f.find((resource) => resource.resource === '/reports/top_expenses')) == null;
57
- const hasTasksCardAccess = ((_j = (_h = (_g = tenants.currentTenant) === null || _g === void 0 ? void 0 : _g.excludedResources) === null || _h === void 0 ? void 0 : _h.resources) === null || _j === void 0 ? void 0 : _j.find((resource) => resource.resource === '/reports/task_card')) == null;
57
+ const hasTopExAccess = ((_g = (_f = (_e = tenants.currentTenant) === null || _e === void 0 ? void 0 : _e.excludedResources) === null || _f === void 0 ? void 0 : _f.resources) === null || _g === void 0 ? void 0 : _g.find((resource) => resource.resource === '/reports/top_expenses')) == null;
58
+ const hasTasksCardAccess = ((_k = (_j = (_h = tenants.currentTenant) === null || _h === void 0 ? void 0 : _h.excludedResources) === null || _j === void 0 ? void 0 : _j.resources) === null || _k === void 0 ? void 0 : _k.find((resource) => resource.resource === '/reports/task_card')) == null;
58
59
  const reportsInOrder = [
59
60
  cashBalance,
60
61
  cardBalance,
@@ -82,7 +83,7 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
82
83
  if (hasTasksCardAccess) {
83
84
  reportsInOrder.push(tasksCard);
84
85
  }
85
- if (!isInvestorBanker) {
86
+ if (!isInvestorBanker && isBillPayFeatureEnabled === true) {
86
87
  reportsInOrder.push(billPayCard);
87
88
  }
88
89
  if (isReimbursementFeatureEnabled === true && isAdmin) {
@@ -22,6 +22,7 @@ import { ClassListSelectorView } from '../../../classList/classListSelector';
22
22
  import { VendorDetailLocalData } from '../../../commonVendorView/vendorView/vendorViewState';
23
23
  import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
24
24
  import { FundingAccount } from '../../commonSetup/setupViewSelector';
25
+ import { PlaidConnectionDetails } from '../../plaidAccount/plaidAccountViewState';
25
26
  import { BillActivity } from '../billDetailView/billDetailViewSelector';
26
27
  import { AccountTypeSubConfigCodeKeyType, BillPayConfig, BillPayConfigState } from '../billPayConfig/billPayConfigState';
27
28
  import { DuplicateBillsSelectorView } from '../billPayReview/billPayReviewSelector';
@@ -112,6 +113,7 @@ export interface EditBillDetailSelectorView extends SelectorView {
112
113
  isBillMarkedForRetry?: boolean;
113
114
  internationalWireOnboardingStatus?: AllowedValueWithCode;
114
115
  isEligibleForRetryOBP?: boolean;
116
+ plaidConnectionDetails: PlaidConnectionDetails;
115
117
  }
116
118
  export interface EditBillInitialDetails {
117
119
  vendor?: Vendor;
@@ -25,6 +25,7 @@ const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompan
25
25
  const commonHistorySelector_1 = require("../../commonHistoryView/commonHistorySelector");
26
26
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
27
27
  const helpers_1 = require("../../helpers");
28
+ const plaidAccountViewSelector_1 = require("../../plaidAccount/plaidAccountViewSelector");
28
29
  const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
29
30
  const billDetailViewSelector_1 = require("../billDetailView/billDetailViewSelector");
30
31
  const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
@@ -36,7 +37,7 @@ const billPaySetupApproverViewSelector_1 = require("../billPaySetupApproverView/
36
37
  const previousBillsSelector_1 = require("../previousBills/previousBillsSelector");
37
38
  const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
38
39
  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, _1, _2, _3, _4, _5;
39
- const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, billPaySetupApproverViewState, } = state;
40
+ const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, billPaySetupApproverViewState, plaidAccountViewState, } = state;
40
41
  const transaction = (0, get_1.default)(billTransactionState.transactionById, billId !== null && billId !== void 0 ? billId : '', undefined);
41
42
  let recommendations = {};
42
43
  if (billId != null) {
@@ -324,6 +325,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
324
325
  const internationalWireOnboardingStatus = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.internationalWireOnboardingStatus;
325
326
  const billTransactionDetails = (0, get_1.default)(billDetailViewState.billDetailById, key, undefined);
326
327
  const isEligibleForRetryOBP = billTransactionDetails === null || billTransactionDetails === void 0 ? void 0 : billTransactionDetails.zeniAssist.isEligibleForRetryOBP;
328
+ const { plaidConnectionDetails } = (0, plaidAccountViewSelector_1.getPlaidAccountDetails)(plaidAccountViewState, 'bill_pay_detail');
327
329
  return {
328
330
  showVendorGptRecommendationText,
329
331
  recommendedVendor,
@@ -375,6 +377,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
375
377
  isBillMarkedForRetry,
376
378
  internationalWireOnboardingStatus,
377
379
  isEligibleForRetryOBP,
380
+ plaidConnectionDetails,
378
381
  };
379
382
  };
380
383
  exports.getEditBillDetail = getEditBillDetail;
@@ -8,6 +8,7 @@ const plaidAccountViewState_1 = require("./plaidAccountViewState");
8
8
  exports.initialState = {
9
9
  spend_management_setup: plaidAccountViewState_1.initialPlaidAccountState,
10
10
  bill_pay_setup: plaidAccountViewState_1.initialPlaidAccountState,
11
+ bill_pay_detail: plaidAccountViewState_1.initialPlaidAccountState,
11
12
  reimbursement_setup: plaidAccountViewState_1.initialPlaidAccountState,
12
13
  account_setup: plaidAccountViewState_1.initialPlaidAccountState,
13
14
  charge_card_setup: plaidAccountViewState_1.initialPlaidAccountState,
@@ -1,7 +1,7 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniDate } from '../../../zeniDayJS';
3
3
  export type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
4
- export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
4
+ export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'bill_pay_detail' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
5
5
  export type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
6
6
  linkToken?: string;
7
7
  expiration?: ZeniDate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.15.81",
3
+ "version": "4.15.83",
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",