@zeniai/client-epic-state 4.9.15 → 4.9.17

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.
@@ -10,17 +10,11 @@ const fetchRewardsPlanEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
10
10
  const state = state$.value;
11
11
  const fetchState = state.referralViewState.rewardsPlanFetchState.fetchState;
12
12
  if (cacheOverride === true || fetchState === 'Not-Started') {
13
- const { userId, sessionId } = zeniAPI;
14
- const headers = {
15
- 'zeni-user-id': userId,
16
- 'zeni-tenant-id': '',
17
- 'zeni-session-id': sessionId,
18
- };
19
13
  const payload = {
20
14
  is_primary_refer_reward_plan: true,
21
15
  };
22
16
  return zeniAPI
23
- .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-refer-reward-plan?query=${encodeURIComponent(JSON.stringify(payload))}`, headers)
17
+ .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-refer-reward-plan?query=${encodeURIComponent(JSON.stringify(payload))}`)
24
18
  .pipe((0, operators_1.mergeMap)((response) => {
25
19
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
26
20
  const actions = [
@@ -7,14 +7,8 @@ const responsePayload_1 = require("../../../responsePayload");
7
7
  const referralReducer_1 = require("../referralReducer");
8
8
  const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
9
9
  const resendReferralInviteEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(referralReducer_1.resendReferralInvite.match), (0, operators_1.switchMap)((action) => {
10
- const { userId, sessionId } = zeniAPI;
11
- const headers = {
12
- 'zeni-user-id': userId,
13
- 'zeni-tenant-id': '',
14
- 'zeni-session-id': sessionId,
15
- };
16
10
  return zeniAPI
17
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, { reinvite_to: action.payload.emailId }, headers)
11
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, { reinvite_to: action.payload.emailId })
18
12
  .pipe((0, operators_1.mergeMap)((response) => {
19
13
  if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
20
14
  const actions = [
@@ -10,14 +10,8 @@ const sendReferralInviteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
10
10
  const referralFormLocalData = referralViewState.referralFormLocalData;
11
11
  const referRewardsPlanId = referralViewState.rewardsPlan.referRewardPlanId;
12
12
  const invitePayload = Object.assign({}, toInvitePayloadFromLocalData(referralFormLocalData, referRewardsPlanId));
13
- const { userId, sessionId } = zeniAPI;
14
- const headers = {
15
- 'zeni-user-id': userId,
16
- 'zeni-tenant-id': '',
17
- 'zeni-session-id': sessionId,
18
- };
19
13
  return zeniAPI
20
- .postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, invitePayload, headers)
14
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, invitePayload)
21
15
  .pipe((0, operators_1.mergeMap)((response) => {
22
16
  if ((0, responsePayload_1.isSuccessStatus)(response)) {
23
17
  const actions = [(0, referralReducer_1.sendReferralInviteSuccess)()];
@@ -17,6 +17,7 @@ export interface FetchRewardsPayload {
17
17
  referees: InviteePayload[];
18
18
  }
19
19
  export interface FetchRewardsPlanPayload {
20
+ company_legal_name: string | null;
20
21
  create_time: string | null;
21
22
  is_deleted: boolean | null;
22
23
  is_primary: boolean | null;
@@ -51,6 +51,7 @@ exports.initialState = {
51
51
  },
52
52
  referRewardPlanId: 'dummy',
53
53
  referalUniqueLink: (0, zeniUrl_1.toZeniUrl)(''),
54
+ companyLegalName: '',
54
55
  },
55
56
  showConfirmationPopup: false,
56
57
  };
@@ -150,11 +151,14 @@ const referral = (0, toolkit_1.createSlice)({
150
151
  },
151
152
  },
152
153
  updateRewardsPlan(draft, action) {
154
+ var _a;
153
155
  draft.rewardsPlanFetchState.fetchState = 'Completed';
154
156
  draft.rewardsPlanFetchState.error = undefined;
155
157
  draft.rewardsPlan.amount = (0, amount_1.toAmount)(action.payload.referral_plan_amount.amount, action.payload.referral_plan_amount.currency_code, action.payload.referral_plan_amount.currency_symbol);
156
158
  draft.rewardsPlan.referRewardPlanId = action.payload.refer_reward_plan_id;
157
159
  draft.rewardsPlan.referalUniqueLink = (0, zeniUrl_1.toZeniUrl)(action.payload.static_referal_link);
160
+ draft.rewardsPlan.companyLegalName =
161
+ (_a = action.payload.company_legal_name) !== null && _a !== void 0 ? _a : '';
158
162
  },
159
163
  updateRewardsPlanFailure(draft, action) {
160
164
  draft.rewardsPlanFetchState.fetchState = 'Error';
@@ -81,6 +81,7 @@ const getInviteFormView = (state) => {
81
81
  saveStatus: referralViewState.sendInviteState,
82
82
  amount: referralViewState.rewardsPlan.amount,
83
83
  referalUniqueLink: referralViewState.rewardsPlan.referalUniqueLink,
84
+ companyLegalName: referralViewState.rewardsPlan.companyLegalName,
84
85
  fetchState: referralViewState.rewardsPlanFetchState.fetchState,
85
86
  error: referralViewState.rewardsPlanFetchState.error,
86
87
  showConfirmationPopup: referralViewState.showConfirmationPopup,
@@ -38,6 +38,7 @@ export interface RewardsPlanData {
38
38
  amount: Amount;
39
39
  referRewardPlanId: ID;
40
40
  referalUniqueLink: ZeniUrl;
41
+ companyLegalName: string;
41
42
  }
42
43
  export interface InviteCompanyLocalData {
43
44
  companyName: string;
@@ -15,7 +15,6 @@ export interface RePaymentInfoPayload {
15
15
  current_statement_period_end_date: string;
16
16
  current_statement_period_start_date: string;
17
17
  next_repayment_due_date: string;
18
- card_limit_reset_date: string;
19
18
  }
20
19
  export declare type ChargeCardConfigResponse = ZeniAPIResponse<ChargeCardConfigPayload>;
21
20
  export declare const toCreditTerm: (payload: CreditTermsPayload) => CreditTerm;
@@ -14,6 +14,5 @@ const toRePaymentInfo = (payload) => ({
14
14
  endDate: (0, zeniDayJS_1.date)(payload.current_statement_period_end_date),
15
15
  },
16
16
  rePaymentDueDate: (0, zeniDayJS_1.date)(payload.next_repayment_due_date),
17
- cardLimitResetDate: (0, zeniDayJS_1.date)(payload.card_limit_reset_date),
18
17
  });
19
18
  exports.toRePaymentInfo = toRePaymentInfo;
@@ -15,7 +15,6 @@ export interface CreditTerm {
15
15
  export interface RePaymentInfo {
16
16
  statementPeriod: TimeframeTick;
17
17
  rePaymentDueDate: ZeniDate;
18
- cardLimitResetDate: ZeniDate;
19
18
  }
20
19
  export interface ConfigPeriod {
21
20
  value: number;
@@ -15,7 +15,9 @@ const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector
15
15
  const userListViewSelector_1 = require("../../../userListView/userListViewSelector");
16
16
  const getChargeCardListView = (state, includeCreditAccount) => {
17
17
  const { addressState, chargeCardListState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, classListState, } = state;
18
- const searchText = chargeCardListState.searchText.toLowerCase();
18
+ const searchText = chargeCardListState.searchText
19
+ .trim()
20
+ .toLowerCase();
19
21
  const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds)
20
22
  .map((chargeCard) => {
21
23
  const cardHolderUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardHolderUserId);
@@ -29,13 +31,11 @@ const getChargeCardListView = (state, includeCreditAccount) => {
29
31
  return Object.assign(Object.assign({}, chargeCard), { cardHolderUser, cardHolderRoles: (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, chargeCard.cardHolderUserId), department, address: (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.addressId) });
30
32
  })
31
33
  .filter((cardWithUser) => {
32
- var _a, _b, _c, _d, _e;
33
- const derivedCardHolderName = `${(_a = cardWithUser.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName} ${(_b = cardWithUser.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName}`;
34
+ var _a, _b, _c;
34
35
  return (cardWithUser.cardName.toLowerCase().includes(searchText) === true ||
35
- ((_c = cardWithUser.cardHolderUser) === null || _c === void 0 ? void 0 : _c.firstName.toLowerCase().includes(searchText)) === true ||
36
- derivedCardHolderName.includes(searchText) === true ||
37
- ((_d = cardWithUser.cardHolderUser) === null || _d === void 0 ? void 0 : _d.lastName.toLowerCase().includes(searchText)) === true ||
38
- ((_e = cardWithUser.department) === null || _e === void 0 ? void 0 : _e.className.toLowerCase().includes(searchText)) === true);
36
+ ((_a = cardWithUser.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName.toLowerCase().includes(searchText)) === true ||
37
+ ((_b = cardWithUser.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName.toLowerCase().includes(searchText)) === true ||
38
+ ((_c = cardWithUser.department) === null || _c === void 0 ? void 0 : _c.className.toLowerCase().includes(searchText)) === true);
39
39
  });
40
40
  const sortKey = chargeCardListState.uiState.sortKey;
41
41
  const sortOrder = (0, sortOrderPayload_1.getSortOrder)(chargeCardListState.uiState.sortOrder);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.9.15",
3
+ "version": "4.9.17",
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",