@zeniai/client-epic-state 4.11.56 → 4.11.58

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.
Files changed (73) hide show
  1. package/lib/entity/cardPayment/cardPaymentPayload.d.ts +2 -2
  2. package/lib/entity/cardPayment/cardPaymentPayload.js +11 -14
  3. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  4. package/lib/entity/company/companyPayload.d.ts +0 -12
  5. package/lib/entity/company/companyPayload.js +0 -21
  6. package/lib/entity/company/companyReducer.d.ts +0 -7
  7. package/lib/entity/company/companyReducer.js +2 -22
  8. package/lib/entity/company/companyStateTypes.d.ts +0 -12
  9. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  10. package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +0 -2
  11. package/lib/entity/paymentAccount/paymentAccountPayload.js +0 -2
  12. package/lib/entity/paymentAccount/paymentAccountState.d.ts +0 -2
  13. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  14. package/lib/entity/tenant/epic/fetchAllTenantsEpic.d.ts +3 -3
  15. package/lib/entity/tenant/epic/fetchAllTenantsEpic.js +3 -16
  16. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  17. package/lib/index.d.ts +9 -9
  18. package/lib/index.js +18 -21
  19. package/lib/view/bankAccountView/epic/createBankAccountEpic.js +3 -5
  20. package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
  21. package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
  22. package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
  23. package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
  24. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
  25. package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +0 -2
  26. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  27. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  28. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  29. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  30. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  31. package/lib/view/referralView/referralState.d.ts +1 -1
  32. package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +41 -45
  33. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  34. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +4 -6
  35. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +6 -29
  36. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  37. package/lib/view/settingsView/settingsViewReducer.d.ts +1 -3
  38. package/lib/view/settingsView/settingsViewReducer.js +2 -11
  39. package/lib/view/settingsView/settingsViewSelector.d.ts +1 -1
  40. package/lib/view/settingsView/settingsViewSelector.js +7 -59
  41. package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +2 -10
  42. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -2
  43. package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
  44. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +1 -4
  45. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +4 -16
  46. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +12 -15
  47. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +2 -2
  48. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +6 -6
  49. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +2 -1
  50. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
  51. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +1 -4
  52. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +4 -16
  53. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -4
  54. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +31 -47
  55. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +5 -4
  56. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
  57. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
  58. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +12 -34
  59. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
  60. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +16 -52
  61. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/getPlaidLinkTokenEpic.js +1 -1
  62. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +27 -21
  63. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +74 -47
  64. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +8 -3
  65. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +3 -6
  66. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +19 -6
  67. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
  68. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +1 -4
  69. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +9 -20
  70. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
  71. package/lib/view/tagView/epics/createTagEpic.d.ts +6 -6
  72. package/lib/view/tagView/epics/deleteTagEpic.d.ts +6 -6
  73. package/package.json +2 -2
@@ -13,8 +13,5 @@ import { ZeniAPI } from '../../../../../zeniAPI';
13
13
  import { updateSetupViewLocalStoreData } from '../../../commonSetup/setupViewReducer';
14
14
  import { fetchChargeCardSetupView, fetchChargeCardSetupViewFailure, fetchChargeCardSetupViewSuccess } from '../chargeCardSetUpViewReducer';
15
15
  import { updatePlaidAccountViewAccountDetails } from '../../../plaidAccount/plaidAccountViewReducer';
16
- import { updatePaymentAccountList } from '../../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
17
- import { updateDepositAccounts } from '../../../../../entity/depositAccount/depositAccountReducer';
18
- import { updateDepositAccountList } from '../../../zeniAccounts/depositAccountList/depositAccountListReducer';
19
- export declare type ActionType = ReturnType<typeof fetchChargeCardSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof updateDepositAccounts> | ReturnType<typeof updateDepositAccountList> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchChargeCardSetupViewSuccess> | ReturnType<typeof fetchChargeCardSetupViewFailure>;
16
+ export declare type ActionType = ReturnType<typeof fetchChargeCardSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchChargeCardSetupViewSuccess> | ReturnType<typeof fetchChargeCardSetupViewFailure>;
20
17
  export declare const fetchChargeCardSetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -16,9 +16,6 @@ const responsePayload_1 = require("../../../../../responsePayload");
