@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.
- package/lib/view/referralView/epics/fetchRewardsPlanEpic.js +1 -7
- package/lib/view/referralView/epics/resendReferralInviteEpic.js +1 -7
- package/lib/view/referralView/epics/sendReferralInviteEpic.js +1 -7
- package/lib/view/referralView/referralPayload.d.ts +1 -0
- package/lib/view/referralView/referralReducer.js +4 -0
- package/lib/view/referralView/referralSelector.js +1 -0
- package/lib/view/referralView/referralState.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +7 -7
- package/package.json +1 -1
|
@@ -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))}
|
|
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 }
|
|
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
|
|
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)()];
|
|
@@ -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,
|
|
@@ -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,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
|
|
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
|
|
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
|
-
((
|
|
36
|
-
|
|
37
|
-
((
|
|
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.
|
|
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",
|