@zeniai/client-epic-state 4.13.19 → 4.13.20
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/billPay/billList/billListReducer.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +2 -1
- package/lib/view/spendManagement/billPay/billList/fetchBillListEpic.js +3 -3
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.d.ts +6 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +16 -6
- package/lib/view/spendManagement/billPay/billPayConfig/fetchBillPayConfigEpic.js +5 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +2 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +3 -3
- package/package.json +1 -1
|
@@ -4,11 +4,12 @@ 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: any, isShowDeletedBillsEnabled: boolean, isBulkActionCompleteRefresh?: any], {
|
|
7
|
+
export declare const fetchBillList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedBillsEnabled: boolean, isInternationalWireEnabled: boolean, isBulkActionCompleteRefresh?: any], {
|
|
8
8
|
period: TimePeriod;
|
|
9
9
|
cacheOverride: any;
|
|
10
10
|
isShowDeletedBillsEnabled: boolean;
|
|
11
11
|
isBulkActionCompleteRefresh: any;
|
|
12
|
+
isInternationalWireEnabled: boolean;
|
|
12
13
|
}, string, never, never>, fetchBillListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedBillsEnabled: boolean], {
|
|
13
14
|
period: TimePeriod;
|
|
14
15
|
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
@@ -63,13 +63,14 @@ const billList = (0, toolkit_1.createSlice)({
|
|
|
63
63
|
: 'In-Progress', error: undefined });
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
|
-
prepare(period, cacheOverride = false, isShowDeletedBillsEnabled, isBulkActionCompleteRefresh = false) {
|
|
66
|
+
prepare(period, cacheOverride = false, isShowDeletedBillsEnabled, isInternationalWireEnabled, isBulkActionCompleteRefresh = false) {
|
|
67
67
|
return {
|
|
68
68
|
payload: {
|
|
69
69
|
period,
|
|
70
70
|
cacheOverride,
|
|
71
71
|
isShowDeletedBillsEnabled,
|
|
72
72
|
isBulkActionCompleteRefresh,
|
|
73
|
+
isInternationalWireEnabled,
|
|
73
74
|
},
|
|
74
75
|
};
|
|
75
76
|
},
|
|
@@ -19,15 +19,15 @@ 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, isShowDeletedBillsEnabled } = action.payload;
|
|
22
|
+
const { period, cacheOverride, isShowDeletedBillsEnabled, isInternationalWireEnabled, } = action.payload;
|
|
23
23
|
if (cacheOverride === true) {
|
|
24
|
-
fetchBillListActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
24
|
+
fetchBillListActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)(isInternationalWireEnabled));
|
|
25
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' &&
|
|
29
29
|
state.billPayConfigState.fetchState !== 'In-Progress') {
|
|
30
|
-
fetchBillListActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
30
|
+
fetchBillListActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)(isInternationalWireEnabled));
|
|
31
31
|
}
|
|
32
32
|
tabIds.forEach((tab) => {
|
|
33
33
|
const key = (0, billListState_1.getBillListKey)(period, tab);
|
|
@@ -2,6 +2,11 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
2
2
|
import { BillPayConfigPayload } from './billPayConfigPayload';
|
|
3
3
|
import { BillPayConfigState } from './billPayConfigState';
|
|
4
4
|
export declare const initialState: BillPayConfigState;
|
|
5
|
-
export declare const fetchBillPayConfig: import("@reduxjs/toolkit").
|
|
5
|
+
export declare const fetchBillPayConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isInternationalWireEnabled: boolean], {
|
|
6
|
+
isInternationalWireEnabled: boolean;
|
|
7
|
+
}, string, never, never>, updateBillPayConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
billPayConfigPayload: BillPayConfigPayload;
|
|
9
|
+
isInternationalWireEnabled: boolean;
|
|
10
|
+
}, string>, updateBillPayConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, clearBillPayConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
6
11
|
declare const _default: import("@reduxjs/toolkit").Reducer<BillPayConfigState, import("@reduxjs/toolkit").AnyAction>;
|
|
7
12
|
export default _default;
|
|
@@ -26,12 +26,22 @@ const billPayConfig = (0, toolkit_1.createSlice)({
|
|
|
26
26
|
name: 'billPayConfig',
|
|
27
27
|
initialState: exports.initialState,
|
|
28
28
|
reducers: {
|
|
29
|
-
fetchBillPayConfig
|
|
30
|
-
draft
|
|
31
|
-
|
|
29
|
+
fetchBillPayConfig: {
|
|
30
|
+
reducer(draft) {
|
|
31
|
+
draft.fetchState = 'In-Progress';
|
|
32
|
+
draft.error = undefined;
|
|
33
|
+
},
|
|
34
|
+
prepare(isInternationalWireEnabled) {
|
|
35
|
+
return {
|
|
36
|
+
payload: {
|
|
37
|
+
isInternationalWireEnabled,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
},
|
|
32
41
|
},
|
|
33
42
|
updateBillPayConfig(draft, action) {
|
|
34
|
-
const
|
|
43
|
+
const payload = action.payload.billPayConfigPayload;
|
|
44
|
+
const isInternationalWireEnabled = action.payload.isInternationalWireEnabled;
|
|
35
45
|
const { vendor } = payload;
|
|
36
46
|
billPayConfigState_1.BILL_PAYMENT_METHOD_CODE.forEach((code) => {
|
|
37
47
|
switch (code) {
|
|
@@ -58,13 +68,13 @@ const billPayConfig = (0, toolkit_1.createSlice)({
|
|
|
58
68
|
billPayConfigState_1.INTERNATIONAL_CODES.forEach((internationalWireCode) => {
|
|
59
69
|
if (internationalWireCode === 'usd-to-local-currency') {
|
|
60
70
|
billPayConfigState_1.ACCOUNT_TYPE_CODES.forEach((accType) => {
|
|
61
|
-
draft.methodById[(0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentWireSubConfigCodeKey)(subCode), (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)(accType), (0, billPayConfigPayload_1.getInternationalWireMethodCodeKey)(internationalWireCode))] = (0, billPayConfigPayload_1.mapBillPayConfigPayloadToBillPayConfig)(payload.payment_processor,
|
|
71
|
+
draft.methodById[(0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentWireSubConfigCodeKey)(subCode), (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)(accType), (0, billPayConfigPayload_1.getInternationalWireMethodCodeKey)(internationalWireCode))] = (0, billPayConfigPayload_1.mapBillPayConfigPayloadToBillPayConfig)(payload.payment_processor, isInternationalWireEnabled, true, code, subCode, accType, internationalWireCode);
|
|
62
72
|
});
|
|
63
73
|
}
|
|
64
74
|
else if (internationalWireCode === 'usd-to-usd') {
|
|
65
75
|
billPayConfigState_1.INTERNATIONAL_SUB_CODES.forEach((internationalWireSubCode) => {
|
|
66
76
|
billPayConfigState_1.ACCOUNT_TYPE_CODES.forEach((accType) => {
|
|
67
|
-
draft.methodById[(0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentWireSubConfigCodeKey)(subCode), (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)(accType), (0, billPayConfigPayload_1.getInternationalWireMethodCodeKey)(internationalWireCode), (0, billPayConfigPayload_1.getInternationalSubConfigCodeKey)(internationalWireSubCode))] = (0, billPayConfigPayload_1.mapBillPayConfigPayloadToBillPayConfig)(payload.payment_processor,
|
|
77
|
+
draft.methodById[(0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentWireSubConfigCodeKey)(subCode), (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)(accType), (0, billPayConfigPayload_1.getInternationalWireMethodCodeKey)(internationalWireCode), (0, billPayConfigPayload_1.getInternationalSubConfigCodeKey)(internationalWireSubCode))] = (0, billPayConfigPayload_1.mapBillPayConfigPayloadToBillPayConfig)(payload.payment_processor, isInternationalWireEnabled, true, code, subCode, accType, internationalWireCode, internationalWireSubCode);
|
|
68
78
|
});
|
|
69
79
|
});
|
|
70
80
|
}
|
|
@@ -5,7 +5,7 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const billPayConfigReducer_1 = require("./billPayConfigReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
-
const fetchBillPayConfigEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPayConfigReducer_1.fetchBillPayConfig.match), (0, operators_1.mergeMap)(() => {
|
|
8
|
+
const fetchBillPayConfigEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPayConfigReducer_1.fetchBillPayConfig.match), (0, operators_1.mergeMap)((action) => {
|
|
9
9
|
const queryParam = {
|
|
10
10
|
bill_pay_provider: 'zeni',
|
|
11
11
|
transaction_type: 'bill',
|
|
@@ -17,7 +17,10 @@ const fetchBillPayConfigEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
|
|
|
17
17
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
18
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
19
|
const updateActions = [];
|
|
20
|
-
updateActions.push((0, billPayConfigReducer_1.updateBillPayConfig)(
|
|
20
|
+
updateActions.push((0, billPayConfigReducer_1.updateBillPayConfig)({
|
|
21
|
+
billPayConfigPayload: response.data,
|
|
22
|
+
isInternationalWireEnabled: action.payload.isInternationalWireEnabled,
|
|
23
|
+
}));
|
|
21
24
|
return (0, rxjs_1.from)(updateActions);
|
|
22
25
|
}
|
|
23
26
|
else {
|
|
@@ -5,10 +5,11 @@ 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, isShowDeletedBillsEnabled: boolean, hasZeniAssistAccess: boolean, billId?: string | undefined], {
|
|
8
|
+
export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isShowDeletedBillsEnabled: boolean, hasZeniAssistAccess: boolean, isInternationalWireEnabled: boolean, billId?: string | undefined], {
|
|
9
9
|
cacheOverride: boolean;
|
|
10
10
|
isShowDeletedBillsEnabled: boolean;
|
|
11
11
|
hasZeniAssistAccess: boolean;
|
|
12
|
+
isInternationalWireEnabled: boolean;
|
|
12
13
|
billId: string | undefined;
|
|
13
14
|
}, string, never, never>, fetchBillAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride: boolean, isShowDeletedBillsEnabled: boolean, hasZeniAssistAccess: boolean], {
|
|
14
15
|
billId: string;
|
|
@@ -23,12 +23,13 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
23
23
|
reducer() {
|
|
24
24
|
//do nothing
|
|
25
25
|
},
|
|
26
|
-
prepare(cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess, billId) {
|
|
26
|
+
prepare(cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess, isInternationalWireEnabled, billId) {
|
|
27
27
|
return {
|
|
28
28
|
payload: {
|
|
29
29
|
cacheOverride,
|
|
30
30
|
isShowDeletedBillsEnabled,
|
|
31
31
|
hasZeniAssistAccess,
|
|
32
|
+
isInternationalWireEnabled,
|
|
32
33
|
billId,
|
|
33
34
|
},
|
|
34
35
|
};
|
package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { fetchEditBillDetailPage, updateShowAutofill } from '../editBillViewReducer';
|
|
3
|
+
import { fetchBillAndInitializeLocalStore, fetchEditBillDetailPage, updateShowAutofill } from '../editBillViewReducer';
|
|
4
4
|
import { RootState } from '../../../../../reducer';
|
|
5
5
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
6
6
|
import { fetchAccountList } from '../../../../accountList/accountListReducer';
|
|
@@ -10,5 +10,5 @@ import { fetchVendorTypeList } from '../../../../vendorTypeList/vendorTypeListRe
|
|
|
10
10
|
import { fetchBillPayConfig } from '../../billPayConfig/billPayConfigReducer';
|
|
11
11
|
import { fetchDepositAccountList } from '../../../zeniAccounts/depositAccountList/depositAccountListReducer';
|
|
12
12
|
import { fetchPaymentAccountList } from '../../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
|
|
13
|
-
export declare type ActionType = ReturnType<typeof fetchEditBillDetailPage> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof fetchDepositAccountList> | ReturnType<typeof fetchBillPayConfig> | ReturnType<typeof updateShowAutofill> | ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof fetchOwnerList>;
|
|
13
|
+
export declare type ActionType = ReturnType<typeof fetchEditBillDetailPage> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof fetchDepositAccountList> | ReturnType<typeof fetchBillPayConfig> | ReturnType<typeof updateShowAutofill> | ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof fetchOwnerList> | ReturnType<typeof fetchBillAndInitializeLocalStore>;
|
|
14
14
|
export declare const fetchEditBillDetailPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -15,7 +15,7 @@ const companySelector_1 = require("../../../../../entity/company/companySelector
|
|
|
15
15
|
const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
16
16
|
const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchEditBillDetailPage.match), (0, operators_1.mergeMap)((action) => {
|
|
17
17
|
var _a, _b, _c;
|
|
18
|
-
const { cacheOverride, billId, isShowDeletedBillsEnabled, hasZeniAssistAccess, } = action.payload;
|
|
18
|
+
const { cacheOverride, billId, isShowDeletedBillsEnabled, hasZeniAssistAccess, isInternationalWireEnabled, } = action.payload;
|
|
19
19
|
const billDetailActions = [];
|
|
20
20
|
const state = state$.value;
|
|
21
21
|
const { tenantState, companyState } = state;
|
|
@@ -30,7 +30,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
30
30
|
billDetailActions.push((0, classListReducer_1.fetchClassList)());
|
|
31
31
|
billDetailActions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
|
|
32
32
|
billDetailActions.push((0, ownerListReducer_1.fetchOwnerList)());
|
|
33
|
-
billDetailActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
33
|
+
billDetailActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)(isInternationalWireEnabled));
|
|
34
34
|
if (isCompanyZeniAccountsSetUpDone) {
|
|
35
35
|
billDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
36
36
|
}
|
|
@@ -65,7 +65,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
65
65
|
const billPayConfigFetchState = state.billPayConfigState.fetchState;
|
|
66
66
|
if (billPayConfigFetchState !== 'Completed' &&
|
|
67
67
|
billPayConfigFetchState !== 'In-Progress') {
|
|
68
|
-
billDetailActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)());
|
|
68
|
+
billDetailActions.push((0, billPayConfigReducer_1.fetchBillPayConfig)(isInternationalWireEnabled));
|
|
69
69
|
}
|
|
70
70
|
const depositAccounts = state.depositAccountListState;
|
|
71
71
|
if (isCompanyZeniAccountsSetUpDone &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.20",
|
|
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",
|