@zeniai/client-epic-state 4.7.67 → 4.7.69
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/paymentAccount/paymentAccountPayload.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountPayload.js +1 -2
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -2
- package/lib/entity/paymentAccount/paymentAccountSelector.js +1 -14
- package/lib/entity/paymentAccount/paymentAccountState.d.ts +0 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +2 -10
- package/lib/index.js +13 -26
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/accountList/fetchAccountListEpic.js +7 -16
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +2 -2
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +4 -2
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +4 -4
- package/lib/view/spendManagement/billPay/billList/fetchBillListEpic.js +3 -3
- package/lib/view/spendManagement/billPay/billList/fetchBillListPerTabEpic.js +2 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +4 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +4 -4
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js +3 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +3 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +4 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.js +10 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +3 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRemiAndInitializeLocalStoreEpic.js +3 -3
- package/lib/view/spendManagement/reimbursement/remiDetailView/epics/fetchRemiDetailEpic.js +2 -2
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewReducer.js +2 -1
- package/lib/view/spendManagement/reimbursement/remiListView/fetchRemiListEpic.js +3 -3
- package/lib/view/spendManagement/reimbursement/remiListView/fetchRemiListPerTabEpic.js +4 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +4 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +4 -4
- package/package.json +1 -1
- package/lib/view/settingsView/epic/fetchBankAccountsListEpic.d.ts +0 -22
- package/lib/view/settingsView/epic/fetchBankAccountsListEpic.js +0 -30
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +0 -6
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +0 -14
- package/lib/view/settingsView/epic/fetchMyProfileEpic.d.ts +0 -43
- package/lib/view/settingsView/epic/fetchMyProfileEpic.js +0 -50
- package/lib/view/settingsView/epic/fetchMyProfileViewEpic.d.ts +0 -7
- package/lib/view/settingsView/epic/fetchMyProfileViewEpic.js +0 -17
- package/lib/view/settingsView/settingsViewPayload.d.ts +0 -8
- package/lib/view/settingsView/settingsViewPayload.js +0 -2
- package/lib/view/settingsView/settingsViewReducer.d.ts +0 -13
- package/lib/view/settingsView/settingsViewReducer.js +0 -71
- package/lib/view/settingsView/settingsViewSelector.d.ts +0 -14
- package/lib/view/settingsView/settingsViewSelector.js +0 -119
- package/lib/view/settingsView/settingsViewState.d.ts +0 -12
- package/lib/view/settingsView/settingsViewState.js +0 -2
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +0 -29
- package/lib/view/settingsView/types/settingsViewSelectorTypes.js +0 -2
|
@@ -6,34 +6,25 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const responsePayload_1 = require("../../responsePayload");
|
|
7
7
|
const accountReducer_1 = require("../../entity/account/accountReducer");
|
|
8
8
|
const accountListReducer_1 = require("./accountListReducer");
|
|
9
|
-
const getAccountTypes = (isLimitedCategoryEnabled) => {
|
|
10
|
-
if (isLimitedCategoryEnabled === true) {
|
|
11
|
-
return ['cogs', 'expenses', 'other_expense'];
|
|
12
|
-
}
|
|
13
|
-
return [];
|
|
14
|
-
};
|
|
15
9
|
const fetchAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(accountListReducer_1.fetchAccountList.match), (0, operators_1.switchMap)((action) => {
|
|
16
10
|
const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, } = action.payload;
|
|
17
|
-
const accountTypes = getAccountTypes(isLimitedCategoryEnabled);
|
|
18
11
|
const queryValue = {
|
|
19
12
|
is_full: fetchFullResponse,
|
|
20
13
|
is_exclude_account_payable_accounts: excludeAccountPayableAccounts,
|
|
21
14
|
is_exclude_account_receivable_accounts: excludeAccountReceivableAccounts,
|
|
22
|
-
account_types:
|
|
15
|
+
account_types: isLimitedCategoryEnabled === true
|
|
16
|
+
? ['cogs', 'expenses', 'other_expense']
|
|
17
|
+
: [],
|
|
23
18
|
};
|
|
24
19
|
return zeniAPI
|
|
25
20
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
26
21
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
27
22
|
var _a, _b;
|
|
28
23
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
accountListResponse: response,
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
36
|
-
return (0, rxjs_1.from)(actions);
|
|
24
|
+
return (0, rxjs_1.of)((0, accountReducer_1.updateAccounts)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.accounts) !== null && _b !== void 0 ? _b : [], 'account_list'), (0, accountListReducer_1.updateAccountList)({
|
|
25
|
+
accountListKey,
|
|
26
|
+
accountListResponse: response,
|
|
27
|
+
}));
|
|
37
28
|
}
|
|
38
29
|
else {
|
|
39
30
|
return (0, rxjs_1.of)((0, accountListReducer_1.updateAccountListFailure)({
|
|
@@ -3,9 +3,10 @@ import { BillDetailViewState, BillApprovalType } from './billDetailViewState';
|
|
|
3
3
|
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
4
4
|
import { BillDetailViewPayload } from './billDetailViewPayload';
|
|
5
5
|
export declare const initialState: BillDetailViewState;
|
|
6
|
-
export declare const fetchBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride
|
|
6
|
+
export declare const fetchBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride: any, isShowDeletedBillsEnabled: boolean], {
|
|
7
7
|
billId: string;
|
|
8
8
|
cacheOverride: any;
|
|
9
|
+
isShowDeletedBillsEnabled: boolean;
|
|
9
10
|
}, string, never, never>, updateBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
11
|
billId: ID;
|
|
11
12
|
billDetail: BillDetailViewPayload;
|
|
@@ -25,11 +25,12 @@ const billDetailView = (0, toolkit_1.createSlice)({
|
|
|
25
25
|
draft.billDetailById[key] = Object.assign({}, billDetailViewState_1.initialBillDetailView);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
prepare(billId, cacheOverride = false) {
|
|
28
|
+
prepare(billId, cacheOverride = false, isShowDeletedBillsEnabled) {
|
|
29
29
|
return {
|
|
30
30
|
payload: {
|
|
31
31
|
billId,
|
|
32
32
|
cacheOverride,
|
|
33
|
+
isShowDeletedBillsEnabled,
|
|
33
34
|
},
|
|
34
35
|
};
|
|
35
36
|
},
|
|
@@ -29,7 +29,7 @@ const billPayReviewReducer_1 = require("../../billPayReview/billPayReviewReducer
|
|
|
29
29
|
const paymentInstrumentReducer_1 = require("../../../../../entity/paymentInstrument/paymentInstrumentReducer");
|
|
30
30
|
const recurringBillsReducer_1 = require("../../../../../entity/billPay/recurringBills/recurringBillsReducer");
|
|
31
31
|
const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.fetchBillDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
32
|
-
const { billId, cacheOverride } = action.payload;
|
|
32
|
+
const { billId, cacheOverride, isShowDeletedBillsEnabled } = action.payload;
|
|
33
33
|
const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
34
34
|
const billActions = [];
|
|
35
35
|
const state = state$.value;
|
|
@@ -49,7 +49,7 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
49
49
|
is_include_payment_accounts_info: true,
|
|
50
50
|
is_include_approval_info: true,
|
|
51
51
|
is_include_vendor_info: true,
|
|
52
|
-
is_include_deleted:
|
|
52
|
+
is_include_deleted: isShowDeletedBillsEnabled,
|
|
53
53
|
};
|
|
54
54
|
const getTransactionDetail$ = zeniAPI
|
|
55
55
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bills/transactions/${billId}?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
@@ -4,12 +4,14 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
4
4
|
import { BillListPayload } from './billListPayload';
|
|
5
5
|
import { BillListState, BillTab, SaveBillStageCode, BillListUIState, BillPayFilters, BillListDownloadUIState } from './billListState';
|
|
6
6
|
export declare const initialState: BillListState;
|
|
7
|
-
export declare const fetchBillList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride
|
|
7
|
+
export declare const fetchBillList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedBillsEnabled: boolean], {
|
|
8
8
|
period: TimePeriod;
|
|
9
9
|
cacheOverride: any;
|
|
10
|
-
|
|
10
|
+
isShowDeletedBillsEnabled: boolean;
|
|
11
|
+
}, string, never, never>, fetchBillListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedBillsEnabled: boolean], {
|
|
11
12
|
period: TimePeriod;
|
|
12
13
|
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
14
|
+
isShowDeletedBillsEnabled: boolean;
|
|
13
15
|
}, string, never, never>, updateBillListByStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
16
|
billList: BillListPayload;
|
|
15
17
|
tab: BillTab;
|
|
@@ -33,9 +33,9 @@ const billList = (0, toolkit_1.createSlice)({
|
|
|
33
33
|
_action) {
|
|
34
34
|
//do nothing
|
|
35
35
|
},
|
|
36
|
-
prepare(period, tab) {
|
|
36
|
+
prepare(period, tab, isShowDeletedBillsEnabled) {
|
|
37
37
|
return {
|
|
38
|
-
payload: { period, tab },
|
|
38
|
+
payload: { period, tab, isShowDeletedBillsEnabled },
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
41
|
},
|
|
@@ -62,9 +62,9 @@ const billList = (0, toolkit_1.createSlice)({
|
|
|
62
62
|
: 'In-Progress', error: undefined });
|
|
63
63
|
});
|
|
64
64
|
},
|
|
65
|
-
prepare(period, cacheOverride = false) {
|
|
65
|
+
prepare(period, cacheOverride = false, isShowDeletedBillsEnabled) {
|
|
66
66
|
return {
|
|
67
|
-
payload: { period, cacheOverride },
|
|
67
|
+
payload: { period, cacheOverride, isShowDeletedBillsEnabled },
|
|
68
68
|
};
|
|
69
69
|
},
|
|
70
70
|
},
|
|
@@ -19,10 +19,10 @@ const fetchBillListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
|
|
|
19
19
|
'paid',
|
|
20
20
|
];
|
|
21
21
|
const state = state$.value;
|
|
22
|
-
const { period, cacheOverride } = action.payload;
|
|
22
|
+
const { period, cacheOverride, isShowDeletedBillsEnabled } = action.payload;
|
|
23
23
|
if (cacheOverride === true) {
|
|
24
24
|
fetchBillListActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
25
|
-
tabIds.forEach((tab) => fetchBillListActions.push((0, billListReducer_1.fetchBillListPerTab)(period, tab)));
|
|
25
|
+
tabIds.forEach((tab) => fetchBillListActions.push((0, billListReducer_1.fetchBillListPerTab)(period, tab, isShowDeletedBillsEnabled)));
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
if (state.billPayConfigState.fetchState !== 'Completed' &&
|
|
@@ -33,7 +33,7 @@ const fetchBillListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
|
|
|
33
33
|
const key = (0, billListState_1.getBillListKey)(period, tab);
|
|
34
34
|
const bills = (0, get_1.default)(state.billListState.byBillListKey, key, undefined);
|
|
35
35
|
if (bills == null || bills.hasValidState() === false) {
|
|
36
|
-
fetchBillListActions.push((0, billListReducer_1.fetchBillListPerTab)(period, tab));
|
|
36
|
+
fetchBillListActions.push((0, billListReducer_1.fetchBillListPerTab)(period, tab, isShowDeletedBillsEnabled));
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -11,7 +11,7 @@ const entityApprovalStatusReducer_1 = require("../../../../entity/entityApproval
|
|
|
11
11
|
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
12
12
|
const recurringBillsReducer_1 = require("../../../../entity/billPay/recurringBills/recurringBillsReducer");
|
|
13
13
|
const fetchBillListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billListReducer_1.fetchBillListPerTab.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
-
const { period, tab } = action.payload;
|
|
14
|
+
const { period, tab, isShowDeletedBillsEnabled } = action.payload;
|
|
15
15
|
const queryParam = {
|
|
16
16
|
start_date: (0, timePeriod_1.toString)(period.start),
|
|
17
17
|
end_date: (0, timePeriod_1.toString)(period.end),
|
|
@@ -22,7 +22,7 @@ const fetchBillListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0
|
|
|
22
22
|
bill_stage_code: tab,
|
|
23
23
|
is_include_pending_approval_transaction_ids_for_user: tab === 'pending_approval',
|
|
24
24
|
is_include_approval_info: tab === 'pending_approval',
|
|
25
|
-
is_include_deleted: tab !== 'draft',
|
|
25
|
+
is_include_deleted: isShowDeletedBillsEnabled ? tab !== 'draft' : false,
|
|
26
26
|
};
|
|
27
27
|
return zeniAPI
|
|
28
28
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bills/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -5,12 +5,14 @@ import { InvoiceProcessingPayload } from './editBillViewPayload';
|
|
|
5
5
|
import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
|
|
6
6
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
7
7
|
export declare const initialState: EditBillDetailViewState;
|
|
8
|
-
export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, billId?: string | undefined], {
|
|
8
|
+
export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isShowDeletedBillsEnabled: boolean, billId?: string | undefined], {
|
|
9
9
|
cacheOverride: boolean;
|
|
10
|
+
isShowDeletedBillsEnabled: boolean;
|
|
10
11
|
billId: string | undefined;
|
|
11
|
-
}, string, never, never>, fetchBillAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride: boolean], {
|
|
12
|
+
}, string, never, never>, fetchBillAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride: boolean, isShowDeletedBillsEnabled: boolean], {
|
|
12
13
|
billId: string;
|
|
13
14
|
cacheOverride: boolean;
|
|
15
|
+
isShowDeletedBillsEnabled: boolean;
|
|
14
16
|
}, string, never, never>, fetchVendorByNameAndParseInvoice: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[invoiceProcessingPayload: InvoiceProcessingPayload, isVendorRecommendationFeatureEnabled: boolean], {
|
|
15
17
|
invoiceProcessingPayload: InvoiceProcessingPayload;
|
|
16
18
|
isVendorRecommendationFeatureEnabled: boolean;
|
|
@@ -23,8 +23,8 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
23
23
|
reducer() {
|
|
24
24
|
//do nothing
|
|
25
25
|
},
|
|
26
|
-
prepare(cacheOverride, billId) {
|
|
27
|
-
return { payload: { cacheOverride, billId } };
|
|
26
|
+
prepare(cacheOverride, isShowDeletedBillsEnabled, billId) {
|
|
27
|
+
return { payload: { cacheOverride, isShowDeletedBillsEnabled, billId } };
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
fetchBillAndInitializeLocalStore: {
|
|
@@ -38,8 +38,8 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
38
38
|
error: undefined,
|
|
39
39
|
}, showSkipAutofill: false });
|
|
40
40
|
},
|
|
41
|
-
prepare(billId, cacheOverride) {
|
|
42
|
-
return { payload: { billId, cacheOverride } };
|
|
41
|
+
prepare(billId, cacheOverride, isShowDeletedBillsEnabled) {
|
|
42
|
+
return { payload: { billId, cacheOverride, isShowDeletedBillsEnabled } };
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
fetchVendorByNameAndParseInvoice: {
|
package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js
CHANGED
|
@@ -13,11 +13,11 @@ const editBillViewReducer_1 = require("../editBillViewReducer");
|
|
|
13
13
|
const fetchBillAndInitializeLocalStoreEpic = (actions$,
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
15
|
state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchBillAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
16
|
-
const { billId, cacheOverride } = action.payload;
|
|
16
|
+
const { billId, cacheOverride, isShowDeletedBillsEnabled } = action.payload;
|
|
17
17
|
const state = state$.value;
|
|
18
18
|
const billDetailActions = [];
|
|
19
19
|
if (cacheOverride == true) {
|
|
20
|
-
billDetailActions.push((0, billDetailViewReducer_1.fetchBillDetail)(billId, true));
|
|
20
|
+
billDetailActions.push((0, billDetailViewReducer_1.fetchBillDetail)(billId, true, isShowDeletedBillsEnabled));
|
|
21
21
|
billDetailActions.push(
|
|
22
22
|
//https://stackoverflow.com/questions/42276419/invoking-epics-from-within-other-epics
|
|
23
23
|
(0, editBillViewReducer_1.waitForBillDetailThenInitializeLocalStore)(billId));
|
|
@@ -32,7 +32,7 @@ state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchBill
|
|
|
32
32
|
(billDetail === null || billDetail === void 0 ? void 0 : billDetail.vendorId) == null // for https://app.clickup.com/t/10555925/POD2-3084
|
|
33
33
|
) {
|
|
34
34
|
actionCount++;
|
|
35
|
-
billDetailActions.push((0, billDetailViewReducer_1.fetchBillDetail)(billId, false));
|
|
35
|
+
billDetailActions.push((0, billDetailViewReducer_1.fetchBillDetail)(billId, false, isShowDeletedBillsEnabled));
|
|
36
36
|
}
|
|
37
37
|
if (actionCount == 0) {
|
|
38
38
|
billDetailActions.push((0, editBillViewReducer_1.initializeBillToLocalStore)(billId));
|
|
@@ -12,7 +12,7 @@ const ownerListReducer_1 = require("../../../../ownerList/ownerListReducer");
|
|
|
12
12
|
const vendorTypeListReducer_1 = require("../../../../vendorTypeList/vendorTypeListReducer");
|
|
13
13
|
const billPayConfigReducer_1 = require("../../billPayConfig/billPayConfigReducer");
|
|
14
14
|
const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchEditBillDetailPage.match), (0, operators_1.mergeMap)((action) => {
|
|
15
|
-
const { cacheOverride, billId } = action.payload;
|
|
15
|
+
const { cacheOverride, billId, isShowDeletedBillsEnabled } = action.payload;
|
|
16
16
|
const billDetailActions = [];
|
|
17
17
|
const state = state$.value;
|
|
18
18
|
if (cacheOverride == true) {
|
|
@@ -22,7 +22,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
22
22
|
billDetailActions.push((0, ownerListReducer_1.fetchOwnerList)());
|
|
23
23
|
billDetailActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
24
24
|
if (billId != null) {
|
|
25
|
-
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, true));
|
|
25
|
+
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, true, isShowDeletedBillsEnabled));
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
billDetailActions.push((0, editBillViewReducer_1.updateShowAutofill)(true));
|
|
@@ -55,7 +55,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
55
55
|
billDetailActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
56
56
|
}
|
|
57
57
|
if (billId != null) {
|
|
58
|
-
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false));
|
|
58
|
+
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false, isShowDeletedBillsEnabled));
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
const approvalViewFetchState = state.billPaySetupApproverViewState.fetchState;
|
|
@@ -5,13 +5,15 @@ import { ReceiptsProcessingPayload } from './editRemiViewPayload';
|
|
|
5
5
|
import { Recommendation } from '../../../../commonStateTypes/recommendationBase';
|
|
6
6
|
import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
|
|
7
7
|
export declare const initialState: EditRemiDetailViewState;
|
|
8
|
-
export declare const fetchEditRemiDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isLimitedCategoryEnabled: boolean, reimbursementId?: string | undefined], {
|
|
8
|
+
export declare const fetchEditRemiDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isLimitedCategoryEnabled: boolean, isShowDeletedReimbursementEnabled: boolean, reimbursementId?: string | undefined], {
|
|
9
9
|
cacheOverride: boolean;
|
|
10
10
|
isLimitedCategoryEnabled: boolean;
|
|
11
|
+
isShowDeletedReimbursementEnabled: boolean;
|
|
11
12
|
reimbursementId: string | undefined;
|
|
12
|
-
}, string, never, never>, fetchRemiAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reimbursementId: string, cacheOverride: boolean], {
|
|
13
|
+
}, string, never, never>, fetchRemiAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reimbursementId: string, cacheOverride: boolean, isShowDeletedReimbursementEnabled: boolean], {
|
|
13
14
|
reimbursementId: string;
|
|
14
15
|
cacheOverride: boolean;
|
|
16
|
+
isShowDeletedReimbursementEnabled: boolean;
|
|
15
17
|
}, string, never, never>, initializeRemiToLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reimbursementId: string], {
|
|
16
18
|
reimbursementId: string;
|
|
17
19
|
}, string, never, never>, fetchRecommendationsAndUpdateMerchantRecommendations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, lineId: string, reimbursementId?: string | undefined, merchantId?: string | undefined, merchantName?: string | undefined], {
|
|
@@ -22,11 +22,12 @@ const editRemiView = (0, toolkit_1.createSlice)({
|
|
|
22
22
|
_action) {
|
|
23
23
|
//do nothing
|
|
24
24
|
},
|
|
25
|
-
prepare(cacheOverride, isLimitedCategoryEnabled, reimbursementId) {
|
|
25
|
+
prepare(cacheOverride, isLimitedCategoryEnabled, isShowDeletedReimbursementEnabled, reimbursementId) {
|
|
26
26
|
return {
|
|
27
27
|
payload: {
|
|
28
28
|
cacheOverride,
|
|
29
29
|
isLimitedCategoryEnabled,
|
|
30
|
+
isShowDeletedReimbursementEnabled,
|
|
30
31
|
reimbursementId,
|
|
31
32
|
},
|
|
32
33
|
};
|
|
@@ -77,8 +78,14 @@ const editRemiView = (0, toolkit_1.createSlice)({
|
|
|
77
78
|
error: undefined,
|
|
78
79
|
} });
|
|
79
80
|
},
|
|
80
|
-
prepare(reimbursementId, cacheOverride) {
|
|
81
|
-
return {
|
|
81
|
+
prepare(reimbursementId, cacheOverride, isShowDeletedReimbursementEnabled) {
|
|
82
|
+
return {
|
|
83
|
+
payload: {
|
|
84
|
+
reimbursementId,
|
|
85
|
+
cacheOverride,
|
|
86
|
+
isShowDeletedReimbursementEnabled,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
82
89
|
},
|
|
83
90
|
},
|
|
84
91
|
fetchCurrencyConversionValue: {
|
package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js
CHANGED
|
@@ -13,7 +13,7 @@ const reimbursementConfigReducer_1 = require("../../reimbursementConfig/reimburs
|
|
|
13
13
|
const userFinancialAccountSelector_1 = require("../../../../userFinancialAccount/userFinancialAccountSelector");
|
|
14
14
|
const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchEditRemiDetailPage.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
var _a, _b;
|
|
16
|
-
const { cacheOverride, isLimitedCategoryEnabled, reimbursementId } = action.payload;
|
|
16
|
+
const { cacheOverride, isLimitedCategoryEnabled, reimbursementId, isShowDeletedReimbursementEnabled, } = action.payload;
|
|
17
17
|
const remiDetailActions = [];
|
|
18
18
|
const state = state$.value;
|
|
19
19
|
const userId = (_b = (_a = state.tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -24,7 +24,7 @@ const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
24
24
|
remiDetailActions.push((0, reimbursementConfigReducer_1.fetchReimbursementConfig)());
|
|
25
25
|
remiDetailActions.push((0, userFinancialAccountReducer_1.fetchUserFinancialAccount)(userId, reimbursementId));
|
|
26
26
|
if (reimbursementId != null) {
|
|
27
|
-
remiDetailActions.push((0, editRemiViewReducer_1.fetchRemiAndInitializeLocalStore)(reimbursementId, true));
|
|
27
|
+
remiDetailActions.push((0, editRemiViewReducer_1.fetchRemiAndInitializeLocalStore)(reimbursementId, true, isShowDeletedReimbursementEnabled));
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
@@ -63,7 +63,7 @@ const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
63
63
|
}));
|
|
64
64
|
}
|
|
65
65
|
if (reimbursementId != null) {
|
|
66
|
-
remiDetailActions.push((0, editRemiViewReducer_1.fetchRemiAndInitializeLocalStore)(reimbursementId, false));
|
|
66
|
+
remiDetailActions.push((0, editRemiViewReducer_1.fetchRemiAndInitializeLocalStore)(reimbursementId, false, isShowDeletedReimbursementEnabled));
|
|
67
67
|
}
|
|
68
68
|
else {
|
|
69
69
|
const approvalRules = state.remiSetupApproverViewState;
|
|
@@ -12,11 +12,11 @@ const editRemiViewReducer_1 = require("../editRemiViewReducer");
|
|
|
12
12
|
const fetchRemiAndInitializeLocalStoreEpic = (actions$,
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
14
|
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRemiAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
15
|
-
const { reimbursementId, cacheOverride } = action.payload;
|
|
15
|
+
const { reimbursementId, cacheOverride, isShowDeletedReimbursementEnabled, } = action.payload;
|
|
16
16
|
const state = state$.value;
|
|
17
17
|
const remiDetailActions = [];
|
|
18
18
|
if (cacheOverride == true) {
|
|
19
|
-
remiDetailActions.push((0, remiDetailViewReducer_1.fetchRemiDetail)(reimbursementId, true));
|
|
19
|
+
remiDetailActions.push((0, remiDetailViewReducer_1.fetchRemiDetail)(reimbursementId, true, isShowDeletedReimbursementEnabled));
|
|
20
20
|
remiDetailActions.push(
|
|
21
21
|
//https://stackoverflow.com/questions/42276419/invoking-epics-from-within-other-epics
|
|
22
22
|
(0, editRemiViewReducer_1.waitForRemiDetailThenInitializeLocalStore)(reimbursementId));
|
|
@@ -32,7 +32,7 @@ state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRemi
|
|
|
32
32
|
else if (remiDetail == null ||
|
|
33
33
|
((remiDetail === null || remiDetail === void 0 ? void 0 : remiDetail.fetchState) != 'In-Progress' &&
|
|
34
34
|
(remiDetail === null || remiDetail === void 0 ? void 0 : remiDetail.fetchState) != 'Completed')) {
|
|
35
|
-
remiDetailActions.push((0, remiDetailViewReducer_1.fetchRemiDetail)(reimbursementId, false));
|
|
35
|
+
remiDetailActions.push((0, remiDetailViewReducer_1.fetchRemiDetail)(reimbursementId, false, isShowDeletedReimbursementEnabled));
|
|
36
36
|
remiDetailActions.push(
|
|
37
37
|
//https://stackoverflow.com/questions/42276419/invoking-epics-from-within-other-epics
|
|
38
38
|
(0, editRemiViewReducer_1.waitForRemiDetailThenInitializeLocalStore)(reimbursementId));
|
|
@@ -21,7 +21,7 @@ const commonHistoryReducer_1 = require("../../../commonHistoryView/commonHistory
|
|
|
21
21
|
const recommendationReducer_1 = require("../../../../recommendation/recommendationReducer");
|
|
22
22
|
const recommendationHelper_1 = require("../../../../recommendation/recommendationHelper");
|
|
23
23
|
const fetchRemiDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiDetailViewReducer_1.fetchRemiDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
24
|
-
const { reimbursementId, cacheOverride } = action.payload;
|
|
24
|
+
const { reimbursementId, cacheOverride, isShowDeletedReimbursementEnabled, } = action.payload;
|
|
25
25
|
const remiActions = [];
|
|
26
26
|
const state = state$.value;
|
|
27
27
|
if (cacheOverride === true) {
|
|
@@ -39,7 +39,7 @@ const fetchRemiDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
39
39
|
reimbursement_provider: 'zeni',
|
|
40
40
|
is_include_payment_accounts_info: true,
|
|
41
41
|
is_include_approval_info: true,
|
|
42
|
-
is_include_deleted:
|
|
42
|
+
is_include_deleted: isShowDeletedReimbursementEnabled,
|
|
43
43
|
};
|
|
44
44
|
const getTransactionDetail$ = zeniAPI
|
|
45
45
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reimbursements/transactions/${reimbursementId}?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
@@ -3,9 +3,10 @@ import { RemiDetailViewState, RemiApprovalType } from './remiDetailViewState';
|
|
|
3
3
|
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
4
4
|
import { RemiDetailViewPayload } from './remiDetailViewPayload';
|
|
5
5
|
export declare const initialState: RemiDetailViewState;
|
|
6
|
-
export declare const fetchRemiDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reimbursementId: string, cacheOverride
|
|
6
|
+
export declare const fetchRemiDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reimbursementId: string, cacheOverride: any, isShowDeletedReimbursementEnabled: any], {
|
|
7
7
|
reimbursementId: string;
|
|
8
8
|
cacheOverride: any;
|
|
9
|
+
isShowDeletedReimbursementEnabled: any;
|
|
9
10
|
}, string, never, never>, updateRemiDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
11
|
reimbursementId: ID;
|
|
11
12
|
remiDetail: RemiDetailViewPayload;
|
|
@@ -25,11 +25,12 @@ const remiDetailView = (0, toolkit_1.createSlice)({
|
|
|
25
25
|
draft.remiDetailById[reimbursementId] = Object.assign({}, remiDetailViewState_1.initialRemiDetailView);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
prepare(reimbursementId, cacheOverride = false) {
|
|
28
|
+
prepare(reimbursementId, cacheOverride = false, isShowDeletedReimbursementEnabled) {
|
|
29
29
|
return {
|
|
30
30
|
payload: {
|
|
31
31
|
reimbursementId,
|
|
32
32
|
cacheOverride,
|
|
33
|
+
isShowDeletedReimbursementEnabled,
|
|
33
34
|
},
|
|
34
35
|
};
|
|
35
36
|
},
|
|
@@ -13,7 +13,7 @@ const reimbursementConfigReducer_1 = require("../reimbursementConfig/reimburseme
|
|
|
13
13
|
const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(remiListReducer_1.fetchRemiList.match), (0, operators_1.mergeMap)((action) => {
|
|
14
14
|
const fetchRemiListActions = [];
|
|
15
15
|
const state = state$.value;
|
|
16
|
-
const { period, cacheOverride } = action.payload;
|
|
16
|
+
const { period, cacheOverride, isShowDeletedReimbursementEnabled } = action.payload;
|
|
17
17
|
const tabIds = [
|
|
18
18
|
'draft',
|
|
19
19
|
'pending_approval',
|
|
@@ -22,7 +22,7 @@ const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
|
|
|
22
22
|
];
|
|
23
23
|
if (cacheOverride === true) {
|
|
24
24
|
fetchRemiListActions.push((0, reimbursementConfigReducer_1.fetchReimbursementConfig)());
|
|
25
|
-
tabIds.forEach((tab) => fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab)));
|
|
25
|
+
tabIds.forEach((tab) => fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled)));
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
if (state.reimbursementConfigState.fetchState !== 'Completed' &&
|
|
@@ -33,7 +33,7 @@ const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
|
|
|
33
33
|
const key = (0, remiListState_1.getRemiListKey)(period, tab);
|
|
34
34
|
const bills = (0, get_1.default)(state.billListState.byBillListKey, key, undefined);
|
|
35
35
|
if (bills == null || bills.hasValidState() === false) {
|
|
36
|
-
fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab));
|
|
36
|
+
fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled));
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -10,7 +10,7 @@ const reimbursementReducer_1 = require("../../../../entity/reimbursement/reimbur
|
|
|
10
10
|
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
11
11
|
const entityApprovalStatusReducer_1 = require("../../../../entity/entityApprovalStatus/entityApprovalStatusReducer");
|
|
12
12
|
const fetchRemiListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiListReducer_1.fetchRemiListPerTab.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { period, tab } = action.payload;
|
|
13
|
+
const { period, tab, isShowDeletedReimbursementEnabled } = action.payload;
|
|
14
14
|
const queryParam = {
|
|
15
15
|
start_date: (0, timePeriod_1.toString)(period.start),
|
|
16
16
|
end_date: (0, timePeriod_1.toString)(period.end),
|
|
@@ -22,7 +22,9 @@ const fetchRemiListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0
|
|
|
22
22
|
is_include_approval_info: tab === 'pending_approval',
|
|
23
23
|
is_include_pending_approval_transaction_ids_for_user: tab === 'pending_approval',
|
|
24
24
|
transaction_type: 'reimbursement',
|
|
25
|
-
is_include_deleted:
|
|
25
|
+
is_include_deleted: isShowDeletedReimbursementEnabled
|
|
26
|
+
? tab !== 'draft'
|
|
27
|
+
: false,
|
|
26
28
|
};
|
|
27
29
|
return zeniAPI
|
|
28
30
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reimbursements/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -4,12 +4,14 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
4
4
|
import { RemiListPayload } from './remiListPayload';
|
|
5
5
|
import { RemiListState, RemiTabType, SaveRemiStageCode, RemiListUIState, ReimbursementFilters, RemiListDownloadUIState } from './remiListState';
|
|
6
6
|
export declare const initialState: RemiListState;
|
|
7
|
-
export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride
|
|
7
|
+
export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedReimbursementEnabled: boolean], {
|
|
8
8
|
period: TimePeriod;
|
|
9
9
|
cacheOverride: any;
|
|
10
|
-
|
|
10
|
+
isShowDeletedReimbursementEnabled: boolean;
|
|
11
|
+
}, string, never, never>, fetchRemiListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedReimbursementEnabled: boolean], {
|
|
11
12
|
period: TimePeriod;
|
|
12
13
|
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
14
|
+
isShowDeletedReimbursementEnabled: boolean;
|
|
13
15
|
}, string, never, never>, updateRemiListByStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
16
|
remiList: RemiListPayload;
|
|
15
17
|
tab: RemiTabType;
|
|
@@ -34,9 +34,9 @@ const remiList = (0, toolkit_1.createSlice)({
|
|
|
34
34
|
reducer() {
|
|
35
35
|
//do nothing
|
|
36
36
|
},
|
|
37
|
-
prepare(period, tab) {
|
|
37
|
+
prepare(period, tab, isShowDeletedReimbursementEnabled) {
|
|
38
38
|
return {
|
|
39
|
-
payload: { period, tab },
|
|
39
|
+
payload: { period, tab, isShowDeletedReimbursementEnabled },
|
|
40
40
|
};
|
|
41
41
|
},
|
|
42
42
|
},
|
|
@@ -63,9 +63,9 @@ const remiList = (0, toolkit_1.createSlice)({
|
|
|
63
63
|
: 'In-Progress', error: undefined });
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
|
-
prepare(period, cacheOverride = false) {
|
|
66
|
+
prepare(period, cacheOverride = false, isShowDeletedReimbursementEnabled) {
|
|
67
67
|
return {
|
|
68
|
-
payload: { period, cacheOverride },
|
|
68
|
+
payload: { period, cacheOverride, isShowDeletedReimbursementEnabled },
|
|
69
69
|
};
|
|
70
70
|
},
|
|
71
71
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.69",
|
|
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,22 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { fetchBankAccountsList, updateBankConnectionOnSuccess, updateBankConnectionOnFailure } from '../settingsViewReducer';
|
|
3
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { RootState } from '../../../reducer';
|
|
5
|
-
import { updateAccounts } from '../../../entity/account/accountReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof fetchBankAccountsList> | ReturnType<typeof updateBankConnectionOnSuccess> | ReturnType<typeof updateBankConnectionOnFailure> | ReturnType<typeof updateAccounts>;
|
|
7
|
-
export declare const fetchBankAccountsListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
-
payload: undefined;
|
|
9
|
-
type: string;
|
|
10
|
-
} | {
|
|
11
|
-
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
12
|
-
type: string;
|
|
13
|
-
} | {
|
|
14
|
-
payload: {
|
|
15
|
-
bankAccountIds: string[];
|
|
16
|
-
};
|
|
17
|
-
type: string;
|
|
18
|
-
} | import("@reduxjs/toolkit").PayloadAction<import("../../../entity/account/accountPayload").AccountPayload[], string, {
|
|
19
|
-
reportId: import("../../..").ReportIDPlusForecastID;
|
|
20
|
-
classesViewParentId: import("../../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
|
|
21
|
-
updateType: import("../../..").UpdateType;
|
|
22
|
-
}, never>>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchBankAccountsListEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
-
const accountReducer_1 = require("../../../entity/account/accountReducer");
|
|
9
|
-
const fetchBankAccountsListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBankAccountsList.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
const queryValue = {
|
|
11
|
-
is_full: true,
|
|
12
|
-
is_exclude_account_payable_accounts: true,
|
|
13
|
-
is_exclude_account_receivable_accounts: true,
|
|
14
|
-
account_types: ['bank'],
|
|
15
|
-
};
|
|
16
|
-
const URL = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryValue))}`;
|
|
17
|
-
return zeniAPI.getJSON(URL).pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
|
-
const bankAccountIds = response.data.accounts.map((account) => account.account_id);
|
|
20
|
-
const updateActions = [];
|
|
21
|
-
updateActions.push((0, settingsViewReducer_1.updateBankConnectionOnSuccess)({ bankAccountIds }), (0, accountReducer_1.updateAccounts)(response.data.accounts, 'bill_pay'));
|
|
22
|
-
return (0, rxjs_1.of)(...updateActions);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return (0, rxjs_1.of)((0, settingsViewReducer_1.updateBankConnectionOnFailure)(response.status));
|
|
26
|
-
}
|
|
27
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.updateBankConnectionOnFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Fetch Bank Accounts REST API call errored out' +
|
|
28
|
-
JSON.stringify(error))))));
|
|
29
|
-
}));
|
|
30
|
-
exports.fetchBankAccountsListEpic = fetchBankAccountsListEpic;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { fetchBankConnectionsView, fetchBankAccountsList } from '../settingsViewReducer';
|
|
4
|
-
import { getPaymentAccounts } from '../../spendManagement/commonSetup/setupViewReducer';
|
|
5
|
-
export declare type ActionType = ReturnType<typeof fetchBankConnectionsView> | ReturnType<typeof fetchBankAccountsList> | ReturnType<typeof getPaymentAccounts>;
|
|
6
|
-
export declare const fetchBankConnectionsViewEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchBankConnectionsViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
7
|
-
const setupViewReducer_1 = require("../../spendManagement/commonSetup/setupViewReducer");
|
|
8
|
-
const fetchBankConnectionsViewEpic = (actions$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBankConnectionsView.match), (0, operators_1.switchMap)(() => {
|
|
9
|
-
return (0, rxjs_1.from)([
|
|
10
|
-
(0, settingsViewReducer_1.fetchBankAccountsList)(),
|
|
11
|
-
(0, setupViewReducer_1.getPaymentAccounts)('bill_pay', false),
|
|
12
|
-
]);
|
|
13
|
-
}));
|
|
14
|
-
exports.fetchBankConnectionsViewEpic = fetchBankConnectionsViewEpic;
|