@zeniai/client-epic-state 4.8.82 → 4.8.83
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 +2 -1
- package/lib/view/referralView/epics/sendReferralInviteEpic.js +1 -9
- package/lib/view/referralView/referralPayload.d.ts +1 -1
- package/lib/view/referralView/referralPayload.js +1 -1
- package/lib/view/referralView/referralReducer.d.ts +1 -1
- package/lib/view/referralView/referralReducer.js +9 -4
- package/lib/view/referralView/referralSelector.d.ts +2 -0
- package/lib/view/referralView/referralSelector.js +14 -2
- package/lib/view/referralView/referralState.d.ts +6 -5
- package/lib/view/referralView/referralState.js +3 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +1 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +1 -35
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -648,5 +648,5 @@ import { fetchZeniAccountsPromoCard } from './view/zeniAccountsPromoCard/zeniAcc
|
|
|
648
648
|
export { ZeniAccountsPromoCardState, getZeniAccountsPromoCard, ZeniAccountsPromoCardReport, fetchZeniAccountsPromoCard, };
|
|
649
649
|
import { getReferralListView, ReferralListSelectorView, getInviteFormView } from './view/referralView/referralSelector';
|
|
650
650
|
import { ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, StatusTypes, AmountStatusTypes, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus } from './view/referralView/referralState';
|
|
651
|
-
import { fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, resendReferralInvite, updateReferralListSortUiState, fetchRewardsPlan } from './view/referralView/referralReducer';
|
|
652
|
-
export { getReferralListView, getInviteFormView, ReferralListSelectorView, ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus, StatusTypes, AmountStatusTypes, fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, updateReferralListSortUiState, resendReferralInvite, fetchRewardsPlan, };
|
|
651
|
+
import { fetchReferrals, sendReferralInvite, clearReferrals, saveReferralFormDataInLocalStore, resendReferralInvite, updateReferralListSortUiState, fetchRewardsPlan, closeReferralInviteConfirmationPopup } from './view/referralView/referralReducer';
|
|
652
|
+
export { getReferralListView, getInviteFormView, ReferralListSelectorView, ReferralViewState, InviteCompanyLocalData, ReferralInvitation, ReferralListViewSortKey, ReferralViewUIState, toReferralListViewSortKeyType, ReferralStatus, ReferralAmountStatus, StatusTypes, AmountStatusTypes, fetchReferrals, sendReferralInvite, closeReferralInviteConfirmationPopup, clearReferrals, saveReferralFormDataInLocalStore, updateReferralListSortUiState, resendReferralInvite, fetchRewardsPlan, };
|
package/lib/index.js
CHANGED
|
@@ -45,7 +45,7 @@ exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingCust
|
|
|
45
45
|
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 = exports.initializeAccountMappingView = exports.getAccountMappingView = exports.clearAccountMappingLocalData = exports.saveAccountMappingLocalData = exports.saveAccountMapping = exports.getOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.clearOnboardingCustomerView = exports.saveOnboardingCustomerViewDataInLocalStore = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.updateOnboardingCustomerViewUIState = exports.updateCurrentStep = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerView = exports.updateOnboardingPaymentAccountStatus = void 0;
|
|
46
46
|
exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListUIState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.updateScheduleListTab = 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 = 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 = void 0;
|
|
47
47
|
exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = 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 = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = void 0;
|
|
48
|
-
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 = 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 = void 0;
|
|
48
|
+
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.closeReferralInviteConfirmationPopup = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = 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 = void 0;
|
|
49
49
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
50
50
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
51
51
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -1324,3 +1324,4 @@ Object.defineProperty(exports, "saveReferralFormDataInLocalStore", { enumerable:
|
|
|
1324
1324
|
Object.defineProperty(exports, "resendReferralInvite", { enumerable: true, get: function () { return referralReducer_1.resendReferralInvite; } });
|
|
1325
1325
|
Object.defineProperty(exports, "updateReferralListSortUiState", { enumerable: true, get: function () { return referralReducer_1.updateReferralListSortUiState; } });
|
|
1326
1326
|
Object.defineProperty(exports, "fetchRewardsPlan", { enumerable: true, get: function () { return referralReducer_1.fetchRewardsPlan; } });
|
|
1327
|
+
Object.defineProperty(exports, "closeReferralInviteConfirmationPopup", { enumerable: true, get: function () { return referralReducer_1.closeReferralInviteConfirmationPopup; } });
|
|
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../../responsePayload");
|
|
7
7
|
const referralReducer_1 = require("../referralReducer");
|
|
8
|
-
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
8
|
const sendReferralInviteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(referralReducer_1.sendReferralInvite.match), (0, operators_1.switchMap)(() => {
|
|
10
9
|
const { referralViewState } = state$.value;
|
|
11
10
|
const referralFormLocalData = referralViewState.referralFormLocalData;
|
|
@@ -21,14 +20,7 @@ const sendReferralInviteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
21
20
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, invitePayload, headers)
|
|
22
21
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
23
22
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
24
|
-
const actions = [
|
|
25
|
-
(0, referralReducer_1.sendReferralInviteSuccess)(),
|
|
26
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
27
|
-
messageSection: 'referral_invite_sent',
|
|
28
|
-
messageText: 'success',
|
|
29
|
-
type: 'success',
|
|
30
|
-
}),
|
|
31
|
-
];
|
|
23
|
+
const actions = [(0, referralReducer_1.sendReferralInviteSuccess)()];
|
|
32
24
|
return actions;
|
|
33
25
|
}
|
|
34
26
|
else {
|
|
@@ -7,7 +7,7 @@ const toReferralInvitation = (payload) => {
|
|
|
7
7
|
payload.map((invitee) => {
|
|
8
8
|
invitations.push({
|
|
9
9
|
companyName: invitee.company_name,
|
|
10
|
-
|
|
10
|
+
statusCode: invitee.status_code,
|
|
11
11
|
inviteesId: invitee.invitees_id,
|
|
12
12
|
isActive: invitee.is_active,
|
|
13
13
|
lastInviteTimestamp: invitee.last_invite_timestamp != null
|
|
@@ -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>, sendReferralInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, resendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[emailId: string], {
|
|
14
|
+
}, string>, clearReferralFormDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, closeReferralInviteConfirmationPopup: 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.sendReferralInviteSuccess = exports.sendReferralInvite = exports.clearReferralFormDataInLocalStore = exports.saveReferralFormDataInLocalStore = exports.updateReferralsFailure = exports.updateReferralListSortUiState = exports.updateReferrals = exports.fetchReferrals = exports.initialState = void 0;
|
|
4
|
+
exports.updateRewardsPlanFailure = exports.updateRewardsPlan = exports.fetchRewardsPlan = exports.clearReferrals = exports.resendReferralInviteSuccess = exports.resendReferralInvite = exports.sendReferralInviteFailure = exports.closeReferralInviteConfirmationPopup = 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");
|
|
@@ -35,7 +35,7 @@ exports.initialState = {
|
|
|
35
35
|
fetchState: 'Not-Started',
|
|
36
36
|
},
|
|
37
37
|
uiState: {
|
|
38
|
-
sortKey: '
|
|
38
|
+
sortKey: 'referral_date',
|
|
39
39
|
sortOrder: 'descending', //default sort order
|
|
40
40
|
},
|
|
41
41
|
referalUniqueLink: (0, zeniUrl_1.toZeniUrl)(''),
|
|
@@ -51,6 +51,7 @@ exports.initialState = {
|
|
|
51
51
|
},
|
|
52
52
|
referRewardPlanId: 'dummy',
|
|
53
53
|
},
|
|
54
|
+
showConfirmationPopup: false,
|
|
54
55
|
};
|
|
55
56
|
const referral = (0, toolkit_1.createSlice)({
|
|
56
57
|
name: 'referral',
|
|
@@ -98,11 +99,15 @@ const referral = (0, toolkit_1.createSlice)({
|
|
|
98
99
|
sendReferralInvite(draft) {
|
|
99
100
|
draft.sendInviteState.fetchState = 'In-Progress';
|
|
100
101
|
draft.sendInviteState.error = undefined;
|
|
102
|
+
draft.showConfirmationPopup = true;
|
|
101
103
|
},
|
|
102
104
|
sendReferralInviteSuccess(draft) {
|
|
103
105
|
draft.sendInviteState.fetchState = 'Completed';
|
|
104
106
|
draft.sendInviteState.error = undefined;
|
|
105
107
|
},
|
|
108
|
+
closeReferralInviteConfirmationPopup(draft) {
|
|
109
|
+
draft.showConfirmationPopup = exports.initialState.showConfirmationPopup;
|
|
110
|
+
},
|
|
106
111
|
sendReferralInviteFailure(draft, action) {
|
|
107
112
|
draft.sendInviteState.fetchState = 'Error';
|
|
108
113
|
draft.sendInviteState.error = action.payload;
|
|
@@ -154,9 +159,9 @@ const referral = (0, toolkit_1.createSlice)({
|
|
|
154
159
|
draft.rewardsPlanFetchState.error = action.payload;
|
|
155
160
|
},
|
|
156
161
|
clearReferrals(draft) {
|
|
157
|
-
|
|
162
|
+
draft.referralFormLocalData = exports.initialState.referralFormLocalData;
|
|
158
163
|
},
|
|
159
164
|
},
|
|
160
165
|
});
|
|
161
|
-
_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;
|
|
166
|
+
_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.closeReferralInviteConfirmationPopup = _a.closeReferralInviteConfirmationPopup, 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;
|
|
162
167
|
exports.default = referral.reducer;
|
|
@@ -11,11 +11,13 @@ export interface ReferralListSelectorView extends SelectorView {
|
|
|
11
11
|
referralLink: ZeniUrl;
|
|
12
12
|
invitations: ReferralInvitation[];
|
|
13
13
|
uiState: ReferralViewUIState;
|
|
14
|
+
showConfirmationPopup: boolean;
|
|
14
15
|
}
|
|
15
16
|
export interface InviteFormSelectorView extends SelectorView {
|
|
16
17
|
localData: InviteCompanyLocalData[];
|
|
17
18
|
saveStatus: FetchStateAndError;
|
|
18
19
|
amount: Amount;
|
|
20
|
+
showConfirmationPopup: boolean;
|
|
19
21
|
}
|
|
20
22
|
export declare const getReferralListView: (state: RootState) => ReferralListSelectorView;
|
|
21
23
|
export declare const getInviteFormView: (state: RootState) => InviteFormSelectorView;
|
|
@@ -31,7 +31,15 @@ const getReferralListView = (state) => {
|
|
|
31
31
|
}
|
|
32
32
|
break;
|
|
33
33
|
case 'status':
|
|
34
|
-
if (Boolean(invitation.
|
|
34
|
+
if (Boolean(invitation.statusCode) === true) {
|
|
35
|
+
invitationsWithSortKeyValue.push(invitation);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
invitationsWithNoSortKeyValue.push(invitation);
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case 'referral_date':
|
|
42
|
+
if (Boolean(invitation.lastInviteTimestamp) === true) {
|
|
35
43
|
invitationsWithSortKeyValue.push(invitation);
|
|
36
44
|
}
|
|
37
45
|
else {
|
|
@@ -47,7 +55,9 @@ const getReferralListView = (state) => {
|
|
|
47
55
|
case 'amount':
|
|
48
56
|
return invitation.amount.amount;
|
|
49
57
|
case 'status':
|
|
50
|
-
return invitation.
|
|
58
|
+
return invitation.statusCode.toLowerCase();
|
|
59
|
+
case 'referral_date':
|
|
60
|
+
return invitation.lastInviteTimestamp;
|
|
51
61
|
}
|
|
52
62
|
}, sortOrder === 'ascending' ? 'asc' : 'desc');
|
|
53
63
|
return {
|
|
@@ -60,6 +70,7 @@ const getReferralListView = (state) => {
|
|
|
60
70
|
fetchState,
|
|
61
71
|
error,
|
|
62
72
|
amount: referralViewState.rewardsPlan.amount,
|
|
73
|
+
showConfirmationPopup: referralViewState.showConfirmationPopup,
|
|
63
74
|
};
|
|
64
75
|
};
|
|
65
76
|
exports.getReferralListView = getReferralListView;
|
|
@@ -71,6 +82,7 @@ const getInviteFormView = (state) => {
|
|
|
71
82
|
amount: referralViewState.rewardsPlan.amount,
|
|
72
83
|
fetchState: referralViewState.rewardsPlanFetchState.fetchState,
|
|
73
84
|
error: referralViewState.rewardsPlanFetchState.error,
|
|
85
|
+
showConfirmationPopup: referralViewState.showConfirmationPopup,
|
|
74
86
|
};
|
|
75
87
|
};
|
|
76
88
|
exports.getInviteFormView = getInviteFormView;
|
|
@@ -5,7 +5,7 @@ import { ZeniDate } from '../../zeniDayJS';
|
|
|
5
5
|
import ZeniUrl from '../../zeniUrl';
|
|
6
6
|
export interface ReferralInvitation {
|
|
7
7
|
companyName: string;
|
|
8
|
-
|
|
8
|
+
statusCode: string;
|
|
9
9
|
inviteesId: ID;
|
|
10
10
|
isActive: boolean;
|
|
11
11
|
lastInviteTimestamp?: ZeniDate;
|
|
@@ -27,6 +27,7 @@ export interface ReferralViewState extends FetchedState {
|
|
|
27
27
|
uiState: ReferralViewUIState;
|
|
28
28
|
rewardsPlanFetchState: FetchStateAndError;
|
|
29
29
|
rewardsPlan: RewardsPlanData;
|
|
30
|
+
showConfirmationPopup: boolean;
|
|
30
31
|
}
|
|
31
32
|
export interface ReferralViewUIState {
|
|
32
33
|
sortOrder: SortOrder;
|
|
@@ -41,11 +42,11 @@ export interface InviteCompanyLocalData {
|
|
|
41
42
|
companyName: string;
|
|
42
43
|
emailIds: string[];
|
|
43
44
|
}
|
|
44
|
-
export declare const REFERRAL_LIST_VIEW_SORT_KEYS: readonly ["invitee_email", "amount", "status"];
|
|
45
|
-
export declare const toReferralListViewSortKeyType: (v: string) => "status" | "amount" | "invitee_email";
|
|
45
|
+
export declare const REFERRAL_LIST_VIEW_SORT_KEYS: readonly ["invitee_email", "amount", "status", "referral_date"];
|
|
46
|
+
export declare const toReferralListViewSortKeyType: (v: string) => "status" | "amount" | "invitee_email" | "referral_date";
|
|
46
47
|
export declare type ReferralListViewSortKey = ReturnType<typeof toReferralListViewSortKeyType>;
|
|
47
|
-
export declare const ALL_REFERRAL_STATUSES: readonly ["invite_sent", "onboarding", "active", "declined", "resend_invite"];
|
|
48
|
-
export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "invite_sent" | "declined" | "resend_invite";
|
|
48
|
+
export declare const ALL_REFERRAL_STATUSES: readonly ["invite_sent", "onboarding", "active", "declined", "resend_invite", "reward_sent"];
|
|
49
|
+
export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "invite_sent" | "declined" | "resend_invite" | "reward_sent";
|
|
49
50
|
export declare type ReferralStatus = ReturnType<typeof toReferralStatusType>;
|
|
50
51
|
export declare const StatusTypes: Record<ReferralStatus, string>;
|
|
51
52
|
export declare const ALL_REFERRAL_AMOUNT_STATUSES: readonly ["received", "to_be_received"];
|
|
@@ -6,6 +6,7 @@ exports.REFERRAL_LIST_VIEW_SORT_KEYS = [
|
|
|
6
6
|
'invitee_email',
|
|
7
7
|
'amount',
|
|
8
8
|
'status',
|
|
9
|
+
'referral_date',
|
|
9
10
|
];
|
|
10
11
|
const toReferralListViewSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.REFERRAL_LIST_VIEW_SORT_KEYS);
|
|
11
12
|
exports.toReferralListViewSortKeyType = toReferralListViewSortKeyType;
|
|
@@ -15,6 +16,7 @@ exports.ALL_REFERRAL_STATUSES = [
|
|
|
15
16
|
'active',
|
|
16
17
|
'declined',
|
|
17
18
|
'resend_invite',
|
|
19
|
+
'reward_sent',
|
|
18
20
|
];
|
|
19
21
|
const toReferralStatusType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_REFERRAL_STATUSES);
|
|
20
22
|
exports.toReferralStatusType = toReferralStatusType;
|
|
@@ -24,6 +26,7 @@ exports.StatusTypes = {
|
|
|
24
26
|
active: 'Active',
|
|
25
27
|
declined: 'Declined',
|
|
26
28
|
resend_invite: 'Resend Invite',
|
|
29
|
+
reward_sent: 'Reward Sent',
|
|
27
30
|
};
|
|
28
31
|
exports.ALL_REFERRAL_AMOUNT_STATUSES = [
|
|
29
32
|
'received',
|
|
@@ -3,8 +3,7 @@ import { ZeniAPI } from '../../../../../zeniAPI';
|
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
4
|
import { saveBillDetail, saveBillSuccessOrFailure } from '../editBillViewReducer';
|
|
5
5
|
import { updateBillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
6
|
-
import {
|
|
7
|
-
import { BillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionState';
|
|
6
|
+
import { RecurringBillInstance } from '../editBillViewState';
|
|
8
7
|
import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
|
|
9
8
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
10
9
|
export declare type ActionType = ReturnType<typeof saveBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveBillSuccessOrFailure> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
|
|
@@ -16,4 +15,3 @@ export interface RecurringBillInstancePayload {
|
|
|
16
15
|
vendor_receive_date_notes: string;
|
|
17
16
|
}
|
|
18
17
|
export declare const toRecurringBillInstancePayload: (recurringBillInstance: RecurringBillInstance, maxPaymentProcessingDays: number) => RecurringBillInstancePayload;
|
|
19
|
-
export declare const checkIfUpdateCurrentBill: (editBillDetail: EditBillDetail, originalBillDetail?: BillTransaction | undefined) => boolean;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.toRecurringBillInstancePayload = exports.saveBillDetailEpic = void 0;
|
|
7
7
|
const rxjs_1 = require("rxjs");
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
@@ -169,7 +169,6 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
169
169
|
if ((detail === null || detail === void 0 ? void 0 : detail.isRecurring) === true &&
|
|
170
170
|
Boolean(billDetail.billDetailLocalData.isRecurring) === false) {
|
|
171
171
|
payload.is_recurring = false;
|
|
172
|
-
payload.is_update_current_bill = true;
|
|
173
172
|
}
|
|
174
173
|
}
|
|
175
174
|
else {
|
|
@@ -194,11 +193,6 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
194
193
|
payload.is_update_recurring_bill_config = isConfigChangedForExistingBill;
|
|
195
194
|
payload.is_update_future_recurring_bills =
|
|
196
195
|
recurringConfig.updateRecurringBills === 'all';
|
|
197
|
-
payload.is_update_current_bill =
|
|
198
|
-
recurringConfig.updateRecurringBills === 'all' ||
|
|
199
|
-
(0, exports.checkIfUpdateCurrentBill)(billDetail, detail)
|
|
200
|
-
? true
|
|
201
|
-
: recurringConfig.updateRecurringBills === 'current';
|
|
202
196
|
if ((isConfigChangedForExistingBill ||
|
|
203
197
|
recurringConfig.updateRecurringBills === 'all') &&
|
|
204
198
|
payload.recurring_bill_config != null) {
|
|
@@ -227,10 +221,6 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
227
221
|
return (0, exports.toRecurringBillInstancePayload)(instance, (_d = (_c = (_b = (_a = billDetail.billDetailLocalData.paymentDetailsSection) === null || _a === void 0 ? void 0 : _a.paymentType) === null || _b === void 0 ? void 0 : _b.maxPeriod) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : workingDayHelper_1.PAYMENT_BUSINESS_DAYS);
|
|
228
222
|
});
|
|
229
223
|
}
|
|
230
|
-
//platform needs this when converting a bill from non-recurring to recurring
|
|
231
|
-
if ((detail === null || detail === void 0 ? void 0 : detail.isRecurring) === false) {
|
|
232
|
-
payload.is_update_current_bill = true;
|
|
233
|
-
}
|
|
234
224
|
}
|
|
235
225
|
return payload;
|
|
236
226
|
}
|
|
@@ -258,27 +248,3 @@ const toRecurringBillInstancePayload = (recurringBillInstance, maxPaymentProcess
|
|
|
258
248
|
};
|
|
259
249
|
};
|
|
260
250
|
exports.toRecurringBillInstancePayload = toRecurringBillInstancePayload;
|
|
261
|
-
const checkIfUpdateCurrentBill = (editBillDetail, originalBillDetail) => {
|
|
262
|
-
var _a, _b, _c, _d, _e;
|
|
263
|
-
const { paymentDetailsSection, whatForSection } = editBillDetail.billDetailLocalData;
|
|
264
|
-
if (((_a = paymentDetailsSection === null || paymentDetailsSection === void 0 ? void 0 : paymentDetailsSection.paymentDate) === null || _a === void 0 ? void 0 : _a.toString()) !==
|
|
265
|
-
((_b = originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.billPayInfo.paymentDate) === null || _b === void 0 ? void 0 : _b.toString())) {
|
|
266
|
-
return true;
|
|
267
|
-
}
|
|
268
|
-
if ((whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.invoiceNumber) !== (originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.documentId)) {
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
if (((_c = whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.billDueDate) === null || _c === void 0 ? void 0 : _c.toString()) !==
|
|
272
|
-
((_d = originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.dueDate) === null || _d === void 0 ? void 0 : _d.toString())) {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
if (((_e = whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.invoiceDate) === null || _e === void 0 ? void 0 : _e.toString()) !==
|
|
276
|
-
(originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.date.toString())) {
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
if ((originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.billPayInfo.stage.code) === 'draft') {
|
|
280
|
-
return true;
|
|
281
|
-
}
|
|
282
|
-
return false;
|
|
283
|
-
};
|
|
284
|
-
exports.checkIfUpdateCurrentBill = checkIfUpdateCurrentBill;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.83",
|
|
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",
|