@zeniai/client-epic-state 4.11.58 → 4.11.59
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/cardPayment/cardPaymentPayload.d.ts +2 -2
- package/lib/entity/cardPayment/cardPaymentPayload.js +14 -11
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/company/companyPayload.d.ts +12 -0
- package/lib/entity/company/companyPayload.js +21 -0
- package/lib/entity/company/companyReducer.d.ts +7 -0
- package/lib/entity/company/companyReducer.js +22 -2
- package/lib/entity/company/companyStateTypes.d.ts +12 -0
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +2 -0
- package/lib/entity/paymentAccount/paymentAccountPayload.js +2 -0
- package/lib/entity/paymentAccount/paymentAccountState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/epic/fetchAllTenantsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/fetchAllTenantsEpic.js +16 -3
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/index.d.ts +11 -11
- package/lib/index.js +22 -18
- package/lib/view/bankAccountView/epic/createBankAccountEpic.js +5 -3
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +2 -0
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/referralView/referralState.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +45 -41
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +6 -4
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +29 -6
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.d.ts +3 -1
- package/lib/view/settingsView/settingsViewReducer.js +11 -2
- package/lib/view/settingsView/settingsViewSelector.d.ts +1 -1
- package/lib/view/settingsView/settingsViewSelector.js +59 -7
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +10 -2
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -3
- package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +4 -1
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +16 -4
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.js +1 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +3 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.js +20 -3
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +4 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.js +18 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.js +25 -6
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +15 -12
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +6 -6
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +4 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +16 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +47 -31
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +4 -5
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +59 -12
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +52 -16
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/getPlaidLinkTokenEpic.js +1 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +21 -27
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +47 -74
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +3 -8
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +6 -3
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +6 -19
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +4 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +20 -9
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +6 -6
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +6 -6
- package/package.json +2 -2
package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js
CHANGED
|
@@ -11,9 +11,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 companyReducer_1 = require("../../../../../entity/company/companyReducer");
|
|
14
15
|
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
|
|
15
16
|
var _a, _b;
|
|
16
|
-
const { publicToken, setupViewType, linkTokenType, plaidAccountKeyType } = action.payload;
|
|
17
|
+
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
|
|
17
18
|
const requestPayload = {
|
|
18
19
|
public_token: publicToken,
|
|
19
20
|
};
|
|
@@ -23,39 +24,74 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
23
24
|
if (setupViewType == null) {
|
|
24
25
|
requestPayload.is_user_account = true;
|
|
25
26
|
}
|
|
27
|
+
else if (plaidAccountKeyType === 'bill_pay_setup') {
|
|
28
|
+
requestPayload.is_primary_for_bill_pay = true;
|
|
29
|
+
}
|
|
26
30
|
else if (plaidAccountKeyType === 'reimbursement_setup') {
|
|
27
31
|
requestPayload.is_primary_for_reimbursements = true;
|
|
28
32
|
}
|
|
33
|
+
else if (plaidAccountKeyType === 'charge_card_setup') {
|
|
34
|
+
requestPayload.is_primary_for_charge_cards = true;
|
|
35
|
+
}
|
|
36
|
+
else if (plaidAccountKeyType === 'account_setup') {
|
|
37
|
+
requestPayload.is_primary_for_deposit_accounts = true;
|
|
38
|
+
}
|
|
29
39
|
else if (plaidAccountKeyType === 'billing_setup') {
|
|
30
40
|
requestPayload.is_primary_for_onboarding = true;
|
|
31
41
|
}
|
|
32
|
-
else {
|
|
33
|
-
requestPayload.is_primary_for_bill_pay = true;
|
|
34
|
-
}
|
|
35
42
|
}
|
|
36
43
|
return zeniAPI
|
|
37
44
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token`, requestPayload)
|
|
38
45
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
39
46
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
40
|
-
const
|
|
41
|
-
// the payment account received in the response is the new primary funding account
|
|
42
|
-
const primaryFundingAccountId = paymentAccountIds[0];
|
|
43
|
-
const existingPaymentAccountIds = state.value.plaidAccountViewState['reimbursement_setup']
|
|
44
|
-
.accountDetails.paymentAccountIds;
|
|
47
|
+
const paymentAccount = response.data.payment_accounts[0];
|
|
45
48
|
const actions = [
|
|
46
49
|
(0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
|
|
47
50
|
(0, paymentAccountListReducer_1.updatePaymentAccountList)({
|
|
48
51
|
data: response.data.payment_accounts,
|
|
49
52
|
updateType: 'merge',
|
|
50
53
|
}),
|
|
51
|
-
(0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(
|
|
54
|
+
(0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(linkTokenType, plaidAccountKeyType),
|
|
52
55
|
];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
if (setupViewType != null) {
|
|
57
|
+
const primaryAccountForProducts = [];
|
|
58
|
+
// if the account added is primary for any product, it should be reflected on that setup page without refresh also
|
|
59
|
+
// this happens when the first external account is added - it becomes primary for rest of the products also
|
|
60
|
+
if (paymentAccount.is_primary_for_bill_pay === true) {
|
|
61
|
+
primaryAccountForProducts.push('bill_pay');
|
|
62
|
+
}
|
|
63
|
+
if (paymentAccount.is_primary_for_bill_pay === true) {
|
|
64
|
+
actions.push((0, companyReducer_1.updateCompanyPrimaryAccount)({
|
|
65
|
+
companyId: companyId,
|
|
66
|
+
primaryFundingAccountId: paymentAccount.payment_account_id,
|
|
67
|
+
accountType: 'paymentAccount',
|
|
68
|
+
productType: 'bill_pay',
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
if (paymentAccount.is_primary_for_reimbursements === true) {
|
|
72
|
+
actions.push((0, companyReducer_1.updateCompanyPrimaryAccount)({
|
|
73
|
+
companyId: companyId,
|
|
74
|
+
primaryFundingAccountId: paymentAccount.payment_account_id,
|
|
75
|
+
accountType: 'paymentAccount',
|
|
76
|
+
productType: 'reimbursement',
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
if (paymentAccount.is_primary_for_charge_cards === true) {
|
|
80
|
+
actions.push((0, companyReducer_1.updateCompanyPrimaryAccount)({
|
|
81
|
+
companyId: companyId,
|
|
82
|
+
primaryFundingAccountId: paymentAccount.payment_account_id,
|
|
83
|
+
accountType: 'paymentAccount',
|
|
84
|
+
productType: 'charge_cards',
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
if (paymentAccount.is_primary_for_deposit_accounts === true) {
|
|
88
|
+
actions.push((0, companyReducer_1.updateCompanyPrimaryAccount)({
|
|
89
|
+
companyId: companyId,
|
|
90
|
+
primaryFundingAccountId: paymentAccount.payment_account_id,
|
|
91
|
+
accountType: 'paymentAccount',
|
|
92
|
+
productType: 'zeni_accounts',
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
59
95
|
}
|
|
60
96
|
if (response.data.bank_accounts != null) {
|
|
61
97
|
const bankAccountIds = response.data.bank_accounts.map((bank_account) => bank_account.bank_account_id);
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
7
|
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
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.
|
|
9
|
+
const getPlaidLinkTokenEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.getPlaidLinkToken.match), (0, operators_1.mergeMap)((action) => {
|
|
10
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))}`)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
2
1
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
2
|
import { PlaidAccountKeyType, PlaidAccountViewState, PlaidLinkTokenType } from './plaidAccountViewState';
|
|
4
3
|
export declare const initialState: PlaidAccountViewState;
|
|
@@ -17,8 +16,7 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
17
16
|
paymentAccountId: string;
|
|
18
17
|
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
|
|
19
18
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
20
|
-
}, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
21
|
-
paymentAccountIds: string[];
|
|
19
|
+
}, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
|
|
22
20
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
23
21
|
}, string, never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
24
22
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
@@ -29,8 +27,7 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
29
27
|
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
|
|
30
28
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
31
29
|
linkTokenType: PlaidLinkTokenType;
|
|
32
|
-
}, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
33
|
-
paymentAccountIds: string[];
|
|
30
|
+
}, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
34
31
|
linkTokenType: PlaidLinkTokenType;
|
|
35
32
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
36
33
|
}, string, never, never>, updatePaymentAccountStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -64,44 +61,41 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
64
61
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
65
62
|
linkTokenType: PlaidLinkTokenType;
|
|
66
63
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
67
|
-
}, string, never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
64
|
+
}, string, never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
68
65
|
publicToken: string;
|
|
66
|
+
companyId: string;
|
|
69
67
|
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined;
|
|
70
68
|
linkTokenType: PlaidLinkTokenType;
|
|
71
69
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
72
|
-
}, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
73
|
-
primaryFundingAccountId: string;
|
|
74
|
-
paymentAccountIds: string[];
|
|
70
|
+
}, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
75
71
|
linkTokenType: PlaidLinkTokenType;
|
|
76
72
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
77
73
|
}, string, never, never>, establishPlaidConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
78
74
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
79
75
|
linkTokenType: PlaidLinkTokenType;
|
|
80
76
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
81
|
-
}, string, never, never>, updatePlaidAccountViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[],
|
|
82
|
-
accountId: ID;
|
|
83
|
-
accountType: string;
|
|
84
|
-
} | undefined], {
|
|
77
|
+
}, string, never, never>, updatePlaidAccountViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
|
|
85
78
|
allBankAccountIds: string[];
|
|
86
|
-
paymentAccountIds: string[];
|
|
87
79
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
88
|
-
|
|
89
|
-
primaryFundingAccount: {
|
|
90
|
-
accountId: ID;
|
|
91
|
-
accountType: string;
|
|
92
|
-
} | undefined;
|
|
93
|
-
}, string, never, never>, updatePrimaryFundingAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, accountId: string, accountType: string], {
|
|
80
|
+
}, string, never, never>, updatePrimaryFundingAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, plaidAccountKeyType: PlaidAccountKeyType, accountId: string, accountType: string], {
|
|
94
81
|
companyId: string;
|
|
82
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
95
83
|
accountId: string;
|
|
96
84
|
accountType: string;
|
|
97
|
-
}, string, never, never>, updatePrimaryFundingAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
}, string, never, never>, updatePrimaryFundingAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
|
|
86
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
87
|
+
}, string, never, never>, updatePrimaryFundingAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
88
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
89
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
90
|
+
}, string, never, never>, updateMappedCashAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, accountId: string, depositAccountId: string], {
|
|
91
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
101
92
|
accountId: string;
|
|
102
93
|
depositAccountId: string;
|
|
103
|
-
}, string, never, never>, updateMappedCashAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
104
|
-
|
|
105
|
-
}, string, never, never>, updateMappedCashAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>],
|
|
94
|
+
}, string, never, never>, updateMappedCashAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
|
|
95
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
96
|
+
}, string, never, never>, updateMappedCashAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
97
|
+
plaidAccountKeyType: PlaidAccountKeyType;
|
|
98
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
99
|
+
}, string, never, never>, clearPlaidAccountView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
106
100
|
declare const _default: import("@reduxjs/toolkit").Reducer<PlaidAccountViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
107
101
|
export default _default;
|
|
@@ -7,9 +7,12 @@ const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
|
7
7
|
const plaidAccountViewState_1 = require("./plaidAccountViewState");
|
|
8
8
|
exports.initialState = {
|
|
9
9
|
spend_management_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
10
|
+
bill_pay_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
11
|
+
reimbursement_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
12
|
+
account_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
13
|
+
charge_card_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
10
14
|
user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
11
15
|
external_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
12
|
-
reimbursement_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
13
16
|
billing_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
14
17
|
};
|
|
15
18
|
const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
@@ -36,7 +39,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
36
39
|
},
|
|
37
40
|
getPaymentAccountsSuccess: {
|
|
38
41
|
reducer(draft, action) {
|
|
39
|
-
const {
|
|
42
|
+
const { plaidAccountKeyType, paymentAccountIds } = action.payload;
|
|
40
43
|
draft[plaidAccountKeyType].accountDetails.fetchStatus = {
|
|
41
44
|
fetchState: 'Completed',
|
|
42
45
|
error: undefined,
|
|
@@ -67,7 +70,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
67
70
|
updatePaymentAccount: {
|
|
68
71
|
reducer(draft, action) {
|
|
69
72
|
const { plaidAccountKeyType } = action.payload;
|
|
70
|
-
draft[plaidAccountKeyType].accountDetails.
|
|
73
|
+
draft[plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
|
|
71
74
|
fetchState: 'In-Progress',
|
|
72
75
|
error: undefined,
|
|
73
76
|
};
|
|
@@ -86,21 +89,21 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
86
89
|
updatePaymentAccountSuccess: {
|
|
87
90
|
reducer(draft, action) {
|
|
88
91
|
const { plaidAccountKeyType } = action.payload;
|
|
89
|
-
draft[plaidAccountKeyType].accountDetails.
|
|
92
|
+
draft[plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
|
|
90
93
|
fetchState: 'Completed',
|
|
91
94
|
error: undefined,
|
|
92
95
|
};
|
|
93
96
|
},
|
|
94
|
-
prepare(
|
|
97
|
+
prepare(plaidAccountKeyType) {
|
|
95
98
|
return {
|
|
96
|
-
payload: {
|
|
99
|
+
payload: { plaidAccountKeyType },
|
|
97
100
|
};
|
|
98
101
|
},
|
|
99
102
|
},
|
|
100
103
|
updatePaymentAccountFailure: {
|
|
101
104
|
reducer(draft, action) {
|
|
102
105
|
const { error, plaidAccountKeyType } = action.payload;
|
|
103
|
-
draft[plaidAccountKeyType].accountDetails.
|
|
106
|
+
draft[plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
|
|
104
107
|
fetchState: 'Error',
|
|
105
108
|
error,
|
|
106
109
|
};
|
|
@@ -133,19 +136,15 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
133
136
|
},
|
|
134
137
|
updatePaymentAccountStatusSuccess: {
|
|
135
138
|
reducer(draft, action) {
|
|
136
|
-
const {
|
|
139
|
+
const { linkTokenType, plaidAccountKeyType } = action.payload;
|
|
137
140
|
draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
|
|
138
141
|
fetchState: 'Completed',
|
|
139
142
|
error: undefined,
|
|
140
143
|
} });
|
|
141
|
-
if (plaidAccountKeyType !== 'reimbursement_setup') {
|
|
142
|
-
draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
|
|
143
|
-
paymentAccountIds;
|
|
144
|
-
}
|
|
145
144
|
},
|
|
146
|
-
prepare(
|
|
145
|
+
prepare(linkTokenType, plaidAccountKeyType) {
|
|
147
146
|
return {
|
|
148
|
-
payload: {
|
|
147
|
+
payload: { linkTokenType, plaidAccountKeyType },
|
|
149
148
|
};
|
|
150
149
|
},
|
|
151
150
|
},
|
|
@@ -185,13 +184,11 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
185
184
|
},
|
|
186
185
|
updatePaymentAccountLoginStatusSuccess: {
|
|
187
186
|
reducer(draft, action) {
|
|
188
|
-
const {
|
|
187
|
+
const { linkTokenType, plaidAccountKeyType } = action.payload;
|
|
189
188
|
draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
|
|
190
189
|
fetchState: 'Completed',
|
|
191
190
|
error: undefined,
|
|
192
191
|
} });
|
|
193
|
-
draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
|
|
194
|
-
paymentAccountIds;
|
|
195
192
|
},
|
|
196
193
|
prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
|
|
197
194
|
return {
|
|
@@ -215,17 +212,11 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
215
212
|
},
|
|
216
213
|
getPlaidLinkToken: {
|
|
217
214
|
reducer(draft, action) {
|
|
218
|
-
const { linkTokenType,
|
|
215
|
+
const { linkTokenType, plaidAccountKeyType } = action.payload;
|
|
219
216
|
draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { fetchStatus: {
|
|
220
217
|
fetchState: 'In-Progress',
|
|
221
218
|
error: undefined,
|
|
222
219
|
} });
|
|
223
|
-
if (paymentAccountId != null &&
|
|
224
|
-
plaidAccountKeyType !== 'reimbursement_setup') {
|
|
225
|
-
draft[plaidAccountKeyType].accountDetails.paymentAccountIds = [
|
|
226
|
-
paymentAccountId,
|
|
227
|
-
];
|
|
228
|
-
}
|
|
229
220
|
},
|
|
230
221
|
prepare(plaidAccountKeyType, linkTokenType, paymentAccountId) {
|
|
231
222
|
return {
|
|
@@ -273,10 +264,11 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
273
264
|
error: undefined,
|
|
274
265
|
} });
|
|
275
266
|
},
|
|
276
|
-
prepare(publicToken, plaidAccountKeyType, setupViewType, linkTokenType) {
|
|
267
|
+
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType) {
|
|
277
268
|
return {
|
|
278
269
|
payload: {
|
|
279
270
|
publicToken,
|
|
271
|
+
companyId,
|
|
280
272
|
setupViewType,
|
|
281
273
|
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
282
274
|
plaidAccountKeyType,
|
|
@@ -286,23 +278,15 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
286
278
|
},
|
|
287
279
|
establishPlaidConnectionSuccess: {
|
|
288
280
|
reducer(draft, action) {
|
|
289
|
-
const {
|
|
281
|
+
const { linkTokenType, plaidAccountKeyType } = action.payload;
|
|
290
282
|
draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
|
|
291
283
|
fetchState: 'Completed',
|
|
292
284
|
error: undefined,
|
|
293
285
|
} });
|
|
294
|
-
draft[plaidAccountKeyType].accountDetails.primaryFundingAccount = {
|
|
295
|
-
accountId: primaryFundingAccountId,
|
|
296
|
-
accountType: 'paymentAccount',
|
|
297
|
-
};
|
|
298
|
-
draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
|
|
299
|
-
paymentAccountIds;
|
|
300
286
|
},
|
|
301
|
-
prepare(
|
|
287
|
+
prepare(linkTokenType, plaidAccountKeyType) {
|
|
302
288
|
return {
|
|
303
289
|
payload: {
|
|
304
|
-
primaryFundingAccountId,
|
|
305
|
-
paymentAccountIds,
|
|
306
290
|
linkTokenType,
|
|
307
291
|
plaidAccountKeyType,
|
|
308
292
|
},
|
|
@@ -324,27 +308,18 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
324
308
|
},
|
|
325
309
|
},
|
|
326
310
|
updatePlaidAccountViewAccountDetails: {
|
|
327
|
-
prepare(allBankAccountIds,
|
|
311
|
+
prepare(allBankAccountIds, plaidAccountKeyType) {
|
|
328
312
|
return {
|
|
329
313
|
payload: {
|
|
330
314
|
allBankAccountIds,
|
|
331
|
-
paymentAccountIds,
|
|
332
315
|
plaidAccountKeyType,
|
|
333
|
-
depositAccountIds,
|
|
334
|
-
primaryFundingAccount,
|
|
335
316
|
},
|
|
336
317
|
};
|
|
337
318
|
},
|
|
338
319
|
reducer(draft, action) {
|
|
339
|
-
const { allBankAccountIds,
|
|
320
|
+
const { allBankAccountIds, plaidAccountKeyType } = action.payload;
|
|
340
321
|
draft[plaidAccountKeyType].accountDetails.allBankAccountIds =
|
|
341
322
|
allBankAccountIds;
|
|
342
|
-
draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
|
|
343
|
-
paymentAccountIds;
|
|
344
|
-
draft[plaidAccountKeyType].accountDetails.depositAccountIds =
|
|
345
|
-
depositAccountIds !== null && depositAccountIds !== void 0 ? depositAccountIds : [];
|
|
346
|
-
draft[plaidAccountKeyType].accountDetails.primaryFundingAccount =
|
|
347
|
-
primaryFundingAccount;
|
|
348
323
|
draft[plaidAccountKeyType].accountDetails.fetchStatus = {
|
|
349
324
|
fetchState: 'Completed',
|
|
350
325
|
error: undefined,
|
|
@@ -352,81 +327,79 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
352
327
|
},
|
|
353
328
|
},
|
|
354
329
|
updatePrimaryFundingAccount: {
|
|
355
|
-
reducer(draft) {
|
|
356
|
-
draft[
|
|
330
|
+
reducer(draft, action) {
|
|
331
|
+
draft[action.payload.plaidAccountKeyType].accountDetails.primaryFundingAccountUpdateStatus = {
|
|
357
332
|
fetchState: 'In-Progress',
|
|
358
333
|
error: undefined,
|
|
359
334
|
};
|
|
360
335
|
},
|
|
361
|
-
prepare(companyId, accountId, accountType) {
|
|
362
|
-
return {
|
|
336
|
+
prepare(companyId, plaidAccountKeyType, accountId, accountType) {
|
|
337
|
+
return {
|
|
338
|
+
payload: { companyId, plaidAccountKeyType, accountId, accountType },
|
|
339
|
+
};
|
|
363
340
|
},
|
|
364
341
|
},
|
|
365
342
|
updatePrimaryFundingAccountSuccess: {
|
|
366
343
|
reducer(draft, action) {
|
|
367
|
-
const {
|
|
368
|
-
draft[
|
|
344
|
+
const { plaidAccountKeyType } = action.payload;
|
|
345
|
+
draft[plaidAccountKeyType].accountDetails.primaryFundingAccountUpdateStatus = {
|
|
369
346
|
fetchState: 'Completed',
|
|
370
347
|
error: undefined,
|
|
371
348
|
};
|
|
372
|
-
draft['reimbursement_setup'].accountDetails.primaryFundingAccount = {
|
|
373
|
-
accountId: accountId,
|
|
374
|
-
accountType: accountType,
|
|
375
|
-
};
|
|
376
349
|
},
|
|
377
|
-
prepare(
|
|
350
|
+
prepare(plaidAccountKeyType) {
|
|
378
351
|
return {
|
|
379
|
-
payload: {
|
|
352
|
+
payload: { plaidAccountKeyType },
|
|
380
353
|
};
|
|
381
354
|
},
|
|
382
355
|
},
|
|
383
356
|
updatePrimaryFundingAccountFailure: {
|
|
384
357
|
reducer(draft, action) {
|
|
385
|
-
draft[
|
|
358
|
+
draft[action.payload.plaidAccountKeyType].accountDetails.primaryFundingAccountUpdateStatus = {
|
|
386
359
|
fetchState: 'Error',
|
|
387
|
-
error: action.payload,
|
|
360
|
+
error: action.payload.error,
|
|
388
361
|
};
|
|
389
362
|
},
|
|
390
|
-
prepare(error) {
|
|
363
|
+
prepare(plaidAccountKeyType, error) {
|
|
391
364
|
return {
|
|
392
|
-
payload: error,
|
|
365
|
+
payload: { error, plaidAccountKeyType },
|
|
393
366
|
};
|
|
394
367
|
},
|
|
395
368
|
},
|
|
396
369
|
updateMappedCashAccount: {
|
|
397
|
-
reducer(draft) {
|
|
398
|
-
draft[
|
|
370
|
+
reducer(draft, action) {
|
|
371
|
+
draft[action.payload.plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
|
|
399
372
|
fetchState: 'In-Progress',
|
|
400
373
|
error: undefined,
|
|
401
374
|
};
|
|
402
375
|
},
|
|
403
|
-
prepare(accountId, depositAccountId) {
|
|
404
|
-
return { payload: { accountId, depositAccountId } };
|
|
376
|
+
prepare(plaidAccountKeyType, accountId, depositAccountId) {
|
|
377
|
+
return { payload: { plaidAccountKeyType, accountId, depositAccountId } };
|
|
405
378
|
},
|
|
406
379
|
},
|
|
407
380
|
updateMappedCashAccountSuccess: {
|
|
408
|
-
reducer(draft) {
|
|
409
|
-
draft[
|
|
381
|
+
reducer(draft, action) {
|
|
382
|
+
draft[action.payload.plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
|
|
410
383
|
fetchState: 'Completed',
|
|
411
384
|
error: undefined,
|
|
412
385
|
};
|
|
413
386
|
},
|
|
414
|
-
prepare(
|
|
387
|
+
prepare(plaidAccountKeyType) {
|
|
415
388
|
return {
|
|
416
|
-
payload: {
|
|
389
|
+
payload: { plaidAccountKeyType },
|
|
417
390
|
};
|
|
418
391
|
},
|
|
419
392
|
},
|
|
420
393
|
updateMappedCashAccountFailure: {
|
|
421
394
|
reducer(draft, action) {
|
|
422
|
-
draft[
|
|
395
|
+
draft[action.payload.plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
|
|
423
396
|
fetchState: 'Error',
|
|
424
|
-
error: action.payload,
|
|
397
|
+
error: action.payload.error,
|
|
425
398
|
};
|
|
426
399
|
},
|
|
427
|
-
prepare(error) {
|
|
400
|
+
prepare(plaidAccountKeyType, error) {
|
|
428
401
|
return {
|
|
429
|
-
payload: error,
|
|
402
|
+
payload: { plaidAccountKeyType, error },
|
|
430
403
|
};
|
|
431
404
|
},
|
|
432
405
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
export declare type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
4
|
-
export declare type PlaidAccountKeyType = 'spend_management_setup' | 'reimbursement_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup';
|
|
4
|
+
export declare type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup';
|
|
5
5
|
export declare type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
6
6
|
linkToken?: string;
|
|
7
7
|
expiration?: ZeniDate;
|
|
@@ -12,15 +12,10 @@ export declare const initialPlaidAccountState: PlaidAccountState;
|
|
|
12
12
|
export interface PlaidAccountState {
|
|
13
13
|
accountDetails: {
|
|
14
14
|
fetchStatus: FetchStateAndError;
|
|
15
|
-
|
|
15
|
+
cashAccountUpdateStatus: FetchStateAndError;
|
|
16
16
|
primaryFundingAccountUpdateStatus?: FetchStateAndError;
|
|
17
|
-
primaryFundingAccount?: {
|
|
18
|
-
accountId: ID;
|
|
19
|
-
accountType: string;
|
|
20
|
-
};
|
|
21
|
-
paymentAccountIds: ID[];
|
|
22
|
-
depositAccountIds: ID[];
|
|
23
17
|
allBankAccountIds: ID[];
|
|
18
|
+
paymentAccountIds: ID[];
|
|
24
19
|
};
|
|
25
20
|
plaidConnectionDetails: PlaidConnectionDetails;
|
|
26
21
|
}
|
|
@@ -4,10 +4,13 @@ exports.initialPlaidAccountState = void 0;
|
|
|
4
4
|
exports.initialPlaidAccountState = {
|
|
5
5
|
accountDetails: {
|
|
6
6
|
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
cashAccountUpdateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
8
|
+
primaryFundingAccountUpdateStatus: {
|
|
9
|
+
fetchState: 'Not-Started',
|
|
10
|
+
error: undefined,
|
|
11
|
+
},
|
|
10
12
|
allBankAccountIds: [],
|
|
13
|
+
paymentAccountIds: [],
|
|
11
14
|
},
|
|
12
15
|
plaidConnectionDetails: {
|
|
13
16
|
link_account: {
|
|
@@ -16,8 +16,6 @@ const snackbarReducer_1 = require("../../../../../../entity/snackbar/snackbarRed
|
|
|
16
16
|
const setupViewReducer_1 = require("../../../../commonSetup/setupViewReducer");
|
|
17
17
|
const remiSetupViewReducer_1 = require("../../remiSetupViewReducer");
|
|
18
18
|
const plaidAccountViewReducer_1 = require("../../../../plaidAccount/plaidAccountViewReducer");
|
|
19
|
-
const billPayConfigPayload_1 = require("../../../../billPay/billPayConfig/billPayConfigPayload");
|
|
20
|
-
const billPayConfigState_1 = require("../../../../billPay/billPayConfig/billPayConfigState");
|
|
21
19
|
const depositAccountReducer_1 = require("../../../../../../entity/depositAccount/depositAccountReducer");
|
|
22
20
|
const paymentAccountListReducer_1 = require("../../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
23
21
|
const depositAccountListReducer_1 = require("../../../../zeniAccounts/depositAccountList/depositAccountListReducer");
|
|
@@ -34,20 +32,9 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
34
32
|
return zeniAPI
|
|
35
33
|
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"reimbursement_setup"}`)
|
|
36
34
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
37
|
-
var _a, _b, _c
|
|
35
|
+
var _a, _b, _c;
|
|
38
36
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
39
37
|
const allBankAccountIds = response.data.accounts.map((account) => account.account_id);
|
|
40
|
-
const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
|
|
41
|
-
const depositAccountIds = (_a = response.data.deposit_accounts) === null || _a === void 0 ? void 0 : _a.map((depositAccount) => depositAccount.deposit_account_id);
|
|
42
|
-
const primaryFundingAccountPayload = response.data.companies[0].reimbursement_info
|
|
43
|
-
.primary_funding_account;
|
|
44
|
-
const primaryFundingAccount = primaryFundingAccountPayload.account_id != null &&
|
|
45
|
-
primaryFundingAccountPayload.account_type != null
|
|
46
|
-
? {
|
|
47
|
-
accountId: primaryFundingAccountPayload.account_id,
|
|
48
|
-
accountType: (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)((0, billPayConfigState_1.toAccType)(primaryFundingAccountPayload.account_type)),
|
|
49
|
-
}
|
|
50
|
-
: undefined;
|
|
51
38
|
const actions = [
|
|
52
39
|
(0, userReducer_1.updateAllUsers)({ users: response.data.users }),
|
|
53
40
|
(0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
|
|
@@ -63,9 +50,9 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
63
50
|
data: response.data.payment_accounts,
|
|
64
51
|
updateType: 'replace',
|
|
65
52
|
}),
|
|
66
|
-
(0, depositAccountReducer_1.updateDepositAccounts)((
|
|
53
|
+
(0, depositAccountReducer_1.updateDepositAccounts)((_a = response.data.deposit_accounts) !== null && _a !== void 0 ? _a : []),
|
|
67
54
|
(0, depositAccountListReducer_1.updateDepositAccountList)({
|
|
68
|
-
data: (
|
|
55
|
+
data: (_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.deposit_accounts) !== null && _c !== void 0 ? _c : [],
|
|
69
56
|
updateType: 'replace',
|
|
70
57
|
}),
|
|
71
58
|
(0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
@@ -74,7 +61,7 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
74
61
|
(0, remiSetupViewReducer_1.updateRemiSetupViewLocalStoreData)({
|
|
75
62
|
companyId: response.data.companies[0].company_id,
|
|
76
63
|
}),
|
|
77
|
-
(0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds,
|
|
64
|
+
(0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'reimbursement_setup'),
|
|
78
65
|
(0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)(),
|
|
79
66
|
];
|
|
80
67
|
return (0, rxjs_1.from)(actions);
|
|
@@ -89,10 +76,10 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
89
76
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, remiSetupViewReducer_1.fetchRemiSetupViewFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Remi Setup view errored out' + JSON.stringify(error))))));
|
|
90
77
|
}
|
|
91
78
|
else {
|
|
92
|
-
const { allBankAccountIds
|
|
79
|
+
const { allBankAccountIds } = plaidAccountViewState['reimbursement_setup'].accountDetails;
|
|
93
80
|
return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
94
81
|
companyId,
|
|
95
|
-
}), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds,
|
|
82
|
+
}), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'reimbursement_setup'), (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)());
|
|
96
83
|
}
|
|
97
84
|
}));
|
|
98
85
|
exports.fetchRemiSetupViewEpic = fetchRemiSetupViewEpic;
|
|
@@ -9,12 +9,12 @@ const paymentAccountListSelector_1 = require("../paymentAccountList/paymentAccou
|
|
|
9
9
|
const zeniAccountsConfigSelector_1 = require("../zeniAccountsConfig/zeniAccountsConfigSelector");
|
|
10
10
|
const getZeniAccountList = (state, companyId) => {
|
|
11
11
|
const { zeniAccountListState, depositAccountState, paymentAccountState, plaidAccountViewState, depositAccountListState, paymentAccountListState, } = state;
|
|
12
|
-
const {
|
|
12
|
+
const { plaidConnectionDetails } = plaidAccountViewState['external_account'];
|
|
13
13
|
const depositAccountsSelectorView = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState);
|
|
14
14
|
const zeniAccountsConfig = (0, zeniAccountsConfigSelector_1.getZeniAccountsConfigDetail)(state);
|
|
15
15
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
16
16
|
const companyBillPayInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo;
|
|
17
|
-
const { paymentAccountIds } =
|
|
17
|
+
const { paymentAccountIds } = paymentAccountListState;
|
|
18
18
|
const externalAccountsSelectorView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
19
19
|
let summary = undefined;
|
|
20
20
|
if (zeniAccountListState.currentTab.id === 'zeniAccounts') {
|