@zeniai/client-epic-state 4.12.56 → 4.12.58

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,15 +45,19 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
45
45
  mailingAddress }));
46
46
  }
47
47
  });
48
- chargeCardsWithUser.filter((cardWithUser) => {
49
- var _a, _b, _c, _d, _e;
50
- const derivedCardHolderName = `${(_a = cardWithUser.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName} ${(_b = cardWithUser.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName}`;
51
- return (cardWithUser.cardName.toLowerCase().includes(searchText) === true ||
52
- ((_c = cardWithUser.cardHolderUser) === null || _c === void 0 ? void 0 : _c.firstName.toLowerCase().includes(searchText)) === true ||
53
- derivedCardHolderName.toLowerCase().includes(searchText) === true ||
54
- ((_d = cardWithUser.cardHolderUser) === null || _d === void 0 ? void 0 : _d.lastName.toLowerCase().includes(searchText)) === true ||
55
- ((_e = cardWithUser.department) === null || _e === void 0 ? void 0 : _e.className.toLowerCase().includes(searchText)) ===
56
- true);
48
+ const chargeCardsWithUserFiltered = chargeCardsWithUser.filter((cardWithUser) => {
49
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
50
+ const loweredSearchText = searchText.toLowerCase();
51
+ const cardName = (_a = cardWithUser.cardName.toLowerCase()) !== null && _a !== void 0 ? _a : '';
52
+ const firstName = (_c = (_b = cardWithUser.cardHolderUser) === null || _b === void 0 ? void 0 : _b.firstName.toLowerCase()) !== null && _c !== void 0 ? _c : '';
53
+ const lastName = (_e = (_d = cardWithUser.cardHolderUser) === null || _d === void 0 ? void 0 : _d.lastName.toLowerCase()) !== null && _e !== void 0 ? _e : '';
54
+ const derivedCardHolderName = (_h = `${(_f = cardWithUser.cardHolderUser) === null || _f === void 0 ? void 0 : _f.firstName} ${(_g = cardWithUser.cardHolderUser) === null || _g === void 0 ? void 0 : _g.lastName}`.toLowerCase()) !== null && _h !== void 0 ? _h : '';
55
+ const department = (_k = (_j = cardWithUser.department) === null || _j === void 0 ? void 0 : _j.className.toLowerCase()) !== null && _k !== void 0 ? _k : '';
56
+ return (cardName.includes(loweredSearchText) ||
57
+ firstName.includes(loweredSearchText) ||
58
+ lastName.includes(loweredSearchText) ||
59
+ derivedCardHolderName.includes(loweredSearchText) ||
60
+ department.includes(loweredSearchText));
57
61
  });
58
62
  const sortKey = chargeCardListState.uiState.sortKey;
59
63
  const sortOrder = (0, sortOrderPayload_1.getSortOrder)(chargeCardListState.uiState.sortOrder);
@@ -84,7 +88,7 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
84
88
  };
85
89
  let inviteAcceptedCards = [];
86
90
  let inviteNotAcceptedCards = [];
87
- chargeCardsWithUser.forEach((card) => {
91
+ chargeCardsWithUserFiltered.forEach((card) => {
88
92
  if (card.status.code !== 'request_on_hold') {
89
93
  inviteAcceptedCards.push(card);
90
94
  }
@@ -137,7 +141,7 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
137
141
  exports.getChargeCardListView = getChargeCardListView;
138
142
  const anyCardOnHold = (cards) => {
139
143
  return cards.reduce((prevValue, currentValue) => {
140
- return prevValue === true && currentValue.status.code === 'request_on_hold';
144
+ return (prevValue === true && currentValue.status.code === 'request_on_hold');
141
145
  }, true);
142
146
  };
143
147
  exports.anyCardOnHold = anyCardOnHold;
@@ -9,4 +9,4 @@ import { sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardi
9
9
  import { sendOtpMyProfile, sendOtpMyProfileFailure, sendOtpMyProfileSuccess } from '../settingsView/settingsViewReducer';
10
10
  import { sendOtpCardUserOnboardingSuccess, sendOtpCardUserOnboarding, sendOtpCardUserOnboardingFailure } from '../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer';
11
11
  export declare type ActionType = ReturnType<typeof sendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof sendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof sendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof sendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure> | ReturnType<typeof sendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof sendOtpMyProfile> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
12
- export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
12
+ export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -10,15 +10,24 @@ const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewRe
10
10
  const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
11
11
  const settingsViewReducer_1 = require("../settingsView/settingsViewReducer");
12
12
  const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer");
13
- const sendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.sendOtp.match), (0, operators_1.mergeMap)((action) => {
13
+ const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.sendOtp.match), (0, operators_1.mergeMap)((action) => {
14
+ var _a, _b;
14
15
  const sendOtpActions = [];
15
16
  const { phoneNumber, twoFASource } = action.payload;
17
+ const tenantState = state$.value.tenantState;
18
+ const { currentTenantId } = tenantState;
19
+ const productSettings = currentTenantId != null
20
+ ? (_b = (_a = tenantState.tenantsById) === null || _a === void 0 ? void 0 : _a[currentTenantId]) === null || _b === void 0 ? void 0 : _b.productSettings
21
+ : undefined;
22
+ const isCardsEnabled = productSettings != null ? productSettings.isBookkeepingEnabled || productSettings.isCardsEnabled : false;
16
23
  const queryPayload = {
17
24
  channel_type: 'phone',
18
25
  channel_info: {
19
26
  phone_number: phoneNumber,
20
27
  },
21
- is_for_charge_cards: twoFASource === 'ChargeCard',
28
+ is_for_charge_cards: (twoFASource === 'ChargeCard'
29
+ || twoFASource === "CardUserOnboarding"
30
+ || (twoFASource === "MyProfile" && isCardsEnabled)),
22
31
  };
23
32
  switch (twoFASource) {
24
33
  case 'SpendManagementSetup':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.56",
3
+ "version": "4.12.58",
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",