@zeniai/client-epic-state 5.1.9 → 5.1.10

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.
@@ -85,7 +85,7 @@ export declare const getCurrentTenantExternalConnections: (tenantState: TenantSt
85
85
  export declare const toTenantCoreDetailsView: (tenantsBaseView: TenantBaseView[]) => TenantCoreDetailsView[];
86
86
  export declare const isTenantBankingOnly: (isDebitCardFlagEnabled: boolean, tenant: Tenant | undefined) => boolean;
87
87
  export declare const isTenantCardsOnly: (tenant: Tenant | undefined) => boolean;
88
- export declare const isTenantCfoEnabled: (tenant: Tenant | undefined) => boolean;
88
+ export declare const isTenantAccountingServicesEnabled: (tenant: Tenant | undefined) => boolean;
89
89
  export declare const getIsAccountingClassesEnabled: (state: RootState) => boolean;
90
90
  export declare const getIsAccountingProjectsEnabled: (state: RootState) => boolean;
91
91
  export declare const isTenantBookkeepingEnabled: (tenant: Tenant | undefined) => boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isTenantTreasuryEnabled = exports.isOtherProductsEnabledForTenant = exports.isTenantBookkeepingEnabled = exports.getIsAccountingProjectsEnabled = exports.getIsAccountingClassesEnabled = exports.isTenantCfoEnabled = exports.isTenantCardsOnly = exports.isTenantBankingOnly = exports.toTenantCoreDetailsView = exports.getCurrentTenantExternalConnections = exports.isTenantUsingZeniCOA = exports.isZeniDomainTenant = exports.getTenantBaseViewForTenantView = exports.getTenantsCoreDetailsByCheckInDateSelector = exports.getTenantsBaseByCheckInDateSelector = exports.getTenantBaseById = exports.getTenantsByCheckInDateSelector = exports.getCurrentTenant = exports.getTenantBaseViewForTenantId = void 0;
6
+ exports.isTenantTreasuryEnabled = exports.isOtherProductsEnabledForTenant = exports.isTenantBookkeepingEnabled = exports.getIsAccountingProjectsEnabled = exports.getIsAccountingClassesEnabled = exports.isTenantAccountingServicesEnabled = exports.isTenantCardsOnly = exports.isTenantBankingOnly = exports.toTenantCoreDetailsView = exports.getCurrentTenantExternalConnections = exports.isTenantUsingZeniCOA = exports.isZeniDomainTenant = exports.getTenantBaseViewForTenantView = exports.getTenantsCoreDetailsByCheckInDateSelector = exports.getTenantsBaseByCheckInDateSelector = exports.getTenantBaseById = exports.getTenantsByCheckInDateSelector = exports.getCurrentTenant = exports.getTenantBaseViewForTenantId = void 0;
7
7
  exports.getTenant = getTenant;
8
8
  exports.getOnboardingTenantByTenantId = getOnboardingTenantByTenantId;
9
9
  const toolkit_1 = require("@reduxjs/toolkit");
@@ -280,10 +280,15 @@ const isTenantCardsOnly = (tenant) => {
280
280
  : false;
281
281
  };
282
282
  exports.isTenantCardsOnly = isTenantCardsOnly;
283
- const isTenantCfoEnabled = (tenant) => {
284
- return tenant?.productSettings?.isCfoEnabled === true;
283
+ const isTenantAccountingServicesEnabled = (tenant) => {
284
+ return tenant != null && tenant.productSettings != null
285
+ ? tenant.productSettings.isCfoEnabled === true ||
286
+ tenant.productSettings.isTaxEnabled === true ||
287
+ tenant.productSettings.isPayrollEnabled === true ||
288
+ tenant.productSettings.isBookkeepingEnabled === true
289
+ : false;
285
290
  };
286
- exports.isTenantCfoEnabled = isTenantCfoEnabled;
291
+ exports.isTenantAccountingServicesEnabled = isTenantAccountingServicesEnabled;
287
292
  const getIsAccountingClassesEnabled = (state) => {
288
293
  const { currentTenantId, tenantsById } = state.tenantState;
289
294
  if (currentTenantId == null) {
@@ -265,8 +265,13 @@ export const isTenantCardsOnly = (tenant) => {
265
265
  tenant.productSettings.isSpendManagementEnabled === false
266
266
  : false;
267
267
  };
268
- export const isTenantCfoEnabled = (tenant) => {
269
- return tenant?.productSettings?.isCfoEnabled === true;
268
+ export const isTenantAccountingServicesEnabled = (tenant) => {
269
+ return tenant != null && tenant.productSettings != null
270
+ ? tenant.productSettings.isCfoEnabled === true ||
271
+ tenant.productSettings.isTaxEnabled === true ||
272
+ tenant.productSettings.isPayrollEnabled === true ||
273
+ tenant.productSettings.isBookkeepingEnabled === true
274
+ : false;
270
275
  };
271
276
  export const getIsAccountingClassesEnabled = (state) => {
272
277
  const { currentTenantId, tenantsById } = state.tenantState;
@@ -1,4 +1,4 @@
1
- import { isTenantBankingOnly, isTenantCardsOnly, isTenantCfoEnabled, } from '../../entity/tenant/tenantSelector';
1
+ import { isTenantAccountingServicesEnabled, isTenantBankingOnly, isTenantCardsOnly, } from '../../entity/tenant/tenantSelector';
2
2
  import { hasAnyAdminLevelAccess, hasBillPayAccessible, hasBookKeepingAdminLevelAccess, hasBookKeepingUserLevelAccess, hasChargeCardAccessible, hasFullOrAdminLevelAccess, hasInvestorBankerLevelAccess, hasReimbursementAccess, hasReimbursementAccessible, hasSuperAdminLevelAccess, hasZeniAccountsAccessible, isZeniSignedInUser, } from '../../entity/userRole/userRoleType';
3
3
  import { isVendorsTabVisible } from '../vendorList/vendorListSelector';
4
4
  export const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant, userRoleMap) => {
@@ -10,8 +10,9 @@ export const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, current
10
10
  hasBillPayAccessible(currentTenant, userRoleMap) ||
11
11
  hasReimbursementAccessible(currentTenant, userRoleMap) ||
12
12
  hasFullOrAdminLevelAccess(userRole)) &&
13
- isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) === false &&
14
- isTenantCardsOnly(currentTenant) === false);
13
+ (isTenantAccountingServicesEnabled(currentTenant) ||
14
+ (isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) === false &&
15
+ isTenantCardsOnly(currentTenant) === false)));
15
16
  }