16
16
  const setupViewReducer_1 = require("../../../commonSetup/setupViewReducer");
17
17
  const chargeCardSetUpViewReducer_1 = require("../chargeCardSetUpViewReducer");
18
18
  const plaidAccountViewReducer_1 = require("../../../plaidAccount/plaidAccountViewReducer");
19
- const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
20
- const depositAccountReducer_1 = require("../../../../../entity/depositAccount/depositAccountReducer");
21
- const depositAccountListReducer_1 = require("../../../zeniAccounts/depositAccountList/depositAccountListReducer");
22
19
  const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardSetUpViewReducer_1.fetchChargeCardSetupView.match), (0, operators_1.switchMap)((action) => {
23
20
  var _a;
24
21
  const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
@@ -32,9 +29,9 @@ const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pip
32
29
  return zeniAPI
33
30
  .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"charge_cards_setup"}`)
34
31
  .pipe((0, operators_1.mergeMap)((response) => {
35
- var _a, _b, _c;
36
32
  if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
37
33
  const allBankAccountIds = response.data.accounts.map((account) => account.account_id);
34
+ const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
38
35
  const actions = [
39
36
  (0, userReducer_1.updateAllUsers)({ users: response.data.users }),
40
37
  (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
@@ -46,19 +43,10 @@ const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pip
46
43
  (0, fileReducer_1.updateFiles)({ files: response.data.files }),
47
44
  (0, accountReducer_1.updateAccounts)(response.data.accounts, 'charge_cards'),
48
45
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
49
- (0, paymentAccountListReducer_1.updatePaymentAccountList)({
50
- data: response.data.payment_accounts,
51
- updateType: 'replace',
52
- }),
53
- (0, depositAccountReducer_1.updateDepositAccounts)((_a = response.data.deposit_accounts) !== null && _a !== void 0 ? _a : []),
54
- (0, depositAccountListReducer_1.updateDepositAccountList)({
55
- data: (_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.deposit_accounts) !== null && _c !== void 0 ? _c : [],
56
- updateType: 'replace',
57
- }),
58
46
  (0, setupViewReducer_1.updateSetupViewLocalStoreData)({
59
47
  companyId: response.data.companies[0].company_id,
60
48
  }),
61
- (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'charge_card_setup'),
49
+ (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'),
62
50
  (0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupViewSuccess)(),
63
51
  ];
64
52
  return (0, rxjs_1.from)(actions);
@@ -74,10 +62,10 @@ const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pip
74
62
  JSON.stringify(error))))));
75
63
  }
76
64
  else {
77
- const { allBankAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
65
+ const { allBankAccountIds, paymentAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
78
66
  return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
79
67
  companyId,
80
- }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'charge_card_setup'), (0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupViewSuccess)());
68
+ }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'), (0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupViewSuccess)());
81
69
  }
82
70
  }));
83
71
  exports.fetchChargeCardSetupViewEpic = fetchChargeCardSetupViewEpic;
@@ -77,10 +77,6 @@ export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData
77
77
  updateStatus: FetchStateAndError;
78
78
  }
79
79
  export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType, plaidAccountKeyType: PlaidAccountKeyType): SetupView;
80
- export declare function getPrimaryAccountForTheProduct(state: RootState, companyId: ID, setupViewType: SetupViewType): {
81
- accountId: ID;
82
- accountType: AccountTypeSubConfigCodeKeyType;
83
- } | undefined;
84
80
  export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
85
81
  export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
86
82
  export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[], includeOnlyVerifiedAccounts?: boolean) => FundingAccount[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapPaymentAccToFundingAccount = exports.mapDepositAccToFundingAccount = exports.getAllFundingAccounts = exports.getCompanyAndIdentityDetails = exports.getBusinessVerificationDetails = exports.getPrimaryAccountForTheProduct = exports.getCommonSetupViewDetails = void 0;
3
+ exports.mapPaymentAccToFundingAccount = exports.mapDepositAccToFundingAccount = exports.getAllFundingAccounts = exports.getCompanyAndIdentityDetails = exports.getBusinessVerificationDetails = exports.getCommonSetupViewDetails = void 0;
4
4
  const accountSelector_1 = require("../../../entity/account/accountSelector");
5
5
  const fileSelector_1 = require("../../../entity/file/fileSelector");
6
6
  const fileViewSelector_1 = require("../../fileView/fileViewSelector");
@@ -14,74 +14,58 @@ function getCommonSetupViewDetails(state, companyId, setupViewType, plaidAccount
14
14
  const { accountState, setupViewState, paymentAccountState, paymentAccountListState, depositAccountState, depositAccountListState, plaidAccountViewState, } = state;
15
15
  const { updateStatus } = setupViewState;
16
16
  const { accountDetails, plaidConnectionDetails } = (0, plaidAccountViewSelector_1.getPlaidAccountDetails)(plaidAccountViewState, plaidAccountKeyType);
17
- const { allBankAccountIds } = accountDetails;
17
+ const { allBankAccountIds, primaryFundingAccount } = accountDetails;
18
18
  const { paymentAccountIds } = paymentAccountListState;
19
19
  const { accountIds: depositAccountIds } = depositAccountListState;
20
20
  const allBankAccounts = (_a = allBankAccountIds === null || allBankAccountIds === void 0 ? void 0 : allBankAccountIds.map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, setupViewType)).filter((account) => account != null)) !== null && _a !== void 0 ? _a : [];
21
21
  const paymentAccounts = (_b = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _b !== void 0 ? _b : [];
22
22
  const depositAccounts = (_c = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _c !== void 0 ? _c : [];
23
- const allFundingAccounts = (0, exports.getAllFundingAccounts)(setupViewType === 'zeni_accounts' ? [] : depositAccounts, // only external acct can be made primary for accounts setup
24
- paymentAccounts, false);
23
+ const allFundingAccounts = (0, exports.getAllFundingAccounts)(depositAccounts, paymentAccounts, false);
25
24
  const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
26
25
  const companyBillPayInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo;
27
- const primaryAccount = getPrimaryAccountForTheProduct(state, companyId, setupViewType);
28
- let primaryFundingAccount;
29
- if ((primaryAccount === null || primaryAccount === void 0 ? void 0 : primaryAccount.accountType) === 'depositAccount') {
30
- const depositAccount = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, primaryAccount.accountId);
31
- if (depositAccount != null) {
32
- primaryFundingAccount = (0, exports.mapDepositAccToFundingAccount)(depositAccount);
26
+ let paymentAccount;
27
+ let primaryAccount = undefined;
28
+ if (((_d = accountDetails.paymentAccountIds) === null || _d === void 0 ? void 0 : _d.length) > 0) {
29
+ // paymentAccount is used for products other than reimbursement
30
+ const paymentAccountId = accountDetails.paymentAccountIds[0];
31
+ paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, paymentAccountId);
32
+ }
33
+ // For reimbursement setup, use primaryFundingAccount as the payment account.
34
+ // For other setup pages, continue using first payment account
35
+ if (plaidAccountKeyType === 'reimbursement_setup') {
36
+ if ((primaryFundingAccount === null || primaryFundingAccount === void 0 ? void 0 : primaryFundingAccount.accountType) === 'depositAccount') {
37
+ const depositAccount = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, primaryFundingAccount.accountId);
38
+ if (depositAccount != null) {
39
+ primaryAccount = (0, exports.mapDepositAccToFundingAccount)(depositAccount);
40
+ }
41
+ }
42
+ else if ((primaryFundingAccount === null || primaryFundingAccount === void 0 ? void 0 : primaryFundingAccount.accountType) === 'paymentAccount') {
43
+ const paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, primaryFundingAccount.accountId);
44
+ if (paymentAccount != null) {
45
+ primaryAccount = (0, exports.mapPaymentAccToFundingAccount)(paymentAccount);
46
+ }
33
47
  }
34
48
  }
35
- else if ((primaryAccount === null || primaryAccount === void 0 ? void 0 : primaryAccount.accountType) === 'paymentAccount') {
36
- const paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, primaryAccount.accountId);
49
+ else if ((paymentAccountIds === null || paymentAccountIds === void 0 ? void 0 : paymentAccountIds.length) > 0) {
50
+ const paymentAccountId = paymentAccountIds[0];
51
+ const paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, paymentAccountId);
37
52
  if (paymentAccount != null) {
38
- primaryFundingAccount = (0, exports.mapPaymentAccToFundingAccount)(paymentAccount);
53
+ primaryAccount = (0, exports.mapPaymentAccToFundingAccount)(paymentAccount);
39
54
  }
40
55
  }
41
- let paymentAccountForBilling;
42
- if (((_d = accountDetails.paymentAccountIds) === null || _d === void 0 ? void 0 : _d.length) > 0) {
43
- const paymentAccountId = accountDetails.paymentAccountIds[0];
44
- paymentAccountForBilling = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, paymentAccountId);
45
- }
46
56
  return {
47
57
  companyBillPayInfo,
48
- primaryFundingAccount,
49
- paymentAccount: paymentAccountForBilling,
58
+ paymentAccount,
59
+ primaryFundingAccount: primaryAccount,
50
60
  allFundingAccounts,
51
61
  allBankAccounts,
52
62
  plaidConnectionDetails,
53
- accountUpdateStatus: accountDetails.cashAccountUpdateStatus,
63
+ accountUpdateStatus: accountDetails.updateStatus,
54
64
  accountFetchStatus: accountDetails.fetchStatus,
55
65
  updateStatus,
56
66
  };
57
67
  }
58
68
  exports.getCommonSetupViewDetails = getCommonSetupViewDetails;
59
- function getPrimaryAccountForTheProduct(state, companyId, setupViewType) {
60
- const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
61
- if (companyView == null) {
62
- return undefined;
63
- }
64
- let primaryFundingAccount;
65
- if (setupViewType === 'bill_pay') {
66
- primaryFundingAccount =
67
- companyView.company.company.companyBillPayInfo.primaryFundingAccount;
68
- }
69
- else if (setupViewType === 'reimbursement') {
70
- primaryFundingAccount =
71
- companyView.company.company.companyReimbursementInfo
72
- .primaryFundingAccount;
73
- }
74
- else if (setupViewType === 'charge_cards') {
75
- primaryFundingAccount =
76
- companyView.company.company.companyChargeCardInfo.primaryFundingAccount;
77
- }
78
- else if (setupViewType === 'zeni_accounts') {
79
- primaryFundingAccount =
80
- companyView.company.company.companyZeniAccountInfo.primaryFundingAccount;
81
- }
82
- return primaryFundingAccount;
83
- }
84
- exports.getPrimaryAccountForTheProduct = getPrimaryAccountForTheProduct;
85
69
  function getBusinessVerificationDetails(state, companyId) {
86
70
  const { setupViewState } = state;
87
71
  const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
@@ -7,7 +7,7 @@ const responsePayload_1 = require("../../../../../responsePayload");
7
7
  const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
8
8
  const depositAccountReducer_1 = require("../../../../../entity/depositAccount/depositAccountReducer");
9
9
  const updateMappedCashAccountEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.updateMappedCashAccount.match), (0, operators_1.mergeMap)((action) => {
10
- const { plaidAccountKeyType, accountId, depositAccountId } = action.payload;
10
+ const { accountId, depositAccountId } = action.payload;
11
11
  return zeniAPI
12
12
  .putAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/deposit-accounts/${depositAccountId}`, {
13
13
  zeni_mapped_account_id: accountId,
@@ -15,16 +15,17 @@ const updateMappedCashAccountEpic = (actions$, _state$, zeniAPI) => actions$.pip
15
15
  .pipe((0, operators_1.mergeMap)((response) => {
16
16
  var _a, _b;
17
17
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
+ const depositAccountIds = response.data.deposit_accounts.map((depositAccount) => depositAccount.deposit_account_id);
18
19
  const actions = [
19
20
  (0, depositAccountReducer_1.updateDepositAccounts)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.deposit_accounts) !== null && _b !== void 0 ? _b : []),
20
- (0, plaidAccountViewReducer_1.updateMappedCashAccountSuccess)(plaidAccountKeyType),
21
+ (0, plaidAccountViewReducer_1.updateMappedCashAccountSuccess)(depositAccountIds),
21
22
  ];
22
23
  return (0, rxjs_1.from)(actions);
23
24
  }
24
25
  else {
25
- return (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updateMappedCashAccountFailure)(plaidAccountKeyType, response.status));
26
+ return (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updateMappedCashAccountFailure)(response.status));
26
27
  }
