@zeniai/client-epic-state 4.10.46 → 4.10.47
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/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +1 -5
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/epic.d.ts +6 -6
- package/lib/epic.js +6 -6
- package/lib/index.d.ts +6 -3
- package/lib/index.js +18 -15
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/onboardingView/customerView/epic/plaidConnection/getOnboardingPlaidLinkTokenEpic.js +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +2 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +2 -1
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +2 -2
- package/lib/view/settingsView/settingsViewSelector.js +3 -3
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -2
- package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +3 -2
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +5 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +5 -5
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +3 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +5 -4
- package/lib/view/spendManagement/commonSetup/setupViewPayload.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +3 -59
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -334
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +3 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +12 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -14
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/getPaymentAccountsEpic.d.ts +1 -1
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/getPaymentAccountsEpic.js +6 -6
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountEpic.d.ts +1 -1
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountEpic.js +6 -6
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.d.ts +1 -1
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +7 -7
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountStatusEpic.d.ts +1 -1
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +7 -7
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -2
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/establishPlaidConnectionEpic.js +7 -7
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/getPlaidLinkTokenEpic.d.ts +2 -2
- package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/getPlaidLinkTokenEpic.js +6 -6
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +85 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +332 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.d.ts +2 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.js +7 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +21 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +29 -0
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.d.ts +3 -2
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +5 -4
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/updateMileageDetailsEpic.d.ts +3 -2
- package/lib/view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListPayload.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +3 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +5 -4
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
- package/package.json +1 -1
- /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/paymentAccount.d.ts +0 -0
- /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/paymentAccount.js +0 -0
- /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/plaidConnection.d.ts +0 -0
- /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/plaidConnection.js +0 -0
|
@@ -61,13 +61,6 @@ export interface SetupViewLocalData {
|
|
|
61
61
|
/**
|
|
62
62
|
* Setup View State
|
|
63
63
|
*/
|
|
64
|
-
export declare type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
65
|
-
export declare type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
66
|
-
linkToken?: string;
|
|
67
|
-
expiration?: ZeniDate;
|
|
68
|
-
fetchStatus: FetchStateAndError;
|
|
69
|
-
updateStatus: FetchStateAndError;
|
|
70
|
-
}>;
|
|
71
64
|
export interface CompanyAndIdentityDetails {
|
|
72
65
|
companyDetails: {
|
|
73
66
|
localData?: CompanyDetailsLocalData;
|
|
@@ -83,11 +76,4 @@ export interface CompanyAndIdentityDetails {
|
|
|
83
76
|
}
|
|
84
77
|
export interface SetupViewState extends CompanyAndIdentityDetails {
|
|
85
78
|
updateStatus: FetchStateAndError;
|
|
86
|
-
accountDetails: {
|
|
87
|
-
fetchStatus: FetchStateAndError;
|
|
88
|
-
updateStatus: FetchStateAndError;
|
|
89
|
-
paymentAccountIds: ID[];
|
|
90
|
-
allBankAccountIds: ID[];
|
|
91
|
-
};
|
|
92
|
-
plaidConnectionDetails: PlaidConnectionDetails;
|
|
93
79
|
}
|
|
@@ -2,7 +2,7 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
-
import { getPaymentAccounts, getPaymentAccountsSuccess, getPaymentAccountsFailure } from '../../
|
|
5
|
+
import { getPaymentAccounts, getPaymentAccountsSuccess, getPaymentAccountsFailure } from '../../plaidAccountViewReducer';
|
|
6
6
|
import { updateAccounts } from '../../../../../entity/account/accountReducer';
|
|
7
7
|
import { updatePaymentAccounts } from '../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
8
8
|
export declare type ActionType = ReturnType<typeof getPaymentAccounts> | ReturnType<typeof updateAccounts> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof getPaymentAccountsSuccess> | ReturnType<typeof getPaymentAccountsFailure>;
|
|
@@ -4,11 +4,11 @@ exports.getPaymentAccountsEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const
|
|
7
|
+
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
8
8
|
const accountReducer_1 = require("../../../../../entity/account/accountReducer");
|
|
9
9
|
const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/paymentAccountReducer");
|
|
10
|
-
const getPaymentAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
11
|
-
const { setupViewType, includeBalances } = action.payload;
|
|
10
|
+
const getPaymentAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.getPaymentAccounts.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
+
const { setupViewType, includeBalances, plaidAccountKeyType } = action.payload;
|
|
12
12
|
return zeniAPI
|
|
13
13
|
.getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/payment-accounts?query=${encodeURIComponent(JSON.stringify({
|
|
14
14
|
is_include_balances: includeBalances,
|
|
@@ -21,13 +21,13 @@ const getPaymentAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
|
|
|
21
21
|
const actions = [
|
|
22
22
|
(0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType),
|
|
23
23
|
(0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
|
|
24
|
-
(0,
|
|
24
|
+
(0, plaidAccountViewReducer_1.getPaymentAccountsSuccess)(paymentAccountIds, plaidAccountKeyType),
|
|
25
25
|
];
|
|
26
26
|
return (0, rxjs_1.from)(actions);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
return (0, rxjs_1.of)((0,
|
|
29
|
+
return (0, rxjs_1.of)((0, plaidAccountViewReducer_1.getPaymentAccountsFailure)(response.status, plaidAccountKeyType));
|
|
30
30
|
}
|
|
31
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
31
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.getPaymentAccountsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Get Payment Accounts errored out' + JSON.stringify(error)), plaidAccountKeyType))));
|
|
32
32
|
}));
|
|
33
33
|
exports.getPaymentAccountsEpic = getPaymentAccountsEpic;
|
|
@@ -4,6 +4,6 @@ import { RootState } from '../../../../../reducer';
|
|
|
4
4
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
5
|
import { updateAccounts } from '../../../../../entity/account/accountReducer';
|
|
6
6
|
import { updatePaymentAccounts } from '../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
7
|
-
import { updatePaymentAccount, updatePaymentAccountSuccess, updatePaymentAccountFailure } from '../../
|
|
7
|
+
import { updatePaymentAccount, updatePaymentAccountSuccess, updatePaymentAccountFailure } from '../../plaidAccountViewReducer';
|
|
8
8
|
export declare type ActionType = ReturnType<typeof updatePaymentAccount> | ReturnType<typeof updateAccounts> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePaymentAccountSuccess> | ReturnType<typeof updatePaymentAccountFailure>;
|
|
9
9
|
export declare const updatePaymentAccountEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -6,9 +6,9 @@ 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 paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/paymentAccountReducer");
|
|
9
|
-
const
|
|
10
|
-
const updatePaymentAccountEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
11
|
-
const { accountId, paymentAccountId, setupViewType } = action.payload;
|
|
9
|
+
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
10
|
+
const updatePaymentAccountEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.updatePaymentAccount.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const { accountId, paymentAccountId, setupViewType, plaidAccountKeyType } = action.payload;
|
|
12
12
|
return zeniAPI
|
|
13
13
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/payment-accounts/${paymentAccountId}`, {
|
|
14
14
|
zeni_mapped_account_id: accountId,
|
|
@@ -19,13 +19,13 @@ const updatePaymentAccountEpic = (actions$, _state$, zeniAPI) => actions$.pipe((
|
|
|
19
19
|
const actions = [
|
|
20
20
|
(0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType),
|
|
21
21
|
(0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
|
|
22
|
-
(0,
|
|
22
|
+
(0, plaidAccountViewReducer_1.updatePaymentAccountSuccess)(paymentAccountIds, plaidAccountKeyType),
|
|
23
23
|
];
|
|
24
24
|
return (0, rxjs_1.from)(actions);
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
return (0, rxjs_1.of)((0,
|
|
27
|
+
return (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePaymentAccountFailure)(response.status, plaidAccountKeyType));
|
|
28
28
|
}
|
|
29
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
29
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePaymentAccountFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Payment Account errored out' + JSON.stringify(error)), plaidAccountKeyType))));
|
|
30
30
|
}));
|
|
31
31
|
exports.updatePaymentAccountEpic = updatePaymentAccountEpic;
|
|
@@ -5,6 +5,6 @@ import { ZeniAPI } from '../../../../../zeniAPI';
|
|
|
5
5
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
6
|
import { updateAccounts } from '../../../../../entity/account/accountReducer';
|
|
7
7
|
import { updatePaymentAccounts } from '../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
8
|
-
import { updatePaymentAccountLoginStatus, updatePaymentAccountLoginStatusSuccess, updatePaymentAccountLoginStatusFailure } from '../../
|
|
8
|
+
import { updatePaymentAccountLoginStatus, updatePaymentAccountLoginStatusSuccess, updatePaymentAccountLoginStatusFailure } from '../../plaidAccountViewReducer';
|
|
9
9
|
export declare type ActionType = ReturnType<typeof updatePaymentAccountLoginStatus> | ReturnType<typeof updateAccounts> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof openSnackbar> | ReturnType<typeof updatePaymentAccountLoginStatusSuccess> | ReturnType<typeof updatePaymentAccountLoginStatusFailure>;
|
|
10
10
|
export declare const updatePaymentAccountLoginStatusEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -7,9 +7,9 @@ const responsePayload_1 = require("../../../../../responsePayload");
|
|
|
7
7
|
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const accountReducer_1 = require("../../../../../entity/account/accountReducer");
|
|
9
9
|
const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/paymentAccountReducer");
|
|
10
|
-
const
|
|
11
|
-
const updatePaymentAccountLoginStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
12
|
-
const { isLoginRequired, paymentAccountId, setupViewType, linkTokenType } = action.payload;
|
|
10
|
+
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
11
|
+
const updatePaymentAccountLoginStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.updatePaymentAccountLoginStatus.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const { isLoginRequired, paymentAccountId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
|
|
13
13
|
return zeniAPI
|
|
14
14
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/payment-accounts/${paymentAccountId}`, {
|
|
15
15
|
is_login_required: isLoginRequired,
|
|
@@ -20,7 +20,7 @@ const updatePaymentAccountLoginStatusEpic = (actions$, _state$, zeniAPI) => acti
|
|
|
20
20
|
const actions = [
|
|
21
21
|
(0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType),
|
|
22
22
|
(0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
|
|
23
|
-
(0,
|
|
23
|
+
(0, plaidAccountViewReducer_1.updatePaymentAccountLoginStatusSuccess)(paymentAccountIds, linkTokenType, plaidAccountKeyType),
|
|
24
24
|
];
|
|
25
25
|
return (0, rxjs_1.from)(actions);
|
|
26
26
|
}
|
|
@@ -29,9 +29,9 @@ const updatePaymentAccountLoginStatusEpic = (actions$, _state$, zeniAPI) => acti
|
|
|
29
29
|
messageSection: 'plaid_connection',
|
|
30
30
|
messageText: 'failed',
|
|
31
31
|
type: 'error',
|
|
32
|
-
}), (0,
|
|
32
|
+
}), (0, plaidAccountViewReducer_1.updatePaymentAccountLoginStatusFailure)(response.status, linkTokenType, plaidAccountKeyType));
|
|
33
33
|
}
|
|
34
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
35
|
-
JSON.stringify(error)), linkTokenType))));
|
|
34
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePaymentAccountLoginStatusFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Payment Account Login Status failed ' +
|
|
35
|
+
JSON.stringify(error)), linkTokenType, plaidAccountKeyType))));
|
|
36
36
|
}));
|
|
37
37
|
exports.updatePaymentAccountLoginStatusEpic = updatePaymentAccountLoginStatusEpic;
|
|
@@ -5,6 +5,6 @@ import { ZeniAPI } from '../../../../../zeniAPI';
|
|
|
5
5
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
6
|
import { updateAccounts } from '../../../../../entity/account/accountReducer';
|
|
7
7
|
import { updatePaymentAccounts } from '../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
8
|
-
import { updatePaymentAccountStatus, updatePaymentAccountStatusSuccess, updatePaymentAccountStatusFailure } from '../../
|
|
8
|
+
import { updatePaymentAccountStatus, updatePaymentAccountStatusSuccess, updatePaymentAccountStatusFailure } from '../../plaidAccountViewReducer';
|
|
9
9
|
export declare type ActionType = ReturnType<typeof updatePaymentAccountStatus> | ReturnType<typeof updateAccounts> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof openSnackbar> | ReturnType<typeof updatePaymentAccountStatusSuccess> | ReturnType<typeof updatePaymentAccountStatusFailure>;
|
|
10
10
|
export declare const updatePaymentAccountStatusEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -7,9 +7,9 @@ const responsePayload_1 = require("../../../../../responsePayload");
|
|
|
7
7
|
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const accountReducer_1 = require("../../../../../entity/account/accountReducer");
|
|
9
9
|
const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/paymentAccountReducer");
|
|
10
|
-
const
|
|
11
|
-
const updatePaymentAccountStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
12
|
-
const { verificationStatusCode, paymentAccountId, setupViewType, linkTokenType, } = action.payload;
|
|
10
|
+
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
11
|
+
const updatePaymentAccountStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.updatePaymentAccountStatus.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const { verificationStatusCode, paymentAccountId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
|
|
13
13
|
return zeniAPI
|
|
14
14
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/payment-accounts/${paymentAccountId}`, {
|
|
15
15
|
provider_verification_status_code: verificationStatusCode,
|
|
@@ -20,7 +20,7 @@ const updatePaymentAccountStatusEpic = (actions$, _state$, zeniAPI) => actions$.
|
|
|
20
20
|
const actions = [
|
|
21
21
|
(0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType),
|
|
22
22
|
(0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
|
|
23
|
-
(0,
|
|
23
|
+
(0, plaidAccountViewReducer_1.updatePaymentAccountStatusSuccess)(paymentAccountIds, linkTokenType, plaidAccountKeyType),
|
|
24
24
|
];
|
|
25
25
|
return (0, rxjs_1.from)(actions);
|
|
26
26
|
}
|
|
@@ -29,9 +29,9 @@ const updatePaymentAccountStatusEpic = (actions$, _state$, zeniAPI) => actions$.
|
|
|
29
29
|
messageSection: 'plaid_connection',
|
|
30
30
|
messageText: 'failed',
|
|
31
31
|
type: 'error',
|
|
32
|
-
}), (0,
|
|
32
|
+
}), (0, plaidAccountViewReducer_1.updatePaymentAccountStatusFailure)(response.status, linkTokenType, plaidAccountKeyType));
|
|
33
33
|
}
|
|
34
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
35
|
-
JSON.stringify(error)), linkTokenType))));
|
|
34
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePaymentAccountStatusFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Payment Account Status failed ' +
|
|
35
|
+
JSON.stringify(error)), linkTokenType, plaidAccountKeyType))));
|
|
36
36
|
}));
|
|
37
37
|
exports.updatePaymentAccountStatusEpic = updatePaymentAccountStatusEpic;
|
|
@@ -5,9 +5,9 @@ import { ZeniAPI } from '../../../../../zeniAPI';
|
|
|
5
5
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
6
|
import { updateAccounts } from '../../../../../entity/account/accountReducer';
|
|
7
7
|
import { updatePaymentAccounts } from '../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
8
|
-
import { establishPlaidConnection, establishPlaidConnectionSuccess, establishPlaidConnectionFailure } from '../../
|
|
8
|
+
import { establishPlaidConnection, establishPlaidConnectionSuccess, establishPlaidConnectionFailure } from '../../plaidAccountViewReducer';
|
|
9
9
|
import { updateBankAccounts } from '../../../../../entity/bankAccount/bankAccountReducer';
|
|
10
10
|
import { updateUserBankAccount } from '../../../../userFinancialAccount/userFinancialAccountReducer';
|
|
11
11
|
import { updatePaymentAccountList } from '../../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
|
|
12
|
-
export declare type ActionType = ReturnType<typeof establishPlaidConnection> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateUserBankAccount> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof openSnackbar> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof establishPlaidConnectionSuccess> | ReturnType<typeof
|
|
12
|
+
export declare type ActionType = ReturnType<typeof establishPlaidConnection> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateUserBankAccount> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof openSnackbar> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof establishPlaidConnectionSuccess> | ReturnType<typeof establishPlaidConnectionFailure>;
|
|
13
13
|
export declare const establishPlaidConnectionEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -7,13 +7,13 @@ const responsePayload_1 = require("../../../../../responsePayload");
|
|
|
7
7
|
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const accountReducer_1 = require("../../../../../entity/account/accountReducer");
|
|
9
9
|
const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/paymentAccountReducer");
|
|
10
|
-
const
|
|
10
|
+
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
11
11
|
const bankAccountReducer_1 = require("../../../../../entity/bankAccount/bankAccountReducer");
|
|
12
12
|
const userFinancialAccountReducer_1 = require("../../../../userFinancialAccount/userFinancialAccountReducer");
|
|
13
13
|
const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
14
|
-
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
14
|
+
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
var _a, _b;
|
|
16
|
-
const { publicToken, setupViewType, linkTokenType } = action.payload;
|
|
16
|
+
const { publicToken, setupViewType, linkTokenType, plaidAccountKeyType } = action.payload;
|
|
17
17
|
const requestPayload = {
|
|
18
18
|
public_token: publicToken,
|
|
19
19
|
};
|
|
@@ -38,7 +38,7 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
38
38
|
data: response.data.payment_accounts,
|
|
39
39
|
updateType: 'merge',
|
|
40
40
|
}),
|
|
41
|
-
(0,
|
|
41
|
+
(0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(paymentAccountIds, linkTokenType, plaidAccountKeyType),
|
|
42
42
|
];
|
|
43
43
|
if (response.data.bank_accounts != null) {
|
|
44
44
|
const bankAccountIds = response.data.bank_accounts.map((bank_account) => bank_account.bank_account_id);
|
|
@@ -62,9 +62,9 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
62
62
|
messageSection: 'plaid_connection',
|
|
63
63
|
messageText: 'failed',
|
|
64
64
|
type: 'error',
|
|
65
|
-
}), (0,
|
|
65
|
+
}), (0, plaidAccountViewReducer_1.establishPlaidConnectionFailure)(response.status, linkTokenType, plaidAccountKeyType));
|
|
66
66
|
}
|
|
67
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
68
|
-
JSON.stringify(error)), linkTokenType))));
|
|
67
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.establishPlaidConnectionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Establish Plaid Connection errored out' +
|
|
68
|
+
JSON.stringify(error)), linkTokenType, plaidAccountKeyType))));
|
|
69
69
|
}));
|
|
70
70
|
exports.establishPlaidConnectionEpic = establishPlaidConnectionEpic;
|
|
@@ -3,8 +3,8 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
5
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
|
-
import { getPlaidLinkToken, getPlaidLinkTokenSuccess, getPlaidLinkTokenFailure } from '../../
|
|
7
|
-
import { PlaidLinkTokenType } from '../../
|
|
6
|
+
import { getPlaidLinkToken, getPlaidLinkTokenSuccess, getPlaidLinkTokenFailure } from '../../plaidAccountViewReducer';
|
|
7
|
+
import { PlaidLinkTokenType } from '../../plaidAccountViewState';
|
|
8
8
|
import { ID } from '../../../../../commonStateTypes/common';
|
|
9
9
|
export declare type ActionType = ReturnType<typeof getPlaidLinkToken> | ReturnType<typeof openSnackbar> | ReturnType<typeof getPlaidLinkTokenSuccess> | ReturnType<typeof getPlaidLinkTokenFailure>;
|
|
10
10
|
export declare const getPlaidLinkTokenEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,15 +5,15 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
7
|
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const
|
|
9
|
-
const getPlaidLinkTokenEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
10
|
-
const { linkTokenType, paymentAccountId } = action.payload;
|
|
8
|
+
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
9
|
+
const getPlaidLinkTokenEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.getPlaidLinkToken.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { linkTokenType, paymentAccountId, plaidAccountKeyType } = action.payload;
|
|
11
11
|
return zeniAPI
|
|
12
12
|
.getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/link-token?query=${JSON.stringify((0, exports.toLinkTokenPayload)(linkTokenType, paymentAccountId))}`)
|
|
13
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
14
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
15
|
const actions = [
|
|
16
|
-
(0,
|
|
16
|
+
(0, plaidAccountViewReducer_1.getPlaidLinkTokenSuccess)(response.data.link_token, response.data.expiration, linkTokenType, plaidAccountKeyType),
|
|
17
17
|
];
|
|
18
18
|
return (0, rxjs_1.from)(actions);
|
|
19
19
|
}
|
|
@@ -22,9 +22,9 @@ const getPlaidLinkTokenEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
|
|
|
22
22
|
messageSection: 'plaid_connection',
|
|
23
23
|
messageText: 'failed',
|
|
24
24
|
type: 'error',
|
|
25
|
-
}), (0,
|
|
25
|
+
}), (0, plaidAccountViewReducer_1.getPlaidLinkTokenFailure)(response.status, linkTokenType, plaidAccountKeyType));
|
|
26
26
|
}
|
|
27
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
27
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.getPlaidLinkTokenFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Get Plaid Link Token errored out' + JSON.stringify(error)), linkTokenType, plaidAccountKeyType))));
|
|
28
28
|
}));
|
|
29
29
|
exports.getPlaidLinkTokenEpic = getPlaidLinkTokenEpic;
|
|
30
30
|
const toLinkTokenPayload = (linkTokenType, paymentAccountId) => {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
2
|
+
import { PlaidAccountKeyType, PlaidAccountViewState, PlaidLinkTokenType } from './plaidAccountViewState';
|
|
3
|
+
export declare const initialState: PlaidAccountViewState;
|
|
4
|
+
export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType, includeBalances?: any], {
|
|
5
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
|
|
6
|
+
includeBalances: any;
|
|
7
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
8
|
+
}, string, never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
|
|
9
|
+
paymentAccountIds: string[];
|
|
10
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
11
|
+
}, string, never, never>, getPaymentAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
12
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
13
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
14
|
+
}, string, never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType], {
|
|
15
|
+
accountId: string;
|
|
16
|
+
paymentAccountId: string;
|
|
17
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
|
|
18
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
19
|
+
}, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
|
|
20
|
+
paymentAccountIds: string[];
|
|
21
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
22
|
+
}, string, never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
23
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
24
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
25
|
+
}, string, never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
26
|
+
verificationStatusCode: string;
|
|
27
|
+
paymentAccountId: string;
|
|
28
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
|
|
29
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
30
|
+
linkTokenType: PlaidLinkTokenType;
|
|
31
|
+
}, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
32
|
+
paymentAccountIds: string[];
|
|
33
|
+
linkTokenType: PlaidLinkTokenType;
|
|
34
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
35
|
+
}, string, never, never>, updatePaymentAccountStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
36
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
37
|
+
linkTokenType: PlaidLinkTokenType;
|
|
38
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
39
|
+
}, string, never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
40
|
+
isLoginRequired: boolean;
|
|
41
|
+
paymentAccountId: string;
|
|
42
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
|
|
43
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
44
|
+
linkTokenType: PlaidLinkTokenType;
|
|
45
|
+
}, string, never, never>, updatePaymentAccountLoginStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
46
|
+
paymentAccountIds: string[];
|
|
47
|
+
linkTokenType: PlaidLinkTokenType;
|
|
48
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
49
|
+
}, string, never, never>, updatePaymentAccountLoginStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
50
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
51
|
+
linkTokenType: PlaidLinkTokenType;
|
|
52
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
53
|
+
}, string, never, never>, getPlaidLinkToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined, paymentAccountId?: string | undefined], {
|
|
54
|
+
linkTokenType: PlaidLinkTokenType;
|
|
55
|
+
paymentAccountId: string | undefined;
|
|
56
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
57
|
+
}, string, never, never>, getPlaidLinkTokenSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkToken: string, expiration: string, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
58
|
+
linkToken: string;
|
|
59
|
+
expiration: string;
|
|
60
|
+
linkTokenType: PlaidLinkTokenType;
|
|
61
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
62
|
+
}, string, never, never>, getPlaidLinkTokenFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
63
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
64
|
+
linkTokenType: PlaidLinkTokenType;
|
|
65
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
66
|
+
}, string, never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
67
|
+
publicToken: string;
|
|
68
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined;
|
|
69
|
+
linkTokenType: PlaidLinkTokenType;
|
|
70
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
71
|
+
}, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
72
|
+
paymentAccountIds: string[];
|
|
73
|
+
linkTokenType: PlaidLinkTokenType;
|
|
74
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
75
|
+
}, string, never, never>, establishPlaidConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
76
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
77
|
+
linkTokenType: PlaidLinkTokenType;
|
|
78
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
79
|
+
}, string, never, never>, updatePlaidAccountViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
|
|
80
|
+
allBankAccountIds: string[];
|
|
81
|
+
paymentAccountIds: string[];
|
|
82
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
83
|
+
}, string, never, never>, clearPlaidAccountView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
84
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<PlaidAccountViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
85
|
+
export default _default;
|