@zeniai/client-epic-state 4.19.24-betaRR15 → 4.19.24-betaRR17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +5 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +13 -2
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +14 -4
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +6 -2
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +5 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +20 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/fetchDepositAccountListEpic.js +18 -4
- package/package.json +1 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { ID } from '../../../../commonStateTypes/common';
|
|
1
2
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
3
|
import { ChargeCardPaymentHistoryDownloadUIState, ChargeCardPaymentHistoryState, PaymentHistoryFilters, PaymentHistoryUIState } from './chargeCardPaymentHistory';
|
|
3
4
|
import { ChargeCardPaymentHistoryPayload } from './chargeCardPaymentHistoryPayload';
|
|
4
5
|
export declare const initialState: ChargeCardPaymentHistoryState;
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const addRepaymentToChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
cardRepaymentId: ID;
|
|
8
|
+
zeniCreditAccountId: ID;
|
|
9
|
+
}, "chargeCardPaymentHistory/addRepaymentToChargeCardPaymentHistory">, fetchChargeCardPaymentPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
6
10
|
cacheOverride: any;
|
|
7
11
|
}, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/fetchChargeCardPaymentHistory">, updateChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPaymentHistoryPayload, "chargeCardPaymentHistory/updateChargeCardPaymentHistory">, updateChargeCardPaymentHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardPaymentHistory/updateChargeCardPaymentHistoryFailure">, clearChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/clearChargeCardPaymentHistory">, updatePaymentHistoryFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
12
|
filters: PaymentHistoryFilters;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updatePaymentHistoryUIState = exports.updatePaymentHistoryDownloadUIState = exports.updatePaymentHistorySearchText = exports.updatePaymentHistoryFilters = exports.clearChargeCardPaymentHistory = exports.updateChargeCardPaymentHistoryFailure = exports.updateChargeCardPaymentHistory = exports.fetchChargeCardPaymentHistory = exports.fetchChargeCardPaymentPage = exports.initialState = void 0;
|
|
4
|
+
exports.updatePaymentHistoryUIState = exports.updatePaymentHistoryDownloadUIState = exports.updatePaymentHistorySearchText = exports.updatePaymentHistoryFilters = exports.clearChargeCardPaymentHistory = exports.updateChargeCardPaymentHistoryFailure = exports.updateChargeCardPaymentHistory = exports.fetchChargeCardPaymentHistory = exports.fetchChargeCardPaymentPage = exports.addRepaymentToChargeCardPaymentHistory = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const chargeCardPaymentHistory_1 = require("./chargeCardPaymentHistory");
|
|
7
7
|
exports.initialState = chargeCardPaymentHistory_1.initialChargeCardPaymentHistoryState;
|
|
@@ -40,6 +40,17 @@ const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
|
40
40
|
draft.fetchState = 'Error';
|
|
41
41
|
draft.error = action.payload;
|
|
42
42
|
},
|
|
43
|
+
addRepaymentToChargeCardPaymentHistory(draft, action) {
|
|
44
|
+
const { cardRepaymentId, zeniCreditAccountId } = action.payload;
|
|
45
|
+
if (draft.creditAccountId !== zeniCreditAccountId) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (draft.repaymentHistoryIds.includes(cardRepaymentId)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
draft.repaymentHistoryIds.unshift(cardRepaymentId);
|
|
52
|
+
draft.totalRepayments += 1;
|
|
53
|
+
},
|
|
43
54
|
clearChargeCardPaymentHistory(draft) {
|
|
44
55
|
Object.assign(draft, exports.initialState);
|
|
45
56
|
},
|
|
@@ -72,5 +83,5 @@ const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
|
72
83
|
},
|
|
73
84
|
},
|
|
74
85
|
});
|
|
75
|
-
_a = chargeCardPaymentHistory.actions, exports.fetchChargeCardPaymentPage = _a.fetchChargeCardPaymentPage, exports.fetchChargeCardPaymentHistory = _a.fetchChargeCardPaymentHistory, exports.updateChargeCardPaymentHistory = _a.updateChargeCardPaymentHistory, exports.updateChargeCardPaymentHistoryFailure = _a.updateChargeCardPaymentHistoryFailure, exports.clearChargeCardPaymentHistory = _a.clearChargeCardPaymentHistory, exports.updatePaymentHistoryFilters = _a.updatePaymentHistoryFilters, exports.updatePaymentHistorySearchText = _a.updatePaymentHistorySearchText, exports.updatePaymentHistoryDownloadUIState = _a.updatePaymentHistoryDownloadUIState, exports.updatePaymentHistoryUIState = _a.updatePaymentHistoryUIState;
|
|
86
|
+
_a = chargeCardPaymentHistory.actions, exports.addRepaymentToChargeCardPaymentHistory = _a.addRepaymentToChargeCardPaymentHistory, exports.fetchChargeCardPaymentPage = _a.fetchChargeCardPaymentPage, exports.fetchChargeCardPaymentHistory = _a.fetchChargeCardPaymentHistory, exports.updateChargeCardPaymentHistory = _a.updateChargeCardPaymentHistory, exports.updateChargeCardPaymentHistoryFailure = _a.updateChargeCardPaymentHistoryFailure, exports.clearChargeCardPaymentHistory = _a.clearChargeCardPaymentHistory, exports.updatePaymentHistoryFilters = _a.updatePaymentHistoryFilters, exports.updatePaymentHistorySearchText = _a.updatePaymentHistorySearchText, exports.updatePaymentHistoryDownloadUIState = _a.updatePaymentHistoryDownloadUIState, exports.updatePaymentHistoryUIState = _a.updatePaymentHistoryUIState;
|
|
76
87
|
exports.default = chargeCardPaymentHistory.reducer;
|
|
@@ -6,16 +6,26 @@ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
|
6
6
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
7
7
|
const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
8
8
|
const getChargeCardRepaymentDetail = (state) => {
|
|
9
|
+
var _a, _b;
|
|
9
10
|
const { chargeCardRepaymentDetailState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, } = state;
|
|
10
11
|
const { localData, fetchState, error } = chargeCardRepaymentDetailState;
|
|
11
12
|
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
12
13
|
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
13
14
|
let transferFromAccounts = [];
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
if (paymentAccountsView.fetchState === 'Completed') {
|
|
16
|
+
if (depositAccountsView.fetchState === 'Completed') {
|
|
17
|
+
transferFromAccounts = (0, setupViewSelector_1.getAllFundingAccounts)(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const depositFundingFromLimit = Object.values((_a = depositAccountState.depositAccountLimitForChargeCardByID) !== null && _a !== void 0 ? _a : {}).map(setupViewSelector_1.mapDepositAccountWithLimitToFundingAccount);
|
|
21
|
+
const paymentFundingAccounts = (0, setupViewSelector_1.getAllFundingAccounts)([], paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
22
|
+
transferFromAccounts = [...depositFundingFromLimit, ...paymentFundingAccounts];
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
|
-
|
|
25
|
+
// #region agent log
|
|
26
|
+
fetch('http://127.0.0.1:7242/ingest/3d86d94d-63fc-405c-92bd-d68a0fc3a8c8', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '88d521' }, body: JSON.stringify({ sessionId: '88d521', location: 'chargeCardRepaymentDetailSelector.ts:selector', message: 'transferFromAccounts data flow', data: { depositFetchState: depositAccountsView.fetchState, paymentFetchState: paymentAccountsView.fetchState, depositAccountsCount: depositAccountsView.depositAccounts.length, paymentAccountsCount: paymentAccountsView.paymentAccounts.length, transferFromAccountsCount: transferFromAccounts.length, enteredIfBlock: paymentAccountsView.fetchState === 'Completed', accountIdsLength: (_b = depositAccountListState.accountIds) === null || _b === void 0 ? void 0 : _b.length, depositAccTypes: transferFromAccounts.map(a => a.accType) }, timestamp: Date.now(), hypothesisId: 'H1', runId: 'post-fix' }) }).catch(() => { });
|
|
27
|
+
// #endregion
|
|
28
|
+
const reducedFetchState = (0, reduceFetchState_1.reduceAnyCompletedFetchState)([
|
|
19
29
|
depositAccountsView,
|
|
20
30
|
paymentAccountsView,
|
|
21
31
|
...Object.values(paymentAccountListState.paymentAccountBalanceFetchStatus),
|
|
@@ -7,13 +7,17 @@ const depositAccountListReducer_1 = require("../../zeniAccounts/depositAccountLi
|
|
|
7
7
|
const paymentAccountListReducer_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
8
8
|
const chargeCardRepaymentDetailReducer_1 = require("./chargeCardRepaymentDetailReducer");
|
|
9
9
|
const fetchChargeCardRepaymentDetailEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(chargeCardRepaymentDetailReducer_1.fetchChargeCardRepaymentDetail.match), (0, operators_1.mergeMap)(() => {
|
|
10
|
+
var _a;
|
|
10
11
|
const fetchChargeCardRepaymentDetailActions = [];
|
|
11
12
|
const state = state$.value;
|
|
12
13
|
const depositAccounts = state.depositAccountListState;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const willFetchDeposit = depositAccounts.fetchState !== 'In-Progress' && depositAccounts.fetchState !== 'Completed';
|
|
15
|
+
if (willFetchDeposit) {
|
|
15
16
|
fetchChargeCardRepaymentDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
16
17
|
}
|
|
18
|
+
// #region agent log
|
|
19
|
+
fetch('http://127.0.0.1:7242/ingest/3d86d94d-63fc-405c-92bd-d68a0fc3a8c8', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '88d521' }, body: JSON.stringify({ sessionId: '88d521', location: 'fetchChargeCardRepaymentDetailEpic.ts:epic', message: 'fetchChargeCardRepaymentDetailEpic dispatch', data: { depositListFetchState: depositAccounts.fetchState, willFetchDeposit, accountIdsLength: (_a = depositAccounts.accountIds) === null || _a === void 0 ? void 0 : _a.length }, timestamp: Date.now(), hypothesisId: 'H3' }) }).catch(() => { });
|
|
20
|
+
// #endregion
|
|
17
21
|
const paymentAccounts = state.paymentAccountListState;
|
|
18
22
|
if (paymentAccounts.fetchState !== 'In-Progress' &&
|
|
19
23
|
paymentAccounts.fetchState !== 'Completed') {
|
|
@@ -4,7 +4,8 @@ import { updateChargeCardRepayment } from '../../../../entity/chargeCardRepaymen
|
|
|
4
4
|
import { updateCompanyPrimaryAccount, updateEnableAutoPayForChargeCard } from '../../../../entity/company/companyReducer';
|
|
5
5
|
import { RootState } from '../../../../reducer';
|
|
6
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
+
import { addRepaymentToChargeCardPaymentHistory } from '../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer';
|
|
7
8
|
import { updateCreditAccountRepaymentAmountAndDate } from '../chargeCardList/chargeCardListReducer';
|
|
8
9
|
import { initiateChargeCardRepayment, updateChargeCardRepaymentStatus } from './chargeCardRepaymentDetailReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof initiateChargeCardRepayment> | ReturnType<typeof updateChargeCardRepayment> | ReturnType<typeof updateCreditAccountRepaymentAmountAndDate> | ReturnType<typeof updateChargeCardRepaymentStatus> | ReturnType<typeof updateCompanyPrimaryAccount> | ReturnType<typeof updateEnableAutoPayForChargeCard>;
|
|
10
|
+
export type ActionType = ReturnType<typeof addRepaymentToChargeCardPaymentHistory> | ReturnType<typeof initiateChargeCardRepayment> | ReturnType<typeof updateChargeCardRepayment> | ReturnType<typeof updateCreditAccountRepaymentAmountAndDate> | ReturnType<typeof updateChargeCardRepaymentStatus> | ReturnType<typeof updateCompanyPrimaryAccount> | ReturnType<typeof updateEnableAutoPayForChargeCard>;
|
|
10
11
|
export declare const initiateChargeCardRepaymentEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -12,6 +12,7 @@ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
|
12
12
|
const helpers_1 = require("../../helpers");
|
|
13
13
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
14
14
|
const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
15
|
+
const chargeCardPaymentHistoryReducer_1 = require("../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer");
|
|
15
16
|
const chargeCardListReducer_1 = require("../chargeCardList/chargeCardListReducer");
|
|
16
17
|
const chargeCardRepaymentDetailReducer_1 = require("./chargeCardRepaymentDetailReducer");
|
|
17
18
|
const initiateChargeCardRepaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardRepaymentDetailReducer_1.initiateChargeCardRepayment.match), (0, operators_1.switchMap)((action) => {
|
|
@@ -40,6 +41,10 @@ const initiateChargeCardRepaymentEpic = (actions$, state$, zeniAPI) => actions$.
|
|
|
40
41
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
41
42
|
const actions = [
|
|
42
43
|
(0, chargeCardRepaymentReducer_1.updateChargeCardRepayment)(response.data.card_repayment),
|
|
44
|
+
(0, chargeCardPaymentHistoryReducer_1.addRepaymentToChargeCardPaymentHistory)({
|
|
45
|
+
cardRepaymentId: response.data.card_repayment.card_repayment_id,
|
|
46
|
+
zeniCreditAccountId: response.data.card_repayment.zeni_credit_account_id,
|
|
47
|
+
}),
|
|
43
48
|
(0, chargeCardListReducer_1.updateCreditAccountRepaymentAmountAndDate)({
|
|
44
49
|
amount: (0, amount_1.toAmount)(response.data.card_repayment.amount, response.data.card_repayment.currency_code, response.data.card_repayment.currency_symbol),
|
|
45
50
|
date: (0, zeniDayJS_1.date)(response.data.card_repayment.repayment_date),
|
|
@@ -5,7 +5,7 @@ import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { CompanyBillPayInfo } from '../../../entity/company/companyStateTypes';
|
|
7
7
|
import { Country } from '../../../entity/countryList/countryListState';
|
|
8
|
-
import { DepositAccount } from '../../../entity/depositAccount/depositAccount';
|
|
8
|
+
import { DepositAccount, DepositAccountWithLimit } from '../../../entity/depositAccount/depositAccount';
|
|
9
9
|
import { File } from '../../../entity/file/fileState';
|
|
10
10
|
import { InstitutionDetails, Logo, PaymentAccount } from '../../../entity/paymentAccount/paymentAccountState';
|
|
11
11
|
import { RootState } from '../../../reducer';
|
|
@@ -94,5 +94,6 @@ export declare function getBusinessVerificationDetails(state: RootState, company
|
|
|
94
94
|
export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
|
|
95
95
|
export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[], paymentAccountBalanceFetchStatus: Record<ID, FetchStateAndError>, includeOnlyVerifiedAccounts?: boolean) => FundingAccount[];
|
|
96
96
|
export declare const mapDepositAccToFundingAccount: (depositAcc: DepositAccount) => FundingAccount;
|
|
97
|
+
export declare const mapDepositAccountWithLimitToFundingAccount: (depositAcc: DepositAccountWithLimit) => FundingAccount;
|
|
97
98
|
export declare const mapPaymentAccToFundingAccount: (paymentAcc: PaymentAccount, paymentAccountBalanceFetchStatus: Record<ID, FetchStateAndError>) => FundingAccount;
|
|
98
99
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapPaymentAccToFundingAccount = exports.mapDepositAccToFundingAccount = exports.getAllFundingAccounts = exports.getCompanyAndIdentityDetails = void 0;
|
|
3
|
+
exports.mapPaymentAccToFundingAccount = exports.mapDepositAccountWithLimitToFundingAccount = exports.mapDepositAccToFundingAccount = exports.getAllFundingAccounts = exports.getCompanyAndIdentityDetails = void 0;
|
|
4
4
|
exports.getCommonSetupViewDetails = getCommonSetupViewDetails;
|
|
5
5
|
exports.getBusinessVerificationDetails = getBusinessVerificationDetails;
|
|
6
6
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
@@ -224,6 +224,25 @@ const mapDepositAccToFundingAccount = (depositAcc) => ({
|
|
|
224
224
|
accountLast4: depositAcc.accountLast4,
|
|
225
225
|
});
|
|
226
226
|
exports.mapDepositAccToFundingAccount = mapDepositAccToFundingAccount;
|
|
227
|
+
const mapDepositAccountWithLimitToFundingAccount = (depositAcc) => {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
return ({
|
|
230
|
+
id: depositAcc.id,
|
|
231
|
+
accType: 'depositAccount',
|
|
232
|
+
label: depositAcc.accountName,
|
|
233
|
+
maskedAccountNumber: depositAcc.maskedAccountNumber,
|
|
234
|
+
accountBalance: depositAcc.accountBalance,
|
|
235
|
+
logo: undefined,
|
|
236
|
+
zeniAccountId: depositAcc.zeniAccountId,
|
|
237
|
+
balanceFetchStatus: {
|
|
238
|
+
fetchState: 'Completed',
|
|
239
|
+
error: undefined,
|
|
240
|
+
},
|
|
241
|
+
createTime: depositAcc.createTime,
|
|
242
|
+
accountLast4: (_b = (_a = depositAcc.maskedAccountNumber.match(/(\d{4})$/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : undefined,
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
exports.mapDepositAccountWithLimitToFundingAccount = mapDepositAccountWithLimitToFundingAccount;
|
|
227
246
|
const mapPaymentAccToFundingAccount = (paymentAcc, paymentAccountBalanceFetchStatus) => {
|
|
228
247
|
var _a, _b;
|
|
229
248
|
return ({
|
package/lib/view/spendManagement/zeniAccounts/depositAccountList/fetchDepositAccountListEpic.js
CHANGED
|
@@ -12,11 +12,21 @@ const fetchDepositAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pip
|
|
|
12
12
|
.getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts?query=${encodeURIComponent(`{"is_include_deposit_accounts_summary":true}`)}`)
|
|
13
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
14
|
var _a, _b, _c, _d, _e;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const hasData = (response === null || response === void 0 ? void 0 : response.data) != null;
|
|
16
|
+
const statusCode = (_a = response === null || response === void 0 ? void 0 : response.status) === null || _a === void 0 ? void 0 : _a.code;
|
|
17
|
+
const isSuccess = (0, responsePayload_1.isSuccessResponse)(response);
|
|
18
|
+
// #region agent log
|
|
19
|
+
const respData = response === null || response === void 0 ? void 0 : response.data;
|
|
20
|
+
const dataKeys = respData != null ? Object.keys(respData) : [];
|
|
21
|
+
const topLevelKeys = response != null ? Object.keys(response) : [];
|
|
22
|
+
fetch('http://127.0.0.1:7242/ingest/3d86d94d-63fc-405c-92bd-d68a0fc3a8c8', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '88d521' }, body: JSON.stringify({ sessionId: '88d521', location: 'fetchDepositAccountListEpic.ts:mergeMap', message: 'deposit-accounts response inspection', data: { isSuccess, hasData, statusCode, topLevelKeys, dataKeys, depositAccountsCount: (_b = respData === null || respData === void 0 ? void 0 : respData.deposit_accounts) === null || _b === void 0 ? void 0 : _b.length }, timestamp: Date.now(), hypothesisId: 'response-structure' }) }).catch(() => { });
|
|
23
|
+
// #endregion
|
|
24
|
+
if (isSuccess) {
|
|
25
|
+
const depositAccounts = (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.deposit_accounts) !== null && _d !== void 0 ? _d : [];
|
|
26
|
+
return (0, rxjs_1.of)((0, depositAccountReducer_1.updateDepositAccounts)(depositAccounts), (0, zeniAccountListReducer_1.updateZeniAccountsSummary)({
|
|
27
|
+
summaryPayload: (_e = response.data) === null || _e === void 0 ? void 0 : _e.all_deposit_accounts_summary,
|
|
18
28
|
}), (0, depositAccountListReducer_1.updateDepositAccountList)({
|
|
19
|
-
data:
|
|
29
|
+
data: depositAccounts,
|
|
20
30
|
updateType: 'replace',
|
|
21
31
|
}));
|
|
22
32
|
}
|
|
@@ -27,6 +37,10 @@ const fetchDepositAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pip
|
|
|
27
37
|
}));
|
|
28
38
|
}
|
|
29
39
|
}), (0, operators_1.catchError)((error) => {
|
|
40
|
+
var _a;
|
|
41
|
+
// #region agent log
|
|
42
|
+
fetch('http://127.0.0.1:7242/ingest/3d86d94d-63fc-405c-92bd-d68a0fc3a8c8', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '88d521' }, body: JSON.stringify({ sessionId: '88d521', location: 'fetchDepositAccountListEpic.ts:catchError', message: 'deposit-accounts API catchError', data: { errorMsg: String(error === null || error === void 0 ? void 0 : error.message), errorName: error === null || error === void 0 ? void 0 : error.name, errorStack: (_a = error === null || error === void 0 ? void 0 : error.stack) === null || _a === void 0 ? void 0 : _a.slice(0, 200) }, timestamp: Date.now(), hypothesisId: 'catchError' }) }).catch(() => { });
|
|
43
|
+
// #endregion
|
|
30
44
|
return (0, rxjs_1.of)((0, depositAccountListReducer_1.updateDepositAccountListFetchStatus)({
|
|
31
45
|
fetchState: 'Error',
|
|
32
46
|
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch deposit Accounts REST API call errored out' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.24-
|
|
3
|
+
"version": "4.19.24-betaRR17",
|
|
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",
|