@zeniai/client-epic-state 4.9.53 → 4.9.55
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/index.d.ts +2 -2
- package/lib/index.js +1 -2
- package/lib/view/referralView/epics/fetchReferralsEpic.js +1 -1
- package/lib/view/referralView/epics/resendReferralInviteEpic.js +1 -1
- package/lib/view/referralView/epics/sendReferralInviteEpic.js +1 -1
- package/lib/view/referralView/referralPayload.d.ts +4 -5
- package/lib/view/referralView/referralReducer.d.ts +1 -1
- package/lib/view/referralView/referralReducer.js +8 -16
- package/lib/view/referralView/referralSelector.d.ts +1 -4
- package/lib/view/referralView/referralSelector.js +2 -5
- package/lib/view/referralView/referralState.d.ts +4 -6
- package/lib/view/referralView/referralState.js +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +3 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -650,5 +650,5 @@ import { fetchZeniAccountsPromoCard } from './view/zeniAccountsPromoCard/zeniAcc
|
|
|
650
650
|
export { ZeniAccountsPromoCardState, getZeniAccountsPromoCard, ZeniAccountsPromoCardReport, fetchZeniAccountsPromoCard, };
|
|
651
651
|
import { getReferralListView, ReferralListSelectorView, getInviteFormView } from './view/referralView/referralSelector';
|
|
652
652
|
import { ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, StatusTypes, AmountStatusTypes, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus } from './view/referralView/referralState';
|
|
653
|
-
import { fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, resendReferralInvite, updateReferralListSortUiState, fetchRewardsPlan
|
|
654
|
-
export { getReferralListView, getInviteFormView, ReferralListSelectorView, ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus, StatusTypes, AmountStatusTypes, fetchReferrals, sendReferralInvite,
|
|
653
|
+
import { fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, resendReferralInvite, updateReferralListSortUiState, fetchRewardsPlan } from './view/referralView/referralReducer';
|
|
654
|
+
export { getReferralListView, getInviteFormView, ReferralListSelectorView, ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus, StatusTypes, AmountStatusTypes, fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, updateReferralListSortUiState, resendReferralInvite, fetchRewardsPlan, };
|
package/lib/index.js
CHANGED
|
@@ -46,7 +46,7 @@ exports.initializeAccountMappingView = exports.getAccountMappingView = exports.c
|
|
|
46
46
|
exports.acceptChargeCardTerms = exports.fetchChargeCardSetupView = exports.getChargeCardSetupViewDetails = exports.toCreditLimitFrequencyCodeType = exports.toChargeCardSortKeyType = exports.fetchChargeCardTransactionList = exports.getChargeCardDetailView = exports.fetchChargeCardDetailPage = exports.getChargeCardListView = exports.fetchChargeCardListPage = exports.getChargeCardBusinessVerificationDetails = exports.companyHealthMetricDropDownOptions = exports.hasCompanyHealthMetricFormFieldChanged = exports.getCompanyHealthMetricView = exports.isCompanyRunwayInfinite = exports.updateCompanyHealthViewUIState = exports.updateCompanyHealthMetricViewSuccessStatus = exports.updateCompanyHealthMetricViewErrorStatus = exports.updateCompanyHealthMetricLocalStore = exports.saveCompanyHealthMetricById = exports.removeSelectedCompanyId = exports.initializeCompanyHealthMetricViewLocalData = exports.fetchCompanyHealthMetricView = exports.clearCompanyHealthMetricView = exports.updateCompanyHealth = exports.updateCompaniesHealth = exports.getUserRoleConfig = exports.fetchUserRoleConfig = exports.clearInternationalWire = exports.deletePaymentInstrument = exports.createPaymentInstrumentUpdateStatus = exports.createPaymentInstrument = exports.fetchInternationalWireDynamicForm = exports.initializeDynamicForm = exports.updateInternationalWireLocalStoreData = exports.initializeInternationalWireLocalData = exports.getInternationalWireView = exports.fetchWiseRedirectStatus = exports.getWiseRedirect = exports.saveMagicLinkAddressInLocalStore = exports.fetchMagicLinkBankNameBySwift = exports.fetchMagicLinkBankNameByRouting = exports.updateMagicLinkInternationalBankAccountLocalStoreData = exports.updateMagicLinkBankAccountLocalStoreData = exports.saveBankAccount = exports.fetchBillAttachment = exports.fetchMagicLinkTenant = exports.getMagicLinkCurrentAddressState = exports.getMagicLinkBankAccountView = exports.getMagicLinkView = void 0;
|
|
47
47
|
exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getFetchStateForScheduleListByType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchScheduleList = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = exports.fetchApAging = exports.updateChargeCardDetail = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.resetIssueChargeCardForm = exports.updateChargeCardLocalStore = exports.issueChargeCard = void 0;
|
|
48
48
|
exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = void 0;
|
|
49
|
-
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.
|
|
49
|
+
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = void 0;
|
|
50
50
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
51
51
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
52
52
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -1366,4 +1366,3 @@ Object.defineProperty(exports, "saveReferralFormDataInLocalStore", { enumerable:
|
|
|
1366
1366
|
Object.defineProperty(exports, "resendReferralInvite", { enumerable: true, get: function () { return referralReducer_1.resendReferralInvite; } });
|
|
1367
1367
|
Object.defineProperty(exports, "updateReferralListSortUiState", { enumerable: true, get: function () { return referralReducer_1.updateReferralListSortUiState; } });
|
|
1368
1368
|
Object.defineProperty(exports, "fetchRewardsPlan", { enumerable: true, get: function () { return referralReducer_1.fetchRewardsPlan; } });
|
|
1369
|
-
Object.defineProperty(exports, "closeReferralInviteConfirmationPopup", { enumerable: true, get: function () { return referralReducer_1.closeReferralInviteConfirmationPopup; } });
|
|
@@ -17,7 +17,7 @@ const fetchReferralsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
17
17
|
'zeni-session-id': sessionId,
|
|
18
18
|
};
|
|
19
19
|
return zeniAPI
|
|
20
|
-
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-
|
|
20
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referrals`, headers)
|
|
21
21
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
22
22
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
23
23
|
const actions = [(0, referralReducer_1.updateReferrals)(response.data)];
|
|
@@ -8,7 +8,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
10
|
return zeniAPI
|
|
11
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-
|
|
11
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referrals`, { reinvite_to: action.payload.emailId })
|
|
12
12
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
13
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
14
14
|
const actions = [
|
|
@@ -11,7 +11,7 @@ const sendReferralInviteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
11
11
|
const referRewardsPlanId = referralViewState.rewardsPlan.referRewardPlanId;
|
|
12
12
|
const invitePayload = Object.assign({}, toInvitePayloadFromLocalData(referralFormLocalData, referRewardsPlanId));
|
|
13
13
|
return zeniAPI
|
|
14
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-
|
|
14
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referrals`, invitePayload)
|
|
15
15
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
16
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
17
17
|
const actions = [(0, referralReducer_1.sendReferralInviteSuccess)()];
|
|
@@ -2,7 +2,7 @@ import { AmountPayload } from '../../entity/reimbursement/reimbursementPayload';
|
|
|
2
2
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
3
|
import { ReferralInvitation } from './referralState';
|
|
4
4
|
export interface ReferralSubmitPayload {
|
|
5
|
-
|
|
5
|
+
referral_unique_link: string;
|
|
6
6
|
}
|
|
7
7
|
export interface ReferralResubmitPayload {
|
|
8
8
|
last_invite_timestamp?: string;
|
|
@@ -12,19 +12,18 @@ export declare type ReferralResubmitResponse = ZeniAPIResponse<ReferralResubmitP
|
|
|
12
12
|
export interface FetchRewardsPayload {
|
|
13
13
|
pending_bonus: AmountPayload;
|
|
14
14
|
earned_bonus: AmountPayload;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
pending_referrals: number;
|
|
16
|
+
static_referral_link: string;
|
|
17
17
|
referees: InviteePayload[];
|
|
18
18
|
}
|
|
19
19
|
export interface FetchRewardsPlanPayload {
|
|
20
|
-
company_legal_name: string | null;
|
|
21
20
|
create_time: string | null;
|
|
22
21
|
is_deleted: boolean | null;
|
|
23
22
|
is_primary: boolean | null;
|
|
24
23
|
period: number;
|
|
25
24
|
period_unit: string;
|
|
26
25
|
refer_reward_plan_id: string;
|
|
27
|
-
|
|
26
|
+
static_referral_link: string;
|
|
28
27
|
referral_plan_amount: AmountPayload;
|
|
29
28
|
update_time: string | null;
|
|
30
29
|
}
|
|
@@ -11,7 +11,7 @@ export declare const fetchReferrals: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
11
11
|
scrollYOffset?: number | undefined;
|
|
12
12
|
}, string>, updateReferralsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, saveReferralFormDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
13
|
localData: InviteCompanyLocalData[];
|
|
14
|
-
}, string>, clearReferralFormDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>,
|
|
14
|
+
}, string>, clearReferralFormDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, resendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[emailId: string], {
|
|
15
15
|
emailId: string;
|
|
16
16
|
}, string, never, never>, resendReferralInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
17
|
emailId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateRewardsPlanFailure = exports.updateRewardsPlan = exports.fetchRewardsPlan = exports.clearReferrals = exports.resendReferralInviteSuccess = exports.resendReferralInvite = exports.sendReferralInviteFailure = exports.
|
|
4
|
+
exports.updateRewardsPlanFailure = exports.updateRewardsPlan = exports.fetchRewardsPlan = exports.clearReferrals = exports.resendReferralInviteSuccess = exports.resendReferralInvite = exports.sendReferralInviteFailure = exports.sendReferralInviteSuccess = exports.sendReferralInvite = exports.clearReferralFormDataInLocalStore = exports.saveReferralFormDataInLocalStore = exports.updateReferralsFailure = exports.updateReferralListSortUiState = exports.updateReferrals = exports.fetchReferrals = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const referralPayload_1 = require("./referralPayload");
|
|
7
7
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
@@ -38,7 +38,7 @@ exports.initialState = {
|
|
|
38
38
|
sortKey: 'referral_date',
|
|
39
39
|
sortOrder: 'descending', //default sort order
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
referralUniqueLink: (0, zeniUrl_1.toZeniUrl)(''),
|
|
42
42
|
rewardsPlanFetchState: {
|
|
43
43
|
fetchState: 'Not-Started',
|
|
44
44
|
error: undefined,
|
|
@@ -50,10 +50,8 @@ exports.initialState = {
|
|
|
50
50
|
currencySymbol: '$',
|
|
51
51
|
},
|
|
52
52
|
referRewardPlanId: 'dummy',
|
|
53
|
-
|
|
54
|
-
companyLegalName: '',
|
|
53
|
+
referralUniqueLink: (0, zeniUrl_1.toZeniUrl)(''),
|
|
55
54
|
},
|
|
56
|
-
showConfirmationPopup: false,
|
|
57
55
|
};
|
|
58
56
|
const referral = (0, toolkit_1.createSlice)({
|
|
59
57
|
name: 'referral',
|
|
@@ -75,8 +73,8 @@ const referral = (0, toolkit_1.createSlice)({
|
|
|
75
73
|
draft.error = undefined;
|
|
76
74
|
draft.earnedBonus = (0, amount_1.toAmount)(action.payload.earned_bonus.amount, action.payload.earned_bonus.currency_code, action.payload.earned_bonus.currency_symbol);
|
|
77
75
|
draft.pendingBonus = (0, amount_1.toAmount)(action.payload.pending_bonus.amount, action.payload.pending_bonus.currency_code, action.payload.pending_bonus.currency_symbol);
|
|
78
|
-
draft.pendingReferrals = action.payload.
|
|
79
|
-
draft.
|
|
76
|
+
draft.pendingReferrals = action.payload.pending_referrals;
|
|
77
|
+
draft.referralUniqueLink = (0, zeniUrl_1.toZeniUrl)(action.payload.static_referral_link);
|
|
80
78
|
draft.invitations = (0, referralPayload_1.toReferralInvitation)(action.payload.referees);
|
|
81
79
|
},
|
|
82
80
|
updateReferralsFailure(draft, action) {
|
|
@@ -101,14 +99,11 @@ const referral = (0, toolkit_1.createSlice)({
|
|
|
101
99
|
sendReferralInvite(draft) {
|
|
102
100
|
draft.sendInviteState.fetchState = 'In-Progress';
|
|
103
101
|
draft.sendInviteState.error = undefined;
|
|
104
|
-
draft.showConfirmationPopup = true;
|
|
105
102
|
},
|
|
106
103
|
sendReferralInviteSuccess(draft) {
|
|
107
104
|
draft.sendInviteState.fetchState = 'Completed';
|
|
108
105
|
draft.sendInviteState.error = undefined;
|
|
109
|
-
|
|
110
|
-
closeReferralInviteConfirmationPopup(draft) {
|
|
111
|
-
draft.showConfirmationPopup = exports.initialState.showConfirmationPopup;
|
|
106
|
+
draft.fetchState = 'Not-Started';
|
|
112
107
|
},
|
|
113
108
|
sendReferralInviteFailure(draft, action) {
|
|
114
109
|
draft.sendInviteState.fetchState = 'Error';
|
|
@@ -151,14 +146,11 @@ const referral = (0, toolkit_1.createSlice)({
|
|
|
151
146
|
},
|
|
152
147
|
},
|
|
153
148
|
updateRewardsPlan(draft, action) {
|
|
154
|
-
var _a;
|
|
155
149
|
draft.rewardsPlanFetchState.fetchState = 'Completed';
|
|
156
150
|
draft.rewardsPlanFetchState.error = undefined;
|
|
157
151
|
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);
|
|
158
152
|
draft.rewardsPlan.referRewardPlanId = action.payload.refer_reward_plan_id;
|
|
159
|
-
draft.rewardsPlan.
|
|
160
|
-
draft.rewardsPlan.companyLegalName =
|
|
161
|
-
(_a = action.payload.company_legal_name) !== null && _a !== void 0 ? _a : '';
|
|
153
|
+
draft.rewardsPlan.referralUniqueLink = (0, zeniUrl_1.toZeniUrl)(action.payload.static_referral_link);
|
|
162
154
|
},
|
|
163
155
|
updateRewardsPlanFailure(draft, action) {
|
|
164
156
|
draft.rewardsPlanFetchState.fetchState = 'Error';
|
|
@@ -169,5 +161,5 @@ const referral = (0, toolkit_1.createSlice)({
|
|
|
169
161
|
},
|
|
170
162
|
},
|
|
171
163
|
});
|
|
172
|
-
_a = referral.actions, exports.fetchReferrals = _a.fetchReferrals, exports.updateReferrals = _a.updateReferrals, exports.updateReferralListSortUiState = _a.updateReferralListSortUiState, exports.updateReferralsFailure = _a.updateReferralsFailure, exports.saveReferralFormDataInLocalStore = _a.saveReferralFormDataInLocalStore, exports.clearReferralFormDataInLocalStore = _a.clearReferralFormDataInLocalStore, exports.sendReferralInvite = _a.sendReferralInvite, exports.sendReferralInviteSuccess = _a.sendReferralInviteSuccess, exports.
|
|
164
|
+
_a = referral.actions, exports.fetchReferrals = _a.fetchReferrals, exports.updateReferrals = _a.updateReferrals, exports.updateReferralListSortUiState = _a.updateReferralListSortUiState, exports.updateReferralsFailure = _a.updateReferralsFailure, exports.saveReferralFormDataInLocalStore = _a.saveReferralFormDataInLocalStore, exports.clearReferralFormDataInLocalStore = _a.clearReferralFormDataInLocalStore, exports.sendReferralInvite = _a.sendReferralInvite, exports.sendReferralInviteSuccess = _a.sendReferralInviteSuccess, exports.sendReferralInviteFailure = _a.sendReferralInviteFailure, exports.resendReferralInvite = _a.resendReferralInvite, exports.resendReferralInviteSuccess = _a.resendReferralInviteSuccess, exports.clearReferrals = _a.clearReferrals, exports.fetchRewardsPlan = _a.fetchRewardsPlan, exports.updateRewardsPlan = _a.updateRewardsPlan, exports.updateRewardsPlanFailure = _a.updateRewardsPlanFailure;
|
|
173
165
|
exports.default = referral.reducer;
|
|
@@ -11,15 +11,12 @@ export interface ReferralListSelectorView extends SelectorView {
|
|
|
11
11
|
referralLink: ZeniUrl;
|
|
12
12
|
invitations: ReferralInvitation[];
|
|
13
13
|
uiState: ReferralViewUIState;
|
|
14
|
-
showConfirmationPopup: boolean;
|
|
15
14
|
}
|
|
16
15
|
export interface InviteFormSelectorView extends SelectorView {
|
|
17
16
|
localData: InviteCompanyLocalData[];
|
|
18
17
|
saveStatus: FetchStateAndError;
|
|
19
18
|
amount: Amount;
|
|
20
|
-
|
|
21
|
-
showConfirmationPopup: boolean;
|
|
22
|
-
companyLegalName: string;
|
|
19
|
+
referralUniqueLink: ZeniUrl;
|
|
23
20
|
}
|
|
24
21
|
export declare const getReferralListView: (state: RootState) => ReferralListSelectorView;
|
|
25
22
|
export declare const getInviteFormView: (state: RootState) => InviteFormSelectorView;
|
|
@@ -64,13 +64,12 @@ const getReferralListView = (state) => {
|
|
|
64
64
|
earnedBonus: referralViewState.earnedBonus,
|
|
65
65
|
pendingBonus: referralViewState.pendingBonus,
|
|
66
66
|
pendingReferrals: referralViewState.pendingReferrals,
|
|
67
|
-
referralLink: referralViewState.
|
|
67
|
+
referralLink: referralViewState.referralUniqueLink,
|
|
68
68
|
invitations: sortedInvitations,
|
|
69
69
|
uiState: referralViewState.uiState,
|
|
70
70
|
fetchState,
|
|
71
71
|
error,
|
|
72
72
|
amount: referralViewState.rewardsPlan.amount,
|
|
73
|
-
showConfirmationPopup: referralViewState.showConfirmationPopup,
|
|
74
73
|
};
|
|
75
74
|
};
|
|
76
75
|
exports.getReferralListView = getReferralListView;
|
|
@@ -80,11 +79,9 @@ const getInviteFormView = (state) => {
|
|
|
80
79
|
localData: referralViewState.referralFormLocalData,
|
|
81
80
|
saveStatus: referralViewState.sendInviteState,
|
|
82
81
|
amount: referralViewState.rewardsPlan.amount,
|
|
83
|
-
|
|
84
|
-
companyLegalName: referralViewState.rewardsPlan.companyLegalName,
|
|
82
|
+
referralUniqueLink: referralViewState.rewardsPlan.referralUniqueLink,
|
|
85
83
|
fetchState: referralViewState.rewardsPlanFetchState.fetchState,
|
|
86
84
|
error: referralViewState.rewardsPlanFetchState.error,
|
|
87
|
-
showConfirmationPopup: referralViewState.showConfirmationPopup,
|
|
88
85
|
};
|
|
89
86
|
};
|
|
90
87
|
exports.getInviteFormView = getInviteFormView;
|
|
@@ -22,12 +22,11 @@ export interface ReferralViewState extends FetchedState {
|
|
|
22
22
|
pendingReferrals: number;
|
|
23
23
|
invitations: ReferralInvitation[];
|
|
24
24
|
referralFormLocalData: InviteCompanyLocalData[];
|
|
25
|
-
|
|
25
|
+
referralUniqueLink: ZeniUrl;
|
|
26
26
|
sendInviteState: FetchStateAndError;
|
|
27
27
|
uiState: ReferralViewUIState;
|
|
28
28
|
rewardsPlanFetchState: FetchStateAndError;
|
|
29
29
|
rewardsPlan: RewardsPlanData;
|
|
30
|
-
showConfirmationPopup: boolean;
|
|
31
30
|
}
|
|
32
31
|
export interface ReferralViewUIState {
|
|
33
32
|
sortOrder: SortOrder;
|
|
@@ -37,8 +36,7 @@ export interface ReferralViewUIState {
|
|
|
37
36
|
export interface RewardsPlanData {
|
|
38
37
|
amount: Amount;
|
|
39
38
|
referRewardPlanId: ID;
|
|
40
|
-
|
|
41
|
-
companyLegalName: string;
|
|
39
|
+
referralUniqueLink: ZeniUrl;
|
|
42
40
|
}
|
|
43
41
|
export interface InviteCompanyLocalData {
|
|
44
42
|
companyName: string;
|
|
@@ -47,8 +45,8 @@ export interface InviteCompanyLocalData {
|
|
|
47
45
|
export declare const REFERRAL_LIST_VIEW_SORT_KEYS: readonly ["invitee_email", "amount", "status", "referral_date"];
|
|
48
46
|
export declare const toReferralListViewSortKeyType: (v: string) => "status" | "amount" | "invitee_email" | "referral_date";
|
|
49
47
|
export declare type ReferralListViewSortKey = ReturnType<typeof toReferralListViewSortKeyType>;
|
|
50
|
-
export declare const ALL_REFERRAL_STATUSES: readonly ["invite_sent", "onboarding", "active", "declined", "resend_invite", "reward_sent"];
|
|
51
|
-
export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "declined" | "invite_sent" | "resend_invite" | "reward_sent";
|
|
48
|
+
export declare const ALL_REFERRAL_STATUSES: readonly ["invite_processing", "invite_sent", "onboarding", "active", "declined", "resend_invite", "reward_sent"];
|
|
49
|
+
export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "declined" | "invite_processing" | "invite_sent" | "resend_invite" | "reward_sent";
|
|
52
50
|
export declare type ReferralStatus = ReturnType<typeof toReferralStatusType>;
|
|
53
51
|
export declare const StatusTypes: Record<ReferralStatus, string>;
|
|
54
52
|
export declare const ALL_REFERRAL_AMOUNT_STATUSES: readonly ["received", "to_be_received"];
|
|
@@ -11,6 +11,7 @@ exports.REFERRAL_LIST_VIEW_SORT_KEYS = [
|
|
|
11
11
|
const toReferralListViewSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.REFERRAL_LIST_VIEW_SORT_KEYS);
|
|
12
12
|
exports.toReferralListViewSortKeyType = toReferralListViewSortKeyType;
|
|
13
13
|
exports.ALL_REFERRAL_STATUSES = [
|
|
14
|
+
'invite_processing',
|
|
14
15
|
'invite_sent',
|
|
15
16
|
'onboarding',
|
|
16
17
|
'active',
|
|
@@ -21,6 +22,7 @@ exports.ALL_REFERRAL_STATUSES = [
|
|
|
21
22
|
const toReferralStatusType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_REFERRAL_STATUSES);
|
|
22
23
|
exports.toReferralStatusType = toReferralStatusType;
|
|
23
24
|
exports.StatusTypes = {
|
|
25
|
+
invite_processing: 'Invite Processing',
|
|
24
26
|
invite_sent: 'Invite Sent',
|
|
25
27
|
onboarding: 'Onboarding',
|
|
26
28
|
active: 'Active',
|
|
@@ -40,14 +40,14 @@ const getChargeCardListView = (state, includeCreditAccount) => {
|
|
|
40
40
|
const sortKey = chargeCardListState.uiState.sortKey;
|
|
41
41
|
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(chargeCardListState.uiState.sortOrder);
|
|
42
42
|
const cardsInOrder = (0, orderBy_1.default)(cards, (card) => {
|
|
43
|
-
var _a, _b, _c, _d;
|
|
43
|
+
var _a, _b, _c, _d, _e;
|
|
44
44
|
switch (sortKey) {
|
|
45
45
|
case 'owner':
|
|
46
|
-
return (
|
|
46
|
+
return ((_c = `${(_a = card.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName.toLowerCase()} ${(_b = card.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName.toLowerCase()}`) !== null && _c !== void 0 ? _c : '');
|
|
47
47
|
case 'cardName':
|
|
48
48
|
return card.cardName;
|
|
49
49
|
case 'department':
|
|
50
|
-
return (
|
|
50
|
+
return (_e = (_d = card.department) === null || _d === void 0 ? void 0 : _d.className) !== null && _e !== void 0 ? _e : '';
|
|
51
51
|
case 'utilisation':
|
|
52
52
|
return card.limit.amount - card.available.amount;
|
|
53
53
|
case 'limit':
|
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.55",
|
|
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",
|