@zeniai/client-epic-state 4.9.65 → 4.9.66
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/billPay/recurringBills/recurringBillsState.d.ts +2 -2
- package/lib/entity/chargeCard/chargeCard.d.ts +2 -2
- package/lib/epic.d.ts +1 -4
- package/lib/epic.js +1 -4
- package/lib/index.d.ts +11 -12
- package/lib/index.js +16 -28
- package/lib/view/commonVendorView/vendorView/epics/fetchVendorEpic.d.ts +2 -2
- package/lib/view/commonVendorView/vendorView/epics/fetchVendorEpic.js +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewReducer.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/vendorViewReducer.js +2 -5
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +28 -42
- package/lib/view/settingsView/settingsViewHelpers.d.ts +2 -4
- package/lib/view/settingsView/settingsViewHelpers.js +7 -18
- package/lib/view/settingsView/settingsViewPayload.d.ts +0 -10
- package/lib/view/settingsView/settingsViewReducer.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.js +44 -79
- package/lib/view/settingsView/settingsViewSelector.d.ts +8 -3
- package/lib/view/settingsView/settingsViewSelector.js +2 -18
- package/lib/view/settingsView/settingsViewState.d.ts +8 -31
- package/lib/view/settingsView/settingsViewState.js +9 -9
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +0 -12
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +1 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +1 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +2 -21
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +1 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +4 -4
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailPayload.d.ts +0 -15
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailPayload.js +0 -11
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.d.ts +1 -2
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +2 -33
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.d.ts +1 -2
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -2
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailState.d.ts +0 -13
- package/package.json +1 -1
- package/lib/view/settingsView/epic/fetchNotificationSettingsViewEpic.d.ts +0 -6
- package/lib/view/settingsView/epic/fetchNotificationSettingsViewEpic.js +0 -13
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchVendorAndUpdateBillLocalDataEpic.d.ts +0 -10
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchVendorAndUpdateBillLocalDataEpic.js +0 -130
- package/lib/view/spendManagement/zeniAccounts/transferDetail/fetchReviewTransferDetailEpic.d.ts +0 -7
- package/lib/view/spendManagement/zeniAccounts/transferDetail/fetchReviewTransferDetailEpic.js +0 -40
|
@@ -2,14 +2,9 @@ import { Amount } from '../../../../commonStateTypes/amount';
|
|
|
2
2
|
import { Balance } from '../../../../commonStateTypes/balance';
|
|
3
3
|
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
4
4
|
import { Logo } from '../../../../entity/paymentAccount/paymentAccountState';
|
|
5
|
-
import { ZeniDate } from '../../../../zeniDayJS';
|
|
6
5
|
import { AccountTypeSubConfigCodeKeyType } from '../../billPay/billPayConfig/billPayConfigState';
|
|
7
6
|
export interface TransferDetailState extends FetchStateAndError {
|
|
8
7
|
localData: TransferDetailLocalData;
|
|
9
|
-
reviewTransferDetail: ReviewTransferDetail;
|
|
10
|
-
}
|
|
11
|
-
export interface ReviewTransferDetail extends FetchStateAndError {
|
|
12
|
-
reviewTransferMoney: ReviewTransferMoney;
|
|
13
8
|
}
|
|
14
9
|
export interface TransferDetailLocalData {
|
|
15
10
|
amount: Amount;
|
|
@@ -24,11 +19,3 @@ export interface TransferMoneyParty {
|
|
|
24
19
|
accountBalance?: Balance;
|
|
25
20
|
logo?: Logo;
|
|
26
21
|
}
|
|
27
|
-
export interface ReviewTransferMoney {
|
|
28
|
-
isShowDailyAchLimitWarning: boolean;
|
|
29
|
-
dailyAchDebitLimit: Amount;
|
|
30
|
-
transferSchedules: TransferSchedule[];
|
|
31
|
-
}
|
|
32
|
-
export interface TransferSchedule extends Amount {
|
|
33
|
-
scheduleTime: ZeniDate;
|
|
34
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.66",
|
|
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",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { fetchClassList } from '../../classList/classListReducer';
|
|
4
|
-
import { fetchPeople } from '../../people/peopleReducer';
|
|
5
|
-
export declare type ActionType = ReturnType<typeof fetchPeople> | ReturnType<typeof fetchClassList>;
|
|
6
|
-
export declare const fetchNotificationSettingsViewEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchNotificationSettingsViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
7
|
-
const classListReducer_1 = require("../../classList/classListReducer");
|
|
8
|
-
const peopleReducer_1 = require("../../people/peopleReducer");
|
|
9
|
-
const fetchNotificationSettingsViewEpic = (actions$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchNotificationSettingsView.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
const actions = [(0, peopleReducer_1.fetchPeople)(), (0, classListReducer_1.fetchClassList)()];
|
|
11
|
-
return (0, rxjs_1.from)(actions);
|
|
12
|
-
}));
|
|
13
|
-
exports.fetchNotificationSettingsViewEpic = fetchNotificationSettingsViewEpic;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { updateBankAccounts } from '../../../../../entity/bankAccount/bankAccountReducer';
|
|
3
|
-
import { RootState } from '../../../../../reducer';
|
|
4
|
-
import { fetchVendorAndUpdateBillLocalData, saveBillUpdatesToLocalStore, waitForVendorByIdThenSaveBillUpdatetoLocalStore } from '../editBillViewReducer';
|
|
5
|
-
import { updateVendorsList, updateVendorListFailure } from '../../../../vendorList/vendorListReducer';
|
|
6
|
-
import { fetchVendor, indicateReadyToInitializeBillLocalStore } from '../../../../commonVendorView/vendorView/vendorViewReducer';
|
|
7
|
-
import { fetchPreviousBills } from '../../previousBills/previousBillsReducer';
|
|
8
|
-
export declare type ActionType = ReturnType<typeof waitForVendorByIdThenSaveBillUpdatetoLocalStore> | ReturnType<typeof fetchVendor> | ReturnType<typeof updateVendorListFailure> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchVendorAndUpdateBillLocalData> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateVendorsList> | ReturnType<typeof indicateReadyToInitializeBillLocalStore> | ReturnType<typeof fetchPreviousBills>;
|
|
9
|
-
export declare const fetchVendorAndUpdateBillLocalDataEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
|
|
10
|
-
export declare const waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
|
package/lib/view/spendManagement/billPay/editBillView/epics/fetchVendorAndUpdateBillLocalDataEpic.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic = exports.fetchVendorAndUpdateBillLocalDataEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const editBillViewReducer_1 = require("../editBillViewReducer");
|
|
7
|
-
const vendorSelector_1 = require("../../../../../entity/vendor/vendorSelector");
|
|
8
|
-
const billDetailViewState_1 = require("../../billDetailView/billDetailViewState");
|
|
9
|
-
const zeniDayJS_1 = require("../../../../../zeniDayJS");
|
|
10
|
-
const workingDayHelper_1 = require("../../../../../commonStateTypes/workingDayHelper");
|
|
11
|
-
const companySelector_1 = require("../../../../../entity/company/companySelector");
|
|
12
|
-
const accountSelector_1 = require("../../../../../entity/account/accountSelector");
|
|
13
|
-
const classSelector_1 = require("../../../../../entity/class/classSelector");
|
|
14
|
-
const editBillViewState_1 = require("../../../../spendManagement/billPay/editBillView/editBillViewState");
|
|
15
|
-
const vendorViewReducer_1 = require("../../../../commonVendorView/vendorView/vendorViewReducer");
|
|
16
|
-
const previousBillsReducer_1 = require("../../previousBills/previousBillsReducer");
|
|
17
|
-
const fetchVendorAndUpdateBillLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchVendorAndUpdateBillLocalData.match), (0, operators_1.mergeMap)((action) => {
|
|
18
|
-
const fetchActions = [];
|
|
19
|
-
const { vendorId } = action.payload;
|
|
20
|
-
const state = state$.value;
|
|
21
|
-
let billInLocalStore = state.editBillDetailViewState.newBillState;
|
|
22
|
-
if (action.payload.billId != null) {
|
|
23
|
-
const billDetailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
24
|
-
billInLocalStore =
|
|
25
|
-
state.editBillDetailViewState.editBillStateById[billDetailKey];
|
|
26
|
-
}
|
|
27
|
-
if (vendorId != null) {
|
|
28
|
-
const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, vendorId);
|
|
29
|
-
if (vendor != null) {
|
|
30
|
-
fetchActions.push((0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({
|
|
31
|
-
billDetailLocalData: prepareBillLocalData(state, billInLocalStore, vendor),
|
|
32
|
-
billId: action.payload.billId,
|
|
33
|
-
}));
|
|
34
|
-
fetchActions.push((0, previousBillsReducer_1.fetchPreviousBills)(vendor.qboId, false));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
fetchActions.push((0, vendorViewReducer_1.fetchVendor)(vendorId), (0, editBillViewReducer_1.waitForVendorByIdThenSaveBillUpdatetoLocalStore)(vendorId, action.payload.billId));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
// when tentative vendor is selected from the vendor dropdown, then vendor_id is undefined
|
|
42
|
-
fetchActions.push((0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({
|
|
43
|
-
billDetailLocalData: prepareBillLocalData(state, billInLocalStore),
|
|
44
|
-
billId: action.payload.billId,
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
return (0, rxjs_1.from)(fetchActions);
|
|
48
|
-
}));
|
|
49
|
-
exports.fetchVendorAndUpdateBillLocalDataEpic = fetchVendorAndUpdateBillLocalDataEpic;
|
|
50
|
-
const waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.waitForVendorByIdThenSaveBillUpdatetoLocalStore.match), (0, operators_1.switchMap)((action) => {
|
|
51
|
-
const { vendorId } = action.payload;
|
|
52
|
-
return actions$.pipe((0, operators_1.filter)((value) => vendorViewReducer_1.indicateReadyToInitializeBillLocalStore.match(value)), (0, operators_1.take)(1), // don't listen forever! IMPORTANT!
|
|
53
|
-
(0, operators_1.mergeMap)(() => {
|
|
54
|
-
const state = state$.value;
|
|
55
|
-
const fetchActions = [];
|
|
56
|
-
const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, vendorId);
|
|
57
|
-
let billInLocalStore = state.editBillDetailViewState.newBillState;
|
|
58
|
-
if (action.payload.billId != null) {
|
|
59
|
-
const billDetailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
60
|
-
billInLocalStore =
|
|
61
|
-
state.editBillDetailViewState.editBillStateById[billDetailKey];
|
|
62
|
-
}
|
|
63
|
-
if (vendor != null) {
|
|
64
|
-
fetchActions.push((0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({
|
|
65
|
-
billDetailLocalData: prepareBillLocalData(state, billInLocalStore, vendor),
|
|
66
|
-
billId: action.payload.billId,
|
|
67
|
-
}));
|
|
68
|
-
fetchActions.push((0, previousBillsReducer_1.fetchPreviousBills)(vendor.qboId, false));
|
|
69
|
-
}
|
|
70
|
-
return (0, rxjs_1.from)(fetchActions);
|
|
71
|
-
}));
|
|
72
|
-
}));
|
|
73
|
-
exports.waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic = waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic;
|
|
74
|
-
function prepareBillLocalData(state, billInLocalStore, vendor) {
|
|
75
|
-
var _a, _b, _c, _d;
|
|
76
|
-
const isCancelled = billInLocalStore.billDetailLocalData.isCancelled;
|
|
77
|
-
const lines = billInLocalStore.billDetailLocalData.updatesByLineId;
|
|
78
|
-
const updatedLines = Object.assign({}, lines);
|
|
79
|
-
const vendorCategory = (vendor === null || vendor === void 0 ? void 0 : vendor.accountId) != null
|
|
80
|
-
? (0, accountSelector_1.getAccountBase)(state.accountState, vendor.accountId, 'account_list')
|
|
81
|
-
: undefined;
|
|
82
|
-
const vendorClass = (vendor === null || vendor === void 0 ? void 0 : vendor.classId) != null
|
|
83
|
-
? (0, classSelector_1.getClassById)(state.classState, {
|
|
84
|
-
classId: vendor.classId,
|
|
85
|
-
reportId: 'class_list',
|
|
86
|
-
})
|
|
87
|
-
: undefined;
|
|
88
|
-
const vendorCurrencyCode = vendor === null || vendor === void 0 ? void 0 : vendor.vendorCurrencyCode;
|
|
89
|
-
const vendorCurrencySymbol = vendor === null || vendor === void 0 ? void 0 : vendor.vendorCurrencySymbol;
|
|
90
|
-
const { tenantState, companyState } = state;
|
|
91
|
-
const { currentTenantId } = tenantState;
|
|
92
|
-
const companyId = currentTenantId != null
|
|
93
|
-
? (_b = (_a = tenantState.tenantsById) === null || _a === void 0 ? void 0 : _a[currentTenantId]) === null || _b === void 0 ? void 0 : _b.companyId
|
|
94
|
-
: undefined;
|
|
95
|
-
const currentCompany = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId !== null && companyId !== void 0 ? companyId : '');
|
|
96
|
-
const payNowCutOffTime = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyBillPayInfo.payNowCutOffTimeByMethod.ach;
|
|
97
|
-
const isPayNowEnabled = payNowCutOffTime != null
|
|
98
|
-
? (0, zeniDayJS_1.dateNow)().isSameOrBefore(payNowCutOffTime)
|
|
99
|
-
: false;
|
|
100
|
-
Object.keys(updatedLines).forEach((lineId) => {
|
|
101
|
-
var _a, _b;
|
|
102
|
-
const line = lines[lineId];
|
|
103
|
-
updatedLines[lineId] = Object.assign(Object.assign({}, line), { account: Boolean((_a = line.account) === null || _a === void 0 ? void 0 : _a.accountId) === false && vendorCategory != null
|
|
104
|
-
? vendorCategory
|
|
105
|
-
: line.account, class: Boolean((_b = line.class) === null || _b === void 0 ? void 0 : _b.classId) === false && vendorClass != null
|
|
106
|
-
? vendorClass
|
|
107
|
-
: line.class });
|
|
108
|
-
});
|
|
109
|
-
//when it's a new bill and it doesn't have any line item, we want to default the account and class to vendor's account and class
|
|
110
|
-
if (Object.keys(updatedLines).length === 0) {
|
|
111
|
-
updatedLines['1'] = Object.assign({ account: vendorCategory, class: vendorClass, amount: {
|
|
112
|
-
amount: 0,
|
|
113
|
-
currencyCode: vendorCurrencyCode !== null && vendorCurrencyCode !== void 0 ? vendorCurrencyCode : 'USD',
|
|
114
|
-
currencySymbol: vendorCurrencySymbol !== null && vendorCurrencySymbol !== void 0 ? vendorCurrencySymbol : '$',
|
|
115
|
-
}, id: '1', lineDescription: '', platformLineDetailType: 'account_based_expense_line_detail', type: 'transaction_with_account_and_class_line', billable: 'not_billable', isCategoryMiscategorized: false, isClassMiscategorized: false }, editBillViewState_1.defaultRecommendationStateObj);
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
showVendorGptRecommendationText: false,
|
|
119
|
-
vendor: vendor,
|
|
120
|
-
isCancelled: isCancelled,
|
|
121
|
-
updatesByLineId: updatedLines,
|
|
122
|
-
whatForSection: Object.assign(Object.assign({}, billInLocalStore.billDetailLocalData.whatForSection), { currencyCode: vendor === null || vendor === void 0 ? void 0 : vendor.vendorCurrencyCode }),
|
|
123
|
-
paymentDetailsSection: Object.assign(Object.assign({}, billInLocalStore.billDetailLocalData.paymentDetailsSection), { paymentTo: undefined, internationalTransferFeeBearerPaymentMethod: vendor === null || vendor === void 0 ? void 0 : vendor.preferredInternationalTransferFeeBearerPaymentMethod, paymentDate: (_d = (_c = billInLocalStore.billDetailLocalData.paymentDetailsSection) === null || _c === void 0 ? void 0 : _c.paymentDate) !== null && _d !== void 0 ? _d :
|
|
124
|
-
//in case paymentDate is not present in the billDetailLocalData, then today/next working date will be considered.
|
|
125
|
-
//this is done beacuse we are doing similar calcualtion in getDefaultValues of editBillDetailPage.
|
|
126
|
-
(0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString()) }),
|
|
127
|
-
isCollectToAccountInfoFromVendorContact: false,
|
|
128
|
-
isRecurring: false,
|
|
129
|
-
};
|
|
130
|
-
}
|
package/lib/view/spendManagement/zeniAccounts/transferDetail/fetchReviewTransferDetailEpic.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { fetchReviewTransferDetail, updateReviewTransferDetail, updateReviewTransferDetailFailure } from './transferDetailReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof fetchReviewTransferDetail> | ReturnType<typeof updateReviewTransferDetail> | ReturnType<typeof updateReviewTransferDetailFailure>;
|
|
7
|
-
export declare const fetchReviewTransferDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/zeniAccounts/transferDetail/fetchReviewTransferDetailEpic.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchReviewTransferDetailEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const transferDetailReducer_1 = require("./transferDetailReducer");
|
|
8
|
-
const helpers_1 = require("../../helpers");
|
|
9
|
-
const fetchReviewTransferDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transferDetailReducer_1.fetchReviewTransferDetail.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11
|
-
const state = state$.value;
|
|
12
|
-
const localData = state.transferDetailState.localData;
|
|
13
|
-
const payload = {
|
|
14
|
-
from_account: {
|
|
15
|
-
account_id: (_a = localData.transferFrom) === null || _a === void 0 ? void 0 : _a.id,
|
|
16
|
-
account_type: (_c = (0, helpers_1.accountTypeSubConfigCodeToAccType)((_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType)) !== null && _c !== void 0 ? _c : '',
|
|
17
|
-
},
|
|
18
|
-
to_account: {
|
|
19
|
-
account_id: (_d = localData.transferTo) === null || _d === void 0 ? void 0 : _d.id,
|
|
20
|
-
account_type: (_f = (0, helpers_1.accountTypeSubConfigCodeToAccType)((_e = localData.transferTo) === null || _e === void 0 ? void 0 : _e.accType)) !== null && _f !== void 0 ? _f : '',
|
|
21
|
-
},
|
|
22
|
-
amount: localData.amount.amount,
|
|
23
|
-
currency_code: localData.amount.currencyCode,
|
|
24
|
-
currency_symbol: localData.amount.currencySymbol,
|
|
25
|
-
};
|
|
26
|
-
return zeniAPI
|
|
27
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/deposit-accounts/transfers/review`, payload)
|
|
28
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
30
|
-
return (0, rxjs_1.of)((0, transferDetailReducer_1.updateReviewTransferDetail)(response.data));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return (0, rxjs_1.of)((0, transferDetailReducer_1.updateReviewTransferDetailFailure)(response.status));
|
|
34
|
-
}
|
|
35
|
-
}), (0, operators_1.catchError)((error) => {
|
|
36
|
-
return (0, rxjs_1.of)((0, transferDetailReducer_1.updateReviewTransferDetailFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Review Transfer Detail REST API call errored out' +
|
|
37
|
-
JSON.stringify(error))));
|
|
38
|
-
}));
|
|
39
|
-
}));
|
|
40
|
-
exports.fetchReviewTransferDetailEpic = fetchReviewTransferDetailEpic;
|