@zeniai/client-epic-state 4.11.46 → 4.11.48

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 (56) hide show
  1. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  2. package/lib/entity/company/companyPayload.d.ts +0 -12
  3. package/lib/entity/company/companyPayload.js +0 -21
  4. package/lib/entity/company/companyReducer.d.ts +0 -7
  5. package/lib/entity/company/companyReducer.js +2 -22
  6. package/lib/entity/company/companyStateTypes.d.ts +0 -12
  7. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  8. package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +0 -2
  9. package/lib/entity/paymentAccount/paymentAccountPayload.js +0 -2
  10. package/lib/entity/paymentAccount/paymentAccountState.d.ts +0 -2
  11. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  12. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  13. package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
  14. package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
  15. package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
  16. package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
  17. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
  18. package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +0 -2
  19. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  20. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  21. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  22. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  23. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  24. package/lib/view/referralView/referralState.d.ts +1 -1
  25. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  26. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  27. package/lib/view/settingsView/settingsViewHelpers.js +12 -6
  28. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -2
  29. package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
  30. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +1 -4
  31. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +4 -16
  32. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -2
  33. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
  34. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +1 -4
  35. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +4 -16
  36. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -4
  37. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +32 -42
  38. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
  39. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +5 -4
  40. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
  41. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
  42. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +12 -34
  43. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
  44. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +16 -52
  45. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +29 -22
  46. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +78 -49
  47. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +8 -2
  48. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +3 -5
  49. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +19 -6
  50. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
  51. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +1 -4
  52. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +9 -20
  53. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
  54. package/lib/view/tagView/epics/createTagEpic.d.ts +6 -6
  55. package/lib/view/tagView/epics/deleteTagEpic.d.ts +6 -6
  56. package/package.json +1 -1
@@ -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);
@@ -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;
@@ -5,7 +6,8 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
5
6
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
6
7
  includeBalances: boolean;
7
8
  plaidAccountKeyType: PlaidAccountKeyType;
8
- }, string, never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
9
+ }, string, never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
10
+ paymentAccountIds: string[];
9
11
  plaidAccountKeyType: PlaidAccountKeyType;
10
12
  }, string, never, never>, getPaymentAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
11
13
  error: ZeniAPIStatus<Record<string, unknown>>;
@@ -15,7 +17,8 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
15
17
  paymentAccountId: string;
16
18
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
17
19
  plaidAccountKeyType: PlaidAccountKeyType;
18
- }, 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[];
19
22
  plaidAccountKeyType: PlaidAccountKeyType;
20
23
  }, string, never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
21
24
  error: ZeniAPIStatus<Record<string, unknown>>;
@@ -26,7 +29,8 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
26
29
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing";
27
30
  plaidAccountKeyType: PlaidAccountKeyType;
28
31
  linkTokenType: PlaidLinkTokenType;
29
- }, 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[];
30
34
  linkTokenType: PlaidLinkTokenType;
31
35
  plaidAccountKeyType: PlaidAccountKeyType;
32
36
  }, string, never, never>, updatePaymentAccountStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
@@ -60,41 +64,44 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
60
64
  error: ZeniAPIStatus<Record<string, unknown>>;
61
65
  linkTokenType: PlaidLinkTokenType;
62
66
  plaidAccountKeyType: PlaidAccountKeyType;
63
- }, 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], {
64
68
  publicToken: string;
65
- companyId: string;
66
69
  setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | undefined;
67
70
  linkTokenType: PlaidLinkTokenType;
68
71
  plaidAccountKeyType: PlaidAccountKeyType;
69
- }, 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[];
70
75
  linkTokenType: PlaidLinkTokenType;
71
76
  plaidAccountKeyType: PlaidAccountKeyType;
72
77
  }, string, never, never>, establishPlaidConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
73
78
  error: ZeniAPIStatus<Record<string, unknown>>;
74
79
  linkTokenType: PlaidLinkTokenType;
75
80
  plaidAccountKeyType: PlaidAccountKeyType;