16
17
  else {
17
18
  return false;
@@ -29,8 +30,9 @@ export const isApprovalRulesTabVisible = (userRole, isDebitCardFlagEnabled, curr
29
30
  hasReimbursementAccessible(currentTenant, userRoleMap) ||
30
31
  ((isBillPayTOSAccepted || isReimbursementTOSAccepted) &&
31
32
  hasFullOrAdminLevelAccess(userRole))) &&
32
- isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) === false &&
33
- isTenantCardsOnly(currentTenant) === false);
33
+ (isTenantAccountingServicesEnabled(currentTenant) ||
34
+ (isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) === false &&
35
+ isTenantCardsOnly(currentTenant) === false)));
34
36
  }
35
37
  else {
36
38
  return false;
@@ -94,7 +96,7 @@ export const isIntegrationsTabVisible = (userRole, isDebitCardFlagEnabled, curre
94
96
  }
95
97
  if (isSettingsVisible(currentTenant)) {
96
98
  return (hasFullOrAdminLevelAccess(userRole) &&
97
- (isTenantCfoEnabled(currentTenant) ||
99
+ (isTenantAccountingServicesEnabled(currentTenant) ||
98
100
  !(isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) ||
99
101
  isTenantCardsOnly(currentTenant))));
100
102
  }
@@ -147,6 +149,7 @@ export const isNotificationsTabVisible = (notificationSettings, signedInUseEmail
147
149
  const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
148
150
  return ((isRemindersSectionVisibleOnSettingsPage(reminderNotificationSettings) ||
149
151
  isMonthEndNotificationsSectionVisibleOnSettingsPage(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
150
- isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) === false &&
151
- isTenantCardsOnly(currentTenant) === false);
152
+ (isTenantAccountingServicesEnabled(currentTenant) ||
153
+ (isTenantBankingOnly(isDebitCardFlagEnabled, currentTenant) === false &&
154
+ isTenantCardsOnly(currentTenant) === false)));
152
155
  };
@@ -13,8 +13,9 @@ const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant,
13
13
  (0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
14
14
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
15
15
  (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole)) &&
16
- (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
17
- (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
16
+ ((0, tenantSelector_1.isTenantAccountingServicesEnabled)(currentTenant) ||
17
+ ((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
18
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false)));
18
19
  }
19
20
  else {
20
21
  return false;
@@ -33,8 +34,9 @@ const isApprovalRulesTabVisible = (userRole, isDebitCardFlagEnabled, currentTena
33
34
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
34
35
  ((isBillPayTOSAccepted || isReimbursementTOSAccepted) &&
35
36
  (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole))) &&
36
- (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
37
- (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
37
+ ((0, tenantSelector_1.isTenantAccountingServicesEnabled)(currentTenant) ||
38
+ ((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
39
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false)));
38
40
  }
39
41
  else {
40
42
  return false;
@@ -103,7 +105,7 @@ const isIntegrationsTabVisible = (userRole, isDebitCardFlagEnabled, currentTenan
103
105
  }
104
106
  if ((0, exports.isSettingsVisible)(currentTenant)) {
105
107
  return ((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) &&
106
- ((0, tenantSelector_1.isTenantCfoEnabled)(currentTenant) ||
108
+ ((0, tenantSelector_1.isTenantAccountingServicesEnabled)(currentTenant) ||
107
109
  !((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) ||
108
110
  (0, tenantSelector_1.isTenantCardsOnly)(currentTenant))));
109
111
  }
@@ -162,7 +164,8 @@ const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, isDeb
162
164
  const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
163
165
  return (((0, exports.isRemindersSectionVisibleOnSettingsPage)(reminderNotificationSettings) ||
164
166
  (0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
165
- (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
166
- (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
167
+ ((0, tenantSelector_1.isTenantAccountingServicesEnabled)(currentTenant) ||
168
+ ((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
169
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false)));
167
170
  };
168
171
  exports.isNotificationsTabVisible = isNotificationsTabVisible;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.9",
3
+ "version": "5.1.10",
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",