@zeniai/client-epic-state 4.7.79 → 4.7.81
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/entity/account/accountPayload.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -0
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +4 -14
- package/lib/entity/chargeCard/chargeCardPayload.js +1 -0
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +2 -5
- package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountPayload.js +2 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +2 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +14 -1
- package/lib/entity/paymentAccount/paymentAccountState.d.ts +1 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -1
- package/lib/entity/tenant/clearAllEpic.js +6 -0
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.d.ts +2 -2
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +2 -2
- package/lib/epic.d.ts +10 -10
- package/lib/epic.js +10 -10
- package/lib/index.d.ts +25 -11
- package/lib/index.js +35 -22
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -0
- package/lib/view/accountList/fetchAccountListEpic.js +16 -7
- package/lib/view/authenticationView/authenticationViewPayload.d.ts +6 -0
- package/lib/view/authenticationView/authenticationViewReducer.d.ts +9 -0
- package/lib/view/authenticationView/authenticationViewReducer.js +60 -0
- package/lib/view/authenticationView/authenticationViewSelector.d.ts +7 -0
- package/lib/view/authenticationView/authenticationViewSelector.js +11 -0
- package/lib/view/authenticationView/authenticationViewState.d.ts +10 -0
- package/lib/view/authenticationView/authenticationViewState.js +2 -0
- package/lib/view/authenticationView/epics/fetchCollaborationAuthTokenEpic.d.ts +8 -0
- package/lib/view/authenticationView/epics/fetchCollaborationAuthTokenEpic.js +28 -0
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/verifyUserEpic.d.ts +2 -2
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/verifyUserEpic.js +2 -2
- package/lib/view/commonVendorView/vendorView/vendorViewReducer.d.ts +4 -9
- package/lib/view/commonVendorView/vendorView/vendorViewReducer.js +41 -70
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -9
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +70 -102
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchBankAccountsListEpic.d.ts +22 -0
- package/lib/view/settingsView/epic/fetchBankAccountsListEpic.js +30 -0
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +6 -0
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +14 -0
- package/lib/view/settingsView/epic/fetchMyProfileEpic.d.ts +43 -0
- package/lib/view/settingsView/epic/fetchMyProfileEpic.js +50 -0
- package/lib/view/settingsView/epic/fetchMyProfileViewEpic.d.ts +7 -0
- package/lib/view/settingsView/epic/fetchMyProfileViewEpic.js +17 -0
- package/lib/view/settingsView/settingsViewPayload.d.ts +8 -0
- package/lib/view/settingsView/settingsViewPayload.js +2 -0
- package/lib/view/settingsView/settingsViewReducer.d.ts +13 -0
- package/lib/view/settingsView/settingsViewReducer.js +71 -0
- package/lib/view/settingsView/settingsViewSelector.d.ts +14 -0
- package/lib/view/settingsView/settingsViewSelector.js +119 -0
- package/lib/view/settingsView/settingsViewState.d.ts +12 -0
- package/lib/view/settingsView/settingsViewState.js +2 -0
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +29 -0
- package/lib/view/settingsView/types/settingsViewSelectorTypes.js +2 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +3 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +27 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +4 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +4 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +25 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +6 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardDetailEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardDetailEpic.js +60 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -9
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +72 -104
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +10 -0
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +90 -0
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +10 -0
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +93 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +16 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +2 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +19 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +11 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +21 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +101 -0
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +10 -0
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +90 -0
- package/package.json +1 -1
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewResendOtpEpic.d.ts +0 -7
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewResendOtpEpic.js +0 -24
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewSendOtpEpic.d.ts +0 -7
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewSendOtpEpic.js +0 -26
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewVerifyOtpEpic.d.ts +0 -7
- package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewVerifyOtpEpic.js +0 -28
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/resendOnboardingOfficerOtpEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/resendOnboardingOfficerOtpEpic.js +0 -24
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/sendOnboardingOfficerOtpEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/sendOnboardingOfficerOtpEpic.js +0 -27
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/verifyOnboardingOfficerOtpEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/verifyOnboardingOfficerOtpEpic.js +0 -30
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/resendOtpEpic.d.ts +0 -7
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/resendOtpEpic.js +0 -23
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/sendOtpEpic.d.ts +0 -7
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/sendOtpEpic.js +0 -26
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/verifyOtpEpic.d.ts +0 -7
- package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/verifyOtpEpic.js +0 -27
- package/lib/view/spendManagement/commonSetup/types/twoFactorAuthentication.d.ts +0 -10
- /package/lib/view/{spendManagement/commonSetup/types/twoFactorAuthentication.js → authenticationView/authenticationViewPayload.js} +0 -0
|
@@ -23,6 +23,13 @@ export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").Actio
|
|
|
23
23
|
}, string>, updateChargeCardTransactionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
24
24
|
chargeCardId: ID;
|
|
25
25
|
error: ZeniAPIStatus;
|
|
26
|
+
}, string>, updateChargeCardDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, colorCode: string], {
|
|
27
|
+
chargeCardId: string;
|
|
28
|
+
colorCode: string;
|
|
29
|
+
}, string, never, never>, updateChargeCardDetailUpdateStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
|
+
chargeCardId: ID;
|
|
31
|
+
fetchState: FetchState;
|
|
32
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
26
33
|
}, string>, clearChargeCardDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
27
34
|
declare const _default: import("@reduxjs/toolkit").Reducer<ChargeCardDetailState, import("@reduxjs/toolkit").AnyAction>;
|
|
28
35
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionList = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
4
|
+
exports.clearChargeCardDetail = exports.updateChargeCardDetailUpdateStatus = exports.updateChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionList = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
7
7
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
@@ -76,10 +76,33 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
76
76
|
const existingCardDetail = draft.detailById[chargeCardId];
|
|
77
77
|
draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { transactionList: Object.assign(Object.assign({}, existingCardDetail.transactionList), { fetchState: 'Error', error }) });
|
|
78
78
|
},
|
|
79
|
+
updateChargeCardDetail: {
|
|
80
|
+
reducer(draft, action) {
|
|
81
|
+
const { chargeCardId } = action.payload;
|
|
82
|
+
const existingCardDetail = draft.detailById[chargeCardId];
|
|
83
|
+
draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { updateStatus: {
|
|
84
|
+
fetchState: 'In-Progress',
|
|
85
|
+
error: undefined,
|
|
86
|
+
} });
|
|
87
|
+
},
|
|
88
|
+
prepare(chargeCardId, colorCode) {
|
|
89
|
+
return {
|
|
90
|
+
payload: { chargeCardId, colorCode },
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
updateChargeCardDetailUpdateStatus(draft, action) {
|
|
95
|
+
const { chargeCardId, fetchState, error } = action.payload;
|
|
96
|
+
const existingCardDetail = draft.detailById[chargeCardId];
|
|
97
|
+
draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { updateStatus: {
|
|
98
|
+
fetchState,
|
|
99
|
+
error,
|
|
100
|
+
} });
|
|
101
|
+
},
|
|
79
102
|
clearChargeCardDetail(draft) {
|
|
80
103
|
Object.assign(draft, exports.initialState);
|
|
81
104
|
},
|
|
82
105
|
},
|
|
83
106
|
});
|
|
84
|
-
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
|
|
107
|
+
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
|
|
85
108
|
exports.default = chargeCardDetail.reducer;
|
|
@@ -5,11 +5,14 @@ import { RootState } from '../../../../reducer';
|
|
|
5
5
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
6
6
|
import { ChargeCardWithUser } from '../chargeCardList/chargeCardListSelector';
|
|
7
7
|
import { ChargeCardDetailUiState } from './chargeCardDetail';
|
|
8
|
+
import { TwoFactorAuthenticationState } from '../../../twoFactorAuthentication/twoFactorAuthentication';
|
|
8
9
|
export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
9
10
|
chargeCardConfig: ChargeCardConfigState;
|
|
10
11
|
transactions: ChargeCardTransaction[];
|
|
11
12
|
uiState: ChargeCardDetailUiState;
|
|
12
13
|
transactionListFetchState: FetchStateAndError;
|
|
14
|
+
twoFAView: TwoFactorAuthenticationState;
|
|
15
|
+
loggedInUserPhone: string;
|
|
13
16
|
chargeCard?: ChargeCardWithUser;
|
|
14
17
|
}
|
|
15
18
|
export declare const getChargeCardDetailView: (state: RootState, chargeCardId: ID) => ChargeCardDetailSelectorView;
|
|
@@ -14,7 +14,10 @@ const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
|
14
14
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
15
15
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
16
16
|
const getChargeCardDetailView = (state, chargeCardId) => {
|
|
17
|
-
|
|
17
|
+
var _a, _b, _c, _d, _e;
|
|
18
|
+
const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, twoFactorAuthenticationState, } = state;
|
|
19
|
+
const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
20
|
+
const loggedInUserPhone = (_e = (_c = twoFactorAuthenticationState.phone) !== null && _c !== void 0 ? _c : (_d = (0, userSelector_1.getUserByUserId)(userState, loggedInUserId)) === null || _d === void 0 ? void 0 : _d.phone) !== null && _e !== void 0 ? _e : '';
|
|
18
21
|
let chargeCardWithUser = undefined;
|
|
19
22
|
const chargeCardDetail = (0, get_1.default)(chargeCardDetailState.detailById, chargeCardId, undefined);
|
|
20
23
|
const chargeCard = (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, chargeCardId);
|
|
@@ -62,6 +65,8 @@ const getChargeCardDetailView = (state, chargeCardId) => {
|
|
|
62
65
|
transactions,
|
|
63
66
|
uiState,
|
|
64
67
|
transactionListFetchState,
|
|
68
|
+
twoFAView: twoFactorAuthenticationState,
|
|
69
|
+
loggedInUserPhone,
|
|
65
70
|
version: '1.0',
|
|
66
71
|
};
|
|
67
72
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { updateChargeCardDetail, updateChargeCardDetailUpdateStatus } from './chargeCardDetailReducer';
|
|
6
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
import { updateAllUsers } from '../../../../entity/user/userReducer';
|
|
8
|
+
import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
|
|
9
|
+
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
10
|
+
export declare type ActionType = ReturnType<typeof updateChargeCardDetail> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCardDetailUpdateStatus> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateChargeCard>;
|
|
11
|
+
export declare const updateChargeCardDetailEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateChargeCardDetailEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
10
|
+
const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
|
|
11
|
+
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
12
|
+
const updateChargeCardDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.updateChargeCardDetail.match), (0, operators_1.switchMap)((action) => {
|
|
13
|
+
const { chargeCardId, colorCode } = action.payload;
|
|
14
|
+
const payload = { card_color_code: colorCode };
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}`, payload)
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
19
|
+
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardDetailReducer_1.updateChargeCardDetailUpdateStatus)({
|
|
20
|
+
chargeCardId,
|
|
21
|
+
fetchState: 'Completed',
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
26
|
+
messageSection: 'update_charge_card',
|
|
27
|
+
messageText: 'failed',
|
|
28
|
+
type: 'error',
|
|
29
|
+
variables: [
|
|
30
|
+
{
|
|
31
|
+
variableName: '_api-error_',
|
|
32
|
+
variableValue: response.status.message,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
}), (0, chargeCardDetailReducer_1.updateChargeCardDetailUpdateStatus)({
|
|
36
|
+
chargeCardId,
|
|
37
|
+
fetchState: 'Error',
|
|
38
|
+
error: response.status,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
}), (0, operators_1.catchError)((error) => {
|
|
42
|
+
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
43
|
+
messageSection: 'update_charge_card',
|
|
44
|
+
messageText: 'failed',
|
|
45
|
+
type: 'error',
|
|
46
|
+
variables: [
|
|
47
|
+
{
|
|
48
|
+
variableName: '_api-error_',
|
|
49
|
+
variableValue: JSON.stringify(error),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
}), (0, chargeCardDetailReducer_1.updateChargeCardDetailUpdateStatus)({
|
|
53
|
+
chargeCardId,
|
|
54
|
+
fetchState: 'Error',
|
|
55
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update card detail API call errored out' +
|
|
56
|
+
JSON.stringify(error)),
|
|
57
|
+
}));
|
|
58
|
+
}));
|
|
59
|
+
}));
|
|
60
|
+
exports.updateChargeCardDetailEpic = updateChargeCardDetailEpic;
|
|
@@ -80,16 +80,9 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
|
|
|
80
80
|
}, string>, updateSetupViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], paymentAccountIds: string[]], {
|
|
81
81
|
allBankAccountIds: string[];
|
|
82
82
|
paymentAccountIds: string[];
|
|
83
|
-
}, string, never, never>,
|
|
84
|
-
phoneNumber: string;
|
|
85
|
-
}, string, never, never>, resendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpChallenge: string], {
|
|
83
|
+
}, string, never, never>, sendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
86
84
|
otpChallenge: string;
|
|
87
|
-
}, string
|
|
88
|
-
otpChallenge: string;
|
|
89
|
-
}, string, never, never>, sendOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, verifyOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpCode: string, otpChallenge: string], {
|
|
90
|
-
otpCode: string;
|
|
91
|
-
otpChallenge: string;
|
|
92
|
-
}, string, never, never>, verifyOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, saveIndustryAndIncDateInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
85
|
+
}, string>, sendOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, verifyOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, saveIndustryAndIncDateInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
93
86
|
industry: string;
|
|
94
87
|
incDate: ZeniDate;
|
|
95
88
|
}, string>, clearSetupViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.
|
|
4
|
+
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.updateSetupViewAccountDetails = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.establishPlaidConnectionFailure = exports.establishPlaidConnectionSuccess = exports.establishPlaidConnection = exports.getPlaidLinkTokenFailure = exports.getPlaidLinkTokenSuccess = exports.getPlaidLinkToken = exports.updatePaymentAccountLoginStatusFailure = exports.updatePaymentAccountLoginStatusSuccess = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccountStatusFailure = exports.updatePaymentAccountStatusSuccess = exports.updatePaymentAccountStatus = exports.updatePaymentAccountFailure = exports.updatePaymentAccountSuccess = exports.updatePaymentAccount = exports.getPaymentAccountsFailure = exports.getPaymentAccountsSuccess = exports.getPaymentAccounts = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
7
7
|
const initialFetchStatus = {
|
|
@@ -505,100 +505,74 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
505
505
|
};
|
|
506
506
|
},
|
|
507
507
|
},
|
|
508
|
-
sendOtp
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
draft.companyOfficerUpdateStatus[officerType].localData
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
});
|
|
524
|
-
},
|
|
525
|
-
prepare(phoneNumber) {
|
|
526
|
-
return { payload: { phoneNumber } };
|
|
527
|
-
},
|
|
508
|
+
sendOtp(draft) {
|
|
509
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
510
|
+
var _a;
|
|
511
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
512
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
513
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
514
|
+
fetchState: 'In-Progress',
|
|
515
|
+
error: undefined,
|
|
516
|
+
};
|
|
517
|
+
draft.companyOfficerUpdateStatus[officerType].localData =
|
|
518
|
+
Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
|
|
519
|
+
isPhoneVerified: false,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
});
|
|
528
523
|
},
|
|
529
|
-
resendOtp
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
});
|
|
541
|
-
},
|
|
542
|
-
prepare(otpChallenge) {
|
|
543
|
-
return { payload: { otpChallenge } };
|
|
544
|
-
},
|
|
524
|
+
resendOtp(draft) {
|
|
525
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
526
|
+
var _a;
|
|
527
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
528
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
529
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
530
|
+
fetchState: 'In-Progress',
|
|
531
|
+
error: undefined,
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
});
|
|
545
535
|
},
|
|
546
|
-
sendOtpSuccess
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
draft.companyOfficerUpdateStatus[officerType].localData
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
});
|
|
562
|
-
},
|
|
563
|
-
prepare(otpChallenge) {
|
|
564
|
-
return { payload: { otpChallenge } };
|
|
565
|
-
},
|
|
536
|
+
sendOtpSuccess(draft, action) {
|
|
537
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
538
|
+
var _a;
|
|
539
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
540
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
541
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
542
|
+
fetchState: 'Completed',
|
|
543
|
+
error: undefined,
|
|
544
|
+
};
|
|
545
|
+
draft.companyOfficerUpdateStatus[officerType].localData =
|
|
546
|
+
Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
|
|
547
|
+
otpChallenge: action.payload.otpChallenge,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
});
|
|
566
551
|
},
|
|
567
|
-
sendOtpFailure
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
});
|
|
579
|
-
},
|
|
580
|
-
prepare(error) {
|
|
581
|
-
return {
|
|
582
|
-
payload: error,
|
|
583
|
-
};
|
|
584
|
-
},
|
|
552
|
+
sendOtpFailure(draft, action) {
|
|
553
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
554
|
+
var _a;
|
|
555
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
556
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
557
|
+
draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
|
|
558
|
+
fetchState: 'Error',
|
|
559
|
+
error: action.payload,
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
});
|
|
585
563
|
},
|
|
586
|
-
verifyOtp
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
564
|
+
verifyOtp(draft) {
|
|
565
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
566
|
+
var _a;
|
|
567
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
568
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
569
|
+
draft.companyOfficerUpdateStatus[officerType].otpverificationStatus =
|
|
570
|
+
{
|
|
593
571
|
fetchState: 'In-Progress',
|
|
594
572
|
error: undefined,
|
|
595
573
|
};
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
},
|
|
599
|
-
prepare(otpCode, otpChallenge) {
|
|
600
|
-
return { payload: { otpCode, otpChallenge } };
|
|
601
|
-
},
|
|
574
|
+
}
|
|
575
|
+
});
|
|
602
576
|
},
|
|
603
577
|
verifyOtpSuccess(draft) {
|
|
604
578
|
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
@@ -617,24 +591,18 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
617
591
|
}
|
|
618
592
|
});
|
|
619
593
|
},
|
|
620
|
-
verifyOtpFailure
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
594
|
+
verifyOtpFailure(draft, action) {
|
|
595
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
596
|
+
var _a;
|
|
597
|
+
if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
|
|
598
|
+
((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
|
|
599
|
+
draft.companyOfficerUpdateStatus[officerType].otpverificationStatus =
|
|
600
|
+
{
|
|
627
601
|
fetchState: 'Error',
|
|
628
602
|
error: action.payload,
|
|
629
603
|
};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
},
|
|
633
|
-
prepare(error) {
|
|
634
|
-
return {
|
|
635
|
-
payload: error,
|
|
636
|
-
};
|
|
637
|
-
},
|
|
604
|
+
}
|
|
605
|
+
});
|
|
638
606
|
},
|
|
639
607
|
saveIndustryAndIncDateInLocalStore(draft, action) {
|
|
640
608
|
if (draft.companyDetails.localData != null) {
|
|
@@ -651,5 +619,5 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
651
619
|
},
|
|
652
620
|
},
|
|
653
621
|
});
|
|
654
|
-
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.
|
|
622
|
+
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
|
|
655
623
|
exports.default = setupView.reducer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
+
import { resendOtp, sendOtpSuccess, sendOtpFailure } from './twoFactorAuthenticationReducer';
|
|
6
|
+
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
7
|
+
import { resendOtpVendorView, sendOtpVendorViewSuccess, sendOtpVendorViewFailure } from '../commonVendorView/vendorView/vendorViewReducer';
|
|
8
|
+
import { resendOnboardingOfficerOtp, sendOnboardingOfficerOtpFailure, sendOnboardingOfficerOtpSuccess } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure>;
|
|
10
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resendOtpEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
7
|
+
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
8
|
+
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
9
|
+
const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewReducer");
|
|
10
|
+
const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
11
|
+
const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const resendOtpActions = [];
|
|
13
|
+
const { otpChallenge, twoFASource } = action.payload;
|
|
14
|
+
const payload = {
|
|
15
|
+
otp_challenge: otpChallenge,
|
|
16
|
+
is_for_charge_cards: twoFASource === 'ChargeCard',
|
|
17
|
+
};
|
|
18
|
+
switch (twoFASource) {
|
|
19
|
+
case 'SpendManagementSetup':
|
|
20
|
+
resendOtpActions.push((0, setupViewReducer_1.resendOtpSpendManagementSetUp)());
|
|
21
|
+
break;
|
|
22
|
+
case 'BillPayVendor':
|
|
23
|
+
resendOtpActions.push((0, vendorViewReducer_1.resendOtpVendorView)());
|
|
24
|
+
break;
|
|
25
|
+
case 'CustomerOnboarding':
|
|
26
|
+
resendOtpActions.push((0, onboardingCustomerViewReducer_1.resendOnboardingOfficerOtp)());
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
const resendOtp$ = zeniAPI
|
|
30
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/resend`, payload)
|
|
31
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
32
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
33
|
+
const updateActions = [
|
|
34
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpSuccess)({ otpChallenge: response.data.otp_challenge }),
|
|
35
|
+
];
|
|
36
|
+
switch (twoFASource) {
|
|
37
|
+
case 'SpendManagementSetup':
|
|
38
|
+
updateActions.push((0, setupViewReducer_1.sendOtpSuccessSpendManagementSetUp)({
|
|
39
|
+
otpChallenge: response.data.otp_challenge,
|
|
40
|
+
}));
|
|
41
|
+
break;
|
|
42
|
+
case 'BillPayVendor':
|
|
43
|
+
updateActions.push((0, vendorViewReducer_1.sendOtpVendorViewSuccess)({
|
|
44
|
+
otpChallenge: response.data.otp_challenge,
|
|
45
|
+
}));
|
|
46
|
+
break;
|
|
47
|
+
case 'CustomerOnboarding':
|
|
48
|
+
updateActions.push((0, onboardingCustomerViewReducer_1.sendOnboardingOfficerOtpSuccess)({
|
|
49
|
+
otpChallenge: response.data.otp_challenge,
|
|
50
|
+
}));
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return (0, rxjs_1.from)(updateActions);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const updateActions = [
|
|
57
|
+
(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(response.status),
|
|
58
|
+
];
|
|
59
|
+
switch (twoFASource) {
|
|
60
|
+
case 'SpendManagementSetup':
|
|
61
|
+
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(response.status));
|
|
62
|
+
break;
|
|
63
|
+
case 'BillPayVendor':
|
|
64
|
+
updateActions.push((0, vendorViewReducer_1.sendOtpVendorViewFailure)(response.status));
|
|
65
|
+
break;
|
|
66
|
+
case 'CustomerOnboarding':
|
|
67
|
+
updateActions.push((0, onboardingCustomerViewReducer_1.sendOnboardingOfficerOtpFailure)(response.status));
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return (0, rxjs_1.from)(updateActions);
|
|
71
|
+
}
|
|
72
|
+
}), (0, operators_1.catchError)((error) => {
|
|
73
|
+
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Resend otp api errored out' + JSON.stringify(error));
|
|
74
|
+
const updateActions = [(0, twoFactorAuthenticationReducer_1.sendOtpFailure)(zeniAPIStatus)];
|
|
75
|
+
switch (twoFASource) {
|
|
76
|
+
case 'SpendManagementSetup':
|
|
77
|
+
updateActions.push((0, setupViewReducer_1.sendOtpFailureSpendManagementSetUp)(zeniAPIStatus));
|
|
78
|
+
break;
|
|
79
|
+
case 'BillPayVendor':
|
|
80
|
+
updateActions.push((0, vendorViewReducer_1.sendOtpVendorViewFailure)(zeniAPIStatus));
|
|
81
|
+
break;
|
|
82
|
+
case 'CustomerOnboarding':
|
|
83
|
+
updateActions.push((0, onboardingCustomerViewReducer_1.sendOnboardingOfficerOtpFailure)(zeniAPIStatus));
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
return (0, rxjs_1.from)(updateActions);
|
|
87
|
+
}));
|
|
88
|
+
return (0, rxjs_1.concat)((0, rxjs_1.from)(resendOtpActions), resendOtp$);
|
|
89
|
+
}));
|
|
90
|
+
exports.resendOtpEpic = resendOtpEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
+
import { sendOtp, sendOtpSuccess, sendOtpFailure } from './twoFactorAuthenticationReducer';
|
|
6
|
+
import { sendOtpSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp, sendOtpFailureSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
7
|
+
import { sendOtpVendorView, sendOtpVendorViewSuccess, sendOtpVendorViewFailure } from '../commonVendorView/vendorView/vendorViewReducer';
|
|
8
|
+
import { sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardingOfficerOtpFailure } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
9
|
+
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>;
|
|
10
|
+
export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|