76
- }, 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], {
77
85
  allBankAccountIds: string[];
86
+ paymentAccountIds: string[];
78
87
  plaidAccountKeyType: PlaidAccountKeyType;
79
- }, 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], {
80
94
  companyId: string;
81
- plaidAccountKeyType: PlaidAccountKeyType;
82
95
  accountId: string;
83
96
  accountType: string;
84
- }, string, never, never>, updatePrimaryFundingAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
85
- plaidAccountKeyType: PlaidAccountKeyType;
86
- }, string, never, never>, updatePrimaryFundingAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, error: ZeniAPIStatus<Record<string, unknown>>], {
87
- error: ZeniAPIStatus<Record<string, unknown>>;
88
- plaidAccountKeyType: PlaidAccountKeyType;
89
- }, string, never, never>, updateMappedCashAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, accountId: string, depositAccountId: string], {
90
- 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], {
91
101
  accountId: string;
92
102
  depositAccountId: string;
93
- }, string, never, never>, updateMappedCashAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
94
- plaidAccountKeyType: PlaidAccountKeyType;
95
- }, string, never, never>, updateMappedCashAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, error: ZeniAPIStatus<Record<string, unknown>>], {
96
- plaidAccountKeyType: PlaidAccountKeyType;
97
- error: ZeniAPIStatus<Record<string, unknown>>;
98
- }, 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>;
99
106
  declare const _default: import("@reduxjs/toolkit").Reducer<PlaidAccountViewState, import("@reduxjs/toolkit").AnyAction>;
100
107
  export default _default;
@@ -7,12 +7,9 @@ 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,
14
10
  user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
15
11
  external_account: plaidAccountViewState_1.initialPlaidAccountState,
12
+ reimbursement_setup: plaidAccountViewState_1.initialPlaidAccountState,
16
13
  billing_setup: plaidAccountViewState_1.initialPlaidAccountState,
17
14
  };