27
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updateMappedCashAccountFailure)(plaidAccountKeyType, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Mapped Cash Account errored out' +
28
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updateMappedCashAccountFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Mapped Cash Account errored out' +
28
29
  JSON.stringify(error))))));
29
30
  }));
30
31
  exports.updateMappedCashAccountEpic = updateMappedCashAccountEpic;
@@ -15,10 +15,11 @@ const updatePaymentAccountEpic = (actions$, _state$, zeniAPI) => actions$.pipe((
15
15
  })
16
16
  .pipe((0, operators_1.mergeMap)((response) => {
17
17
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
+ const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
18
19
  const actions = [
19
20
  (0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType),
20
21
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
21
- (0, plaidAccountViewReducer_1.updatePaymentAccountSuccess)(plaidAccountKeyType),
22
+ (0, plaidAccountViewReducer_1.updatePaymentAccountSuccess)(paymentAccountIds, plaidAccountKeyType),
22
23
  ];
23
24
  return (0, rxjs_1.from)(actions);
24
25
  }
@@ -16,10 +16,11 @@ const updatePaymentAccountStatusEpic = (actions$, _state$, zeniAPI) => actions$.
16
16
  })
17
17
  .pipe((0, operators_1.mergeMap)((response) => {
18
18
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
19
+ const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
19
20
  const actions = [
20
21
  (0, accountReducer_1.updateAccounts)(response.data.accounts, setupViewType),
21
22
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
22
- (0, plaidAccountViewReducer_1.updatePaymentAccountStatusSuccess)(linkTokenType, plaidAccountKeyType),
23
+ (0, plaidAccountViewReducer_1.updatePaymentAccountStatusSuccess)(paymentAccountIds, linkTokenType, plaidAccountKeyType),
23
24
  ];
24
25
  return (0, rxjs_1.from)(actions);
25
26
  }
@@ -8,54 +8,32 @@ const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
8
8
  const companyReducer_1 = require("../../../../../entity/company/companyReducer");
9
9
  const helpers_1 = require("../../../helpers");
10
10
  const billPayConfigState_1 = require("../../../billPay/billPayConfig/billPayConfigState");
11
+ const billPayConfigPayload_1 = require("../../../billPay/billPayConfig/billPayConfigPayload");
11
12
  const updatePrimaryFundingAccountEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.updatePrimaryFundingAccount.match), (0, operators_1.mergeMap)((action) => {
12
- const { companyId, plaidAccountKeyType, accountId, accountType } = action.payload;
13
+ const { companyId, accountId, accountType } = action.payload;
13
14
  return zeniAPI
14
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, toPayload(plaidAccountKeyType, accountId, accountType))
15
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, {
16
+ reimbursement_primary_funding_account_id: accountId,
17
+ reimbursement_primary_funding_account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)(accountType),
18
+ })
15
19
  .pipe((0, operators_1.mergeMap)((response) => {
16
- var _a;
20
+ var _a, _b, _c;
17
21
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
22
  const actions = [
19
23
  (0, companyReducer_1.updateCompanies)({
20
24
  payload: (_a = response.data.companies) !== null && _a !== void 0 ? _a : [],
21
25
  schema: {},
22
26
  }),
23
- (0, plaidAccountViewReducer_1.updatePrimaryFundingAccountSuccess)(plaidAccountKeyType),
27
+ (0, plaidAccountViewReducer_1.updatePrimaryFundingAccountSuccess)((_b = response.data.companies[0].reimbursement_info
28
+ .primary_funding_account.account_id) !== null && _b !== void 0 ? _b : '', (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)((0, billPayConfigState_1.toAccType)((_c = response.data.companies[0].reimbursement_info
29
+ .primary_funding_account.account_type) !== null && _c !== void 0 ? _c : ''))),
24
30
  ];
25
31
  return (0, rxjs_1.from)(actions);
26
32
  }
27
33
  else {
28
- return (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePrimaryFundingAccountFailure)(plaidAccountKeyType, response.status));
34
+ return (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePrimaryFundingAccountFailure)(response.status));
29
35
  }
