@zeniai/client-epic-state 4.8.68 → 4.8.70

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.
@@ -19,5 +19,5 @@ export declare const isRecurringConfigChanged: (recurringBillNewConfig: Recurrin
19
19
  export declare const getTotalPayments: (startDate: ZeniDate, endDate: ZeniDate, frequency: RecurringBillFrequency, currentInstance?: RecurringBillInstance | undefined) => number;
20
20
  export declare const getEndDate: (startDate: ZeniDate, frequency: RecurringBillFrequency, totalPayments: number, currentInstance?: RecurringBillInstance | undefined) => ZeniDate;
21
21
  export declare const accountTypeSubConfigCodeToAccType: (code?: "depositAccount" | "paymentAccount" | undefined) => AccType | undefined;
22
- export declare function showReimbursementPromoPage(currentTenant: CurrentTenant): boolean;
22
+ export declare function showReimbursementPromoPage(currentTenant: CurrentTenant, userRoleMap: RoleMap): boolean;
23
23
  export declare function showBillPayPromoPage(currentTenant: CurrentTenant, userRoleMap: RoleMap): boolean;
@@ -228,27 +228,27 @@ const accountTypeSubConfigCodeToAccType = (code) => {
228
228
  }
229
229
  };
230
230
  exports.accountTypeSubConfigCodeToAccType = accountTypeSubConfigCodeToAccType;
231
- function showReimbursementPromoPage(currentTenant) {
231
+ function showReimbursementPromoPage(currentTenant, userRoleMap) {
232
232
  var _a, _b, _c;
233
233
  const isReimbursementTOSAccepted = Boolean((_a = currentTenant.company) === null || _a === void 0 ? void 0 : _a.companyReimbursementInfo.isReimbursementTOSAccepted);
234
- const isEmployeeLevelAccess = Boolean(currentTenant.userRole) === true
235
- ? (0, userRoleType_1.hasEmployeeLevelAccess)(currentTenant)
236
- : false;
234
+ const isUserHasRemiAccess = (0, userRoleType_1.hasReimbursementAccess)(userRoleMap);
235
+ const isUserHasAdminLevelRemiAccess = (0, userRoleType_1.hasReimbursementAdminLevelAccess)(userRoleMap);
236
+ const isNonAdminLevelAccess = isUserHasRemiAccess && !isUserHasAdminLevelRemiAccess;
237
237
  const isEmployeeReimbursementTOSAccepted = Boolean((_b = currentTenant.userReimbursementInfo) === null || _b === void 0 ? void 0 : _b.isReimbursementTOSAccepted);
238
238
  return ((Boolean((_c = currentTenant.company) === null || _c === void 0 ? void 0 : _c.companyReimbursementInfo) &&
239
239
  !isReimbursementTOSAccepted) ||
240
240
  (Boolean(currentTenant.userReimbursementInfo) &&
241
- isEmployeeLevelAccess &&
241
+ isNonAdminLevelAccess &&
242
242
  !isEmployeeReimbursementTOSAccepted));
243
243
  }
244
244
  exports.showReimbursementPromoPage = showReimbursementPromoPage;
245
245
  function showBillPayPromoPage(currentTenant, userRoleMap) {
246
246
  var _a, _b, _c;
247
- const isUserHasOnlyBillPayAccess = (0, userRoleType_1.hasOnlyBillPayAccess)(userRoleMap);
247
+ const isUserHasBillPayAccess = (0, userRoleType_1.hasBillPayAccess)(userRoleMap);
248
+ const isUserHasAdminLevelBillPayAccess = (0, userRoleType_1.hasBillPayAdminLevelAccess)(userRoleMap);
248
249
  const isBillPayTOSAccepted = Boolean((_b = (_a = currentTenant.companyBillPayInfo) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.isBillPayTOSAccepted);
249
250
  return (Boolean((_c = currentTenant.companyBillPayInfo) === null || _c === void 0 ? void 0 : _c.info) &&
250
251
  (isBillPayTOSAccepted === false ||
251
- (isUserHasOnlyBillPayAccess &&
252
- Boolean(userRoleMap.bill_pay_admin) === false)));
252
+ (isUserHasBillPayAccess && isUserHasAdminLevelBillPayAccess === false)));
253
253
  }
254
254
  exports.showBillPayPromoPage = showBillPayPromoPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.8.68",
3
+ "version": "4.8.70",
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",