18
15
  const plaidAccountView = (0, toolkit_1.createSlice)({
@@ -39,15 +36,17 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
39
36
  },
40
37
  getPaymentAccountsSuccess: {
41
38
  reducer(draft, action) {
42
- const { plaidAccountKeyType } = action.payload;
39
+ const { paymentAccountIds, plaidAccountKeyType } = action.payload;
43
40
  draft[plaidAccountKeyType].accountDetails.fetchStatus = {
44
41
  fetchState: 'Completed',
45
42
  error: undefined,
46
43
  };
44
+ draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
45
+ paymentAccountIds;
47
46
  },
48
- prepare(plaidAccountKeyType) {
47
+ prepare(paymentAccountIds, plaidAccountKeyType) {
49
48
  return {
50
- payload: { plaidAccountKeyType },
49
+ payload: { paymentAccountIds, plaidAccountKeyType },
51
50
  };
52
51
  },
53
52
  },
@@ -68,7 +67,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
68
67
  updatePaymentAccount: {
69
68
  reducer(draft, action) {
70
69
  const { plaidAccountKeyType } = action.payload;
71
- draft[plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
70
+ draft[plaidAccountKeyType].accountDetails.updateStatus = {
72
71
  fetchState: 'In-Progress',
73
72
  error: undefined,
74
73
  };
@@ -87,21 +86,21 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
87
86
  updatePaymentAccountSuccess: {
88
87
  reducer(draft, action) {
89
88
  const { plaidAccountKeyType } = action.payload;
90
- draft[plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
89
+ draft[plaidAccountKeyType].accountDetails.updateStatus = {
91
90
  fetchState: 'Completed',
92
91
  error: undefined,
93
92
  };
94
93
  },
95
- prepare(plaidAccountKeyType) {
94
+ prepare(paymentAccountIds, plaidAccountKeyType) {
96
95
  return {
97
- payload: { plaidAccountKeyType },
96
+ payload: { paymentAccountIds, plaidAccountKeyType },
98
97
  };
99
98
  },
100
99
  },
101
100
  updatePaymentAccountFailure: {
102
101
  reducer(draft, action) {
103
102
  const { error, plaidAccountKeyType } = action.payload;
104
- draft[plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
103
+ draft[plaidAccountKeyType].accountDetails.updateStatus = {
105
104
  fetchState: 'Error',
106
105
  error,
107
106
  };
@@ -134,15 +133,19 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
134
133
  },
135
134
  updatePaymentAccountStatusSuccess: {
136
135
  reducer(draft, action) {
137
- const { linkTokenType, plaidAccountKeyType } = action.payload;
136
+ const { paymentAccountIds, linkTokenType, plaidAccountKeyType } = action.payload;
138
137
  draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
139
138
  fetchState: 'Completed',
140
139
  error: undefined,
141
140
  } });
141
+ if (plaidAccountKeyType !== 'reimbursement_setup') {
142
+ draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
143
+ paymentAccountIds;
144
+ }
142
145
  },
143
- prepare(linkTokenType, plaidAccountKeyType) {
146
+ prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
144
147
  return {
145
- payload: { linkTokenType, plaidAccountKeyType },
148
+ payload: { paymentAccountIds, linkTokenType, plaidAccountKeyType },
146
149
  };
147
150
  },
148
151
  },
@@ -182,11 +185,13 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
182
185
  },
183
186
  updatePaymentAccountLoginStatusSuccess: {
184
187
  reducer(draft, action) {
185
- const { linkTokenType, plaidAccountKeyType } = action.payload;
188
+ const { paymentAccountIds, linkTokenType, plaidAccountKeyType } = action.payload;
186
189
  draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
187
190
  fetchState: 'Completed',
188
191
  error: undefined,
189
192
  } });
193
+ draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
194
+ paymentAccountIds;
190
195
  },
191
196
  prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
192
197
  return {
@@ -210,11 +215,17 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
210
215
  },
211
216
  getPlaidLinkToken: {
212
217
  reducer(draft, action) {
213
- const { linkTokenType, plaidAccountKeyType } = action.payload;
218
+ const { linkTokenType, paymentAccountId, plaidAccountKeyType } = action.payload;
214
219
  draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { fetchStatus: {
215
220
  fetchState: 'In-Progress',
216
221
  error: undefined,
217
222
  } });
223
+ if (paymentAccountId != null &&
224
+ plaidAccountKeyType !== 'reimbursement_setup') {
225
+ draft[plaidAccountKeyType].accountDetails.paymentAccountIds = [
226
+ paymentAccountId,
227
+ ];
228
+ }
218
229
  },
219
230
  prepare(plaidAccountKeyType, linkTokenType, paymentAccountId) {
220
231
  return {
@@ -262,11 +273,10 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
262
273
  error: undefined,
263
274
  } });
264
275
  },
265
- prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType) {
276
+ prepare(publicToken, plaidAccountKeyType, setupViewType, linkTokenType) {
266
277
  return {
267
278
  payload: {
268
279
  publicToken,
269
- companyId,
270
280
  setupViewType,
271
281
  linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
272
282
  plaidAccountKeyType,
@@ -276,15 +286,23 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
276
286
  },
277
287
  establishPlaidConnectionSuccess: {
278
288
  reducer(draft, action) {
279
- const { linkTokenType, plaidAccountKeyType } = action.payload;
289
+ const { primaryFundingAccountId, paymentAccountIds, linkTokenType, plaidAccountKeyType, } = action.payload;
280
290
  draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
281
291
  fetchState: 'Completed',
282
292
  error: undefined,
283
293
  } });
294
+ draft[plaidAccountKeyType].accountDetails.primaryFundingAccount = {
295
+ accountId: primaryFundingAccountId,
296
+ accountType: 'paymentAccount',
297
+ };
298
+ draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
299
+ paymentAccountIds;
284
300
  },
285
- prepare(linkTokenType, plaidAccountKeyType) {
301
+ prepare(primaryFundingAccountId, paymentAccountIds, linkTokenType, plaidAccountKeyType) {
286
302
  return {
287
303
  payload: {
304
+ primaryFundingAccountId,
305
+ paymentAccountIds,
288
306
  linkTokenType,
289
307
  plaidAccountKeyType,
290
308
  },
@@ -306,18 +324,27 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
306
324
  },
307
325
  },
308
326
  updatePlaidAccountViewAccountDetails: {
309
- prepare(allBankAccountIds, plaidAccountKeyType) {
327
+ prepare(allBankAccountIds, paymentAccountIds, plaidAccountKeyType, depositAccountIds, primaryFundingAccount) {
310
328
  return {
311
329
  payload: {
312
330
  allBankAccountIds,
331
+ paymentAccountIds,
313
332
  plaidAccountKeyType,
333
+ depositAccountIds,
334
+ primaryFundingAccount,
314
335
  },
315
336
  };
316
337
  },
317
338
  reducer(draft, action) {
318
- const { allBankAccountIds, plaidAccountKeyType } = action.payload;
339
+ const { allBankAccountIds, paymentAccountIds, depositAccountIds, primaryFundingAccount, plaidAccountKeyType, } = action.payload;
319
340
  draft[plaidAccountKeyType].accountDetails.allBankAccountIds =
320
341
  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;
321
348
  draft[plaidAccountKeyType].accountDetails.fetchStatus = {
322
349
  fetchState: 'Completed',
323
350
  error: undefined,
@@ -325,79 +352,81 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
325
352
  },
326
353
  },
327
354
  updatePrimaryFundingAccount: {
328
- reducer(draft, action) {
329
- draft[action.payload.plaidAccountKeyType].accountDetails.primaryFundingAccountUpdateStatus = {
355
+ reducer(draft) {
356
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccountUpdateStatus = {
330
357
  fetchState: 'In-Progress',
331
358
  error: undefined,
332
359
  };
333
360
  },
334
- prepare(companyId, plaidAccountKeyType, accountId, accountType) {
335
- return {
336
- payload: { companyId, plaidAccountKeyType, accountId, accountType },
337
- };
361
+ prepare(companyId, accountId, accountType) {
362
+ return { payload: { companyId, accountId, accountType } };
338
363
  },
339
364
  },
340
365
  updatePrimaryFundingAccountSuccess: {
341
366
  reducer(draft, action) {
342
- const { plaidAccountKeyType } = action.payload;
343
- draft[plaidAccountKeyType].accountDetails.primaryFundingAccountUpdateStatus = {
367
+ const { accountId, accountType } = action.payload;
368
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccountUpdateStatus = {
344
369
  fetchState: 'Completed',
345
370
  error: undefined,
346
371
  };
372
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccount = {
373
+ accountId: accountId,
374
+ accountType: accountType,
375
+ };
347
376
  },
348
- prepare(plaidAccountKeyType) {
377
+ prepare(accountId, accountType) {
349
378
  return {
350
- payload: { plaidAccountKeyType },
379
+ payload: { accountId, accountType },
351
380
  };
352
381
  },
353
382
  },
354
383
  updatePrimaryFundingAccountFailure: {
355
384
  reducer(draft, action) {
356
- draft[action.payload.plaidAccountKeyType].accountDetails.primaryFundingAccountUpdateStatus = {
385
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccountUpdateStatus = {
357
386
  fetchState: 'Error',
358
- error: action.payload.error,
387
+ error: action.payload,
359
388
  };
360
389
  },
361
- prepare(plaidAccountKeyType, error) {
390
+ prepare(error) {
362
391
  return {
363
- payload: { error, plaidAccountKeyType },
392
+ payload: error,
364
393
  };
365
394
  },
366
395
  },
367
396
  updateMappedCashAccount: {
368
- reducer(draft, action) {
369
- draft[action.payload.plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
397
+ reducer(draft) {
398
+ draft['reimbursement_setup'].accountDetails.updateStatus = {
370
399
  fetchState: 'In-Progress',
371
400
  error: undefined,
372
401
  };
373
402
  },
374
- prepare(plaidAccountKeyType, accountId, depositAccountId) {
375
- return { payload: { plaidAccountKeyType, accountId, depositAccountId } };
403
+ prepare(accountId, depositAccountId) {
404
+ return { payload: { accountId, depositAccountId } };
376
405
  },
377
406
  },
378
407
  updateMappedCashAccountSuccess: {
379
- reducer(draft, action) {
380
- draft[action.payload.plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
408
+ reducer(draft) {
409
+ draft['reimbursement_setup'].accountDetails.updateStatus = {
381
410
  fetchState: 'Completed',
382
411
  error: undefined,
383
412
  };
384
413
  },
385
- prepare(plaidAccountKeyType) {
414
+ prepare(depositAccountIds) {
386
415
  return {
387
- payload: { plaidAccountKeyType },
416
+ payload: { depositAccountIds },
388
417
  };
389
418
  },
390
419
  },
391
420
  updateMappedCashAccountFailure: {
392
421
  reducer(draft, action) {
393
- draft[action.payload.plaidAccountKeyType].accountDetails.cashAccountUpdateStatus = {
422
+ draft['reimbursement_setup'].accountDetails.updateStatus = {
394
423
  fetchState: 'Error',
395
- error: action.payload.error,
424
+ error: action.payload,
396
425
  };
397
426
  },
398
- prepare(plaidAccountKeyType, error) {
427
+ prepare(error) {
399
428
  return {
400
- payload: { plaidAccountKeyType, error },
429
+ payload: error,
401
430
  };
402
431
  },
403
432
  },
@@ -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' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup';
4
+ export declare type PlaidAccountKeyType = 'spend_management_setup' | 'reimbursement_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,8 +12,14 @@ export declare const initialPlaidAccountState: PlaidAccountState;
12
12
  export interface PlaidAccountState {
13
13
  accountDetails: {
14
14
  fetchStatus: FetchStateAndError;
15
- cashAccountUpdateStatus: FetchStateAndError;
15
+ updateStatus: FetchStateAndError;
16
16
  primaryFundingAccountUpdateStatus?: FetchStateAndError;
17
+ primaryFundingAccount?: {
18
+ accountId: ID;
19
+ accountType: string;
20
+ };
21
+ paymentAccountIds: ID[];
22
+ depositAccountIds: ID[];
17
23
  allBankAccountIds: ID[];
18
24
  };
19
25
  plaidConnectionDetails: PlaidConnectionDetails;
@@ -4,11 +4,9 @@ exports.initialPlaidAccountState = void 0;
4
4
  exports.initialPlaidAccountState = {
5
5
  accountDetails: {
6
6
  fetchStatus: { fetchState: 'Not-Started', error: undefined },
7
- cashAccountUpdateStatus: { fetchState: 'Not-Started', error: undefined },
8
- primaryFundingAccountUpdateStatus: {
9
- fetchState: 'Not-Started',
10
- error: undefined,
11
- },
7
+ updateStatus: { fetchState: 'Not-Started', error: undefined },
8
+ paymentAccountIds: [],
9
+ depositAccountIds: [],
12
10
  allBankAccountIds: [],
13
11
  },
14
12
  plaidConnectionDetails: {
@@ -16,6 +16,8 @@ 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");
19
21
  const depositAccountReducer_1 = require("../../../../../../entity/depositAccount/depositAccountReducer");
20
22
  const paymentAccountListReducer_1 = require("../../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
21
23
  const depositAccountListReducer_1 = require("../../../../zeniAccounts/depositAccountList/depositAccountListReducer");
@@ -32,9 +34,20 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
32
34
  return zeniAPI
33
35
  .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"reimbursement_setup"}`)
34
36
  .pipe((0, operators_1.mergeMap)((response) => {
35
- var _a, _b, _c;
37
+ var _a, _b, _c, _d;
36
38
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
37
39
  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;
38
51
  const actions = [
39
52
  (0, userReducer_1.updateAllUsers)({ users: response.data.users }),
40
53
  (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
@@ -50,9 +63,9 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
50
63
  data: response.data.payment_accounts,
51
64
  updateType: 'replace',
52
65
  }),
53
- (0, depositAccountReducer_1.updateDepositAccounts)((_a = response.data.deposit_accounts) !== null && _a !== void 0 ? _a : []),
66
+ (0, depositAccountReducer_1.updateDepositAccounts)((_b = response.data.deposit_accounts) !== null && _b !== void 0 ? _b : []),
54
67
  (0, depositAccountListReducer_1.updateDepositAccountList)({
55
- data: (_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.deposit_accounts) !== null && _c !== void 0 ? _c : [],
68
+ data: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.deposit_accounts) !== null && _d !== void 0 ? _d : [],
56
69
  updateType: 'replace',
57
70
  }),
58
71
  (0, setupViewReducer_1.updateSetupViewLocalStoreData)({
@@ -61,7 +74,7 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
61
74
  (0, remiSetupViewReducer_1.updateRemiSetupViewLocalStoreData)({
62
75
  companyId: response.data.companies[0].company_id,
63
76
  }),
64
- (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'reimbursement_setup'),
77
+ (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'reimbursement_setup', depositAccountIds, primaryFundingAccount),
65
78
  (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)(),
66
79
  ];
67
80
  return (0, rxjs_1.from)(actions);
@@ -76,10 +89,10 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
76
89
  }), (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))))));
77
90
  }
78
91
  else {
79
- const { allBankAccountIds } = plaidAccountViewState['reimbursement_setup'].accountDetails;
92
+ const { allBankAccountIds, paymentAccountIds, depositAccountIds, primaryFundingAccount, } = plaidAccountViewState['reimbursement_setup'].accountDetails;
80
93
  return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
81
94
  companyId,
82
- }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'reimbursement_setup'), (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)());
95
+ }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'reimbursement_setup', depositAccountIds, primaryFundingAccount), (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)());
83
96
  }
84
97
  }));
85
98
  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 { plaidConnectionDetails } = plaidAccountViewState['external_account'];
12
+ const { accountDetails, 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 } = paymentAccountListState;
17
+ const { paymentAccountIds } = accountDetails;
18
18
  const externalAccountsSelectorView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
19
19
  let summary = undefined;
20
20
  if (zeniAccountListState.currentTab.id === 'zeniAccounts') {