30
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePrimaryFundingAccountFailure)(plaidAccountKeyType, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Primary Funding Account errored out' +
36
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, plaidAccountViewReducer_1.updatePrimaryFundingAccountFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Primary Funding Account errored out' +
31
37
  JSON.stringify(error))))));
32
38
  }));
33
39
  exports.updatePrimaryFundingAccountEpic = updatePrimaryFundingAccountEpic;
34
- function toPayload(plaidAccountKeyType, accountId, accountType) {
35
- switch (plaidAccountKeyType) {
36
- case 'bill_pay_setup': {
37
- return {
38
- bill_pay_primary_funding_account_id: accountId,
39
- bill_pay_primary_funding_account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((0, billPayConfigState_1.toAccountTypeSubConfigCodeKeyType)(accountType)),
40
- };
41
- }
42
- case 'reimbursement_setup': {
43
- return {
44
- reimbursement_primary_funding_account_id: accountId,
45
- reimbursement_primary_funding_account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((0, billPayConfigState_1.toAccountTypeSubConfigCodeKeyType)(accountType)),
46
- };
47
- }
48
- case 'charge_card_setup': {
49
- return {
50
- charge_cards_primary_funding_account_id: accountId,
51
- charge_cards_primary_funding_account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((0, billPayConfigState_1.toAccountTypeSubConfigCodeKeyType)(accountType)),
52
- };
53
- }
54
- default: {
55
- return {
56
- deposit_accounts_primary_funding_account_id: accountId,
57
- deposit_accounts_primary_funding_account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((0, billPayConfigState_1.toAccountTypeSubConfigCodeKeyType)(accountType)),
58
- };
59
- }
60
- }
61
- }
@@ -9,6 +9,5 @@ import { establishPlaidConnection, establishPlaidConnectionSuccess, establishPla
9
9
  import { updateBankAccounts } from '../../../../../entity/bankAccount/bankAccountReducer';
10
10
  import { updateUserBankAccount } from '../../../../userFinancialAccount/userFinancialAccountReducer';
11
11
  import { updatePaymentAccountList } from '../../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
12
- import { updateCompanyPrimaryAccount } from '../../../../../entity/company/companyReducer';
13
- 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> | ReturnType<typeof updateCompanyPrimaryAccount>;
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>;
14
13
  export declare const establishPlaidConnectionEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -11,10 +11,9 @@ 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");
15
14
  const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
16
15
  var _a, _b;
17
- const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
16
+ const { publicToken, setupViewType, linkTokenType, plaidAccountKeyType } = action.payload;
18
17
  const requestPayload = {
19
18
  public_token: publicToken,
20
19
  };
@@ -24,74 +23,39 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
24
23
  if (setupViewType == null) {
25
24
  requestPayload.is_user_account = true;
26
25
  }
27
- else if (plaidAccountKeyType === 'bill_pay_setup') {
28
- requestPayload.is_primary_for_bill_pay = true;
29
- }
30
26
  else if (plaidAccountKeyType === 'reimbursement_setup') {
31
27
  requestPayload.is_primary_for_reimbursements = true;
32
28
  }
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
- }
39
29
  else if (plaidAccountKeyType === 'billing_setup') {
40
30
  requestPayload.is_primary_for_onboarding = true;
41
31
  }
32
+ else {
33
+ requestPayload.is_primary_for_bill_pay = true;
34
+ }
42
35
  }
43
36
  return zeniAPI
44
37
  .postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token`, requestPayload)
45
38
  .pipe((0, operators_1.mergeMap)((response) => {
46
39
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
47
- const paymentAccount = response.data.payment_accounts[0];
40
+ const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
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;
48
45
  const actions = [
49
46
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
50
47
  (0, paymentAccountListReducer_1.updatePaymentAccountList)({
51
48
  data: response.data.payment_accounts,
52
49
  updateType: 'merge',
53
50
  }),
54
- (0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(linkTokenType, plaidAccountKeyType),
51
+ (0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(primaryFundingAccountId, [...paymentAccountIds, ...existingPaymentAccountIds], linkTokenType, plaidAccountKeyType),
55
52
  ];
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
- }
53
+ // if plaidAccountKeyType is not reimbursement_setup but the account added is primary for reimbursement
54
+ // it should be reflected on remi setup page without refresh also
55
+ if (plaidAccountKeyType !== 'reimbursement_setup' &&
56
+ response.data.payment_accounts[0]
57
+ .is_primary_for_reimbursements === true) {
58
+ actions.push((0, plaidAccountViewReducer_1.establishPlaidConnectionSuccess)(primaryFundingAccountId, [...paymentAccountIds, ...existingPaymentAccountIds], linkTokenType, 'reimbursement_setup'));
95
59
  }
96
60
  if (response.data.bank_accounts != null) {
97
61
  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.mergeMap)((action) => {
9
+ const getPlaidLinkTokenEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.getPlaidLinkToken.match), (0, operators_1.switchMap)((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,3 +1,4 @@
1
+ import { ID } from '../../../commonStateTypes/common';
1
2
  import { ZeniAPIStatus } from '../../../responsePayload';
2
3
  import { PlaidAccountKeyType, PlaidAccountViewState, PlaidLinkTokenType } from './plaidAccountViewState';
3
4
  export declare const initialState: PlaidAccountViewState;
@@ -16,7 +17,8 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
16
17
  paymentAccountId: string;
17
18
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
18
19
  plaidAccountKeyType: PlaidAccountKeyType;
19
- }, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
20
+ }, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
21
+ paymentAccountIds: string[];
20
22
  plaidAccountKeyType: PlaidAccountKeyType;
21
23
  }, string, never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
22
24
  error: ZeniAPIStatus<Record<string, unknown>>;
@@ -27,7 +29,8 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
27
29
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
28
30
  plaidAccountKeyType: PlaidAccountKeyType;
29
31
  linkTokenType: PlaidLinkTokenType;
30
- }, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
32
+ }, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
33
+ paymentAccountIds: string[];
31
34
  linkTokenType: PlaidLinkTokenType;
32
35
  plaidAccountKeyType: PlaidAccountKeyType;
33
36
  }, string, never, never>, updatePaymentAccountStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
@@ -61,41 +64,44 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
61
64
  error: ZeniAPIStatus<Record<string, unknown>>;
62
65
  linkTokenType: PlaidLinkTokenType;
63
66
  plaidAccountKeyType: PlaidAccountKeyType;
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], {
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], {
65
68
  publicToken: string;
66
- companyId: string;
67
69
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined;
68
70
  linkTokenType: PlaidLinkTokenType;
69
71
  plaidAccountKeyType: PlaidAccountKeyType;
70
- }, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
72
+ }, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[primaryFundingAccountId: string, paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
73
+ primaryFundingAccountId: string;
74
+ paymentAccountIds: string[];
71
75
  linkTokenType: PlaidLinkTokenType;
72
76
  plaidAccountKeyType: PlaidAccountKeyType;
73
77
  }, string, never, never>, establishPlaidConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
74
78
  error: ZeniAPIStatus<Record<string, unknown>>;
75
79
  linkTokenType: PlaidLinkTokenType;
76
80
  plaidAccountKeyType: PlaidAccountKeyType;
77
- }, string, never, never>, updatePlaidAccountViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
81
+ }, string, never, never>, updatePlaidAccountViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType, depositAccountIds?: string[] | undefined, primaryFundingAccount?: {
82
+ accountId: ID;
83
+ accountType: string;
84
+ } | undefined], {
78
85
  allBankAccountIds: string[];
86
+ paymentAccountIds: string[];
79
87
  plaidAccountKeyType: PlaidAccountKeyType;
80
- }, string, never, never>, updatePrimaryFundingAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, plaidAccountKeyType: PlaidAccountKeyType, accountId: string, accountType: string], {
88
+ depositAccountIds: string[] | undefined;
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], {
81
94
  companyId: string;
82
- plaidAccountKeyType: PlaidAccountKeyType;
83
95
  accountId: string;
84
96
  accountType: string;
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;
97
+ }, string, never, never>, updatePrimaryFundingAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, accountType: string], {
98
+ accountId: string;
99
+ accountType: string;
100
+ }, string, never, never>, updatePrimaryFundingAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, updateMappedCashAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, depositAccountId: string], {
92
101
  accountId: string;
93
102
  depositAccountId: string;
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>;
103
+ }, string, never, never>, updateMappedCashAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[depositAccountIds: string[]], {
104
+ depositAccountIds: string[];
105
+ }, string, never, never>, updateMappedCashAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, clearPlaidAccountView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
100
106
  declare const _default: import("@reduxjs/toolkit").Reducer<PlaidAccountViewState, import("@reduxjs/toolkit").AnyAction>;
101
107
  export default _default;