@zeniai/client-epic-state 4.10.48 → 4.10.49

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 (68) hide show
  1. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
  2. package/lib/entity/paymentAccount/paymentAccountSelector.js +1 -5
  3. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  4. package/lib/entity/tenant/clearAllEpic.js +2 -0
  5. package/lib/epic.d.ts +6 -6
  6. package/lib/epic.js +6 -6
  7. package/lib/index.d.ts +6 -3
  8. package/lib/index.js +18 -15
  9. package/lib/reducer.d.ts +3 -0
  10. package/lib/reducer.js +3 -0
  11. package/lib/view/onboardingView/customerView/epic/plaidConnection/getOnboardingPlaidLinkTokenEpic.js +1 -1
  12. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -2
  13. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +2 -1
  14. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +2 -1
  15. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +1 -1
  16. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +2 -2
  17. package/lib/view/settingsView/settingsViewSelector.js +3 -3
  18. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -2
  19. package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
  20. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +3 -2
  21. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +5 -4
  22. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -2
  23. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +1 -1
  24. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +5 -5
  25. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +1 -1
  26. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
  27. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +3 -2
  28. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +5 -4
  29. package/lib/view/spendManagement/commonSetup/setupViewPayload.d.ts +1 -1
  30. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +3 -59
  31. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -334
  32. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +3 -2
  33. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +12 -6
  34. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -14
  35. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/getPaymentAccountsEpic.d.ts +1 -1
  36. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/getPaymentAccountsEpic.js +6 -6
  37. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountEpic.d.ts +1 -1
  38. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountEpic.js +6 -6
  39. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.d.ts +1 -1
  40. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +7 -7
  41. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountStatusEpic.d.ts +1 -1
  42. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +7 -7
  43. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -2
  44. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/establishPlaidConnectionEpic.js +7 -7
  45. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/getPlaidLinkTokenEpic.d.ts +2 -2
  46. package/lib/view/spendManagement/{commonSetup → plaidAccount}/epic/plaidConnection/getPlaidLinkTokenEpic.js +6 -6
  47. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +85 -0
  48. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +332 -0
  49. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.d.ts +2 -0
  50. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.js +7 -0
  51. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +21 -0
  52. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +29 -0
  53. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.d.ts +3 -2
  54. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +5 -4
  55. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/updateMileageDetailsEpic.d.ts +3 -2
  56. package/lib/view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector.js +1 -1
  57. package/lib/view/spendManagement/zeniAccounts/depositAccountList/fetchDepositAccountListEpic.js +5 -5
  58. package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListPayload.d.ts +1 -1
  59. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +1 -1
  60. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
  61. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +3 -2
  62. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +5 -4
  63. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
  64. package/package.json +1 -1
  65. /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/paymentAccount.d.ts +0 -0
  66. /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/paymentAccount.js +0 -0
  67. /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/plaidConnection.d.ts +0 -0
  68. /package/lib/view/spendManagement/{commonSetup → plaidAccount}/types/plaidConnection.js +0 -0
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const editBillViewReducer_1 = require("../editBillViewReducer");
7
7
  const classListReducer_1 = require("../../../../classList/classListReducer");
8
8
  const accountListReducer_1 = require("../../../../accountList/accountListReducer");
9
- const setupViewReducer_1 = require("../../../commonSetup/setupViewReducer");
9
+ const plaidAccountViewReducer_1 = require("../../../plaidAccount/plaidAccountViewReducer");
10
10
  const billPaySetupApproverViewReducer_1 = require("../../billPaySetupApproverView/billPaySetupApproverViewReducer");
11
11
  const ownerListReducer_1 = require("../../../../ownerList/ownerListReducer");
12
12
  const vendorTypeListReducer_1 = require("../../../../vendorTypeList/vendorTypeListReducer");
@@ -25,7 +25,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
25
25
  : undefined;
26
26
  const currentCompany = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId !== null && companyId !== void 0 ? companyId : '');
27
27
  const isCompanyZeniAccountsSetUpDone = (_c = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyZeniAccountInfo.isZeniAccountEnabled) !== null && _c !== void 0 ? _c : false;
28
- if (cacheOverride == true) {
28
+ if (cacheOverride) {
29
29
  billDetailActions.push((0, accountListReducer_1.fetchAccountList)('billPayAccountList', true, true, true));
30
30
  billDetailActions.push((0, classListReducer_1.fetchClassList)());
31
31
  billDetailActions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
@@ -34,7 +34,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
34
34
  if (isCompanyZeniAccountsSetUpDone) {
35
35
  billDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
36
36
  }
37
- billDetailActions.push((0, setupViewReducer_1.getPaymentAccounts)('bill_pay'));
37
+ billDetailActions.push((0, plaidAccountViewReducer_1.getPaymentAccounts)('bill_pay', 'spend_management_setup'));
38
38
  if (billId != null) {
39
39
  billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, true, isShowDeletedBillsEnabled));
40
40
  }
@@ -73,10 +73,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
73
73
  depositAccounts.fetchState !== 'Completed') {
74
74
  billDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
75
75
  }
76
- const paymentAccount = state.setupViewState.accountDetails;
76
+ const paymentAccount = state.plaidAccountViewState['spend_management_setup'].accountDetails;
77
77
  if (paymentAccount.fetchStatus.fetchState !== 'In-Progress' &&
78
78
  paymentAccount.fetchStatus.fetchState !== 'Completed') {
79
- billDetailActions.push((0, setupViewReducer_1.getPaymentAccounts)('bill_pay'));
79
+ billDetailActions.push((0, plaidAccountViewReducer_1.getPaymentAccounts)('bill_pay', 'spend_management_setup'));
80
80
  }
81
81
  if (billId != null) {
82
82
  billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false, isShowDeletedBillsEnabled));
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
3
3
  import { convertAmountToHomeCurrency, initializeBillToLocalStore, saveBillUpdatesToLocalStore, updateEditBillFetchStateCompleted } from '../editBillViewReducer';
4
4
  import { RootState } from '../../../../../reducer';
5
5
  import { fetchClassList } from '../../../../classList/classListReducer';
6
- import { getPaymentAccounts } from '../../../commonSetup/setupViewReducer';
6
+ import { getPaymentAccounts } from '../../../plaidAccount/plaidAccountViewReducer';
7
7
  import { LineItemRecommendationsLocalData } from '../editBillViewSelector';
8
8
  import { RecommendationByLineId } from '../../../../../entity/transaction/stateTypes/transaction';
9
9
  import { Vendor } from '../../../../../entity/vendor/vendorState';
@@ -5,7 +5,7 @@ const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompan
5
5
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
6
6
  const helpers_1 = require("../../helpers");
7
7
  function getChargeCardSetupViewDetails(state, companyId) {
8
- const chargeCardSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'charge_cards');
8
+ const chargeCardSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'charge_cards', 'spend_management_setup');
9
9
  const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
10
10
  const companyChargeCardInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyChargeCardInfo;
11
11
  const { chargeCardSetupViewState, setupViewState } = state;
@@ -10,7 +10,8 @@ import { updateAllUsers } from '../../../../../entity/user/userReducer';
10
10
  import { updateUserRoles } from '../../../../../entity/userRole/userRoleReducer';
11
11
  import { RootState } from '../../../../../reducer';
12
12
  import { ZeniAPI } from '../../../../../zeniAPI';
13
- import { updateSetupViewAccountDetails, updateSetupViewLocalStoreData } from '../../../commonSetup/setupViewReducer';
13
+ import { updateSetupViewLocalStoreData } from '../../../commonSetup/setupViewReducer';
14
14
  import { fetchChargeCardSetupView, fetchChargeCardSetupViewFailure, fetchChargeCardSetupViewSuccess } from '../chargeCardSetUpViewReducer';
15
- 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 updateSetupViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchChargeCardSetupViewSuccess> | ReturnType<typeof fetchChargeCardSetupViewFailure>;
15
+ import { updatePlaidAccountViewAccountDetails } from '../../../plaidAccount/plaidAccountViewReducer';
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>;
16
17
  export declare const fetchChargeCardSetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -15,10 +15,11 @@ const userRoleReducer_1 = require("../../../../../entity/userRole/userRoleReduce
15
15
  const responsePayload_1 = require("../../../../../responsePayload");
16
16
  const setupViewReducer_1 = require("../../../commonSetup/setupViewReducer");
17
17
  const chargeCardSetUpViewReducer_1 = require("../chargeCardSetUpViewReducer");
18
+ const plaidAccountViewReducer_1 = require("../../../plaidAccount/plaidAccountViewReducer");
18
19
  const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardSetUpViewReducer_1.fetchChargeCardSetupView.match), (0, operators_1.switchMap)((action) => {
19
20
  var _a;
20
21
  const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
21
- const { chargeCardSetupViewState, setupViewState, companyState } = state$.value;
22
+ const { chargeCardSetupViewState, plaidAccountViewState, companyState } = state$.value;
22
23
  const company = (_a = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId)) === null || _a === void 0 ? void 0 : _a.company;
23
24
  if (cacheOverride === true ||
24
25
  refreshViewInBackground === true ||
@@ -45,7 +46,7 @@ const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pip
45
46
  (0, setupViewReducer_1.updateSetupViewLocalStoreData)({
46
47
  companyId: response.data.companies[0].company_id,
47
48
  }),
48
- (0, setupViewReducer_1.updateSetupViewAccountDetails)(allBankAccountIds, paymentAccountIds),
49
+ (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'),
49
50
  (0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupViewSuccess)(),
50
51
  ];
51
52
  return (0, rxjs_1.from)(actions);
@@ -61,10 +62,10 @@ const fetchChargeCardSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pip
61
62
  JSON.stringify(error))))));
62
63
  }
63
64
  else {
64
- const { allBankAccountIds, paymentAccountIds } = setupViewState.accountDetails;
65
+ const { allBankAccountIds, paymentAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
65
66
  return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
66
67
  companyId,
67
- }), (0, setupViewReducer_1.updateSetupViewAccountDetails)(allBankAccountIds, paymentAccountIds), (0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupViewSuccess)());
68
+ }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'), (0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupViewSuccess)());
68
69
  }
69
70
  }));
70
71
  exports.fetchChargeCardSetupViewEpic = fetchChargeCardSetupViewEpic;
@@ -4,7 +4,7 @@ import { UserPayload } from '../../../entity/user/userPayload';
4
4
  import { UserRolePayload } from '../../../entity/userRole/userRolePayload';
5
5
  import { FilePayload } from '../../../entity/file/filePayload';
6
6
  import { AddressPayload } from '../../../entity/address/addressPayload';
7
- import { PaymentAccountsPayload } from './types/paymentAccount';
7
+ import { PaymentAccountsPayload } from '../plaidAccount/types/paymentAccount';
8
8
  /**
9
9
  * Setup View Payload
10
10
  */
@@ -2,7 +2,7 @@ import { ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniDate } from '../../../zeniDayJS';
3
3
  import { ZeniAPIStatus } from '../../../responsePayload';
4
4
  import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
5
- import { PlaidLinkTokenType, SetupViewLocalData, SetupViewState } from './setupViewState';
5
+ import { SetupViewLocalData, SetupViewState } from './setupViewState';
6
6
  export declare const initialState: SetupViewState;
7
7
  export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards"], {
8
8
  companyId: string;
@@ -14,60 +14,7 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
14
14
  sendForVerification: any;
15
15
  fromBillListScreen: any;
16
16
  isSubmittingAdditionalDocuments: any;
17
- }, string, never, never>, updateBusinessVerificationDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBusinessVerificationDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", includeBalances?: any], {
18
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
19
- includeBalances: any;
20
- }, string, never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[]], {
21
- paymentAccountIds: string[];
22
- }, string, never, never>, getPaymentAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards"], {
23
- accountId: string;
24
- paymentAccountId: string;
25
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
26
- }, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[]], {
27
- paymentAccountIds: string[];
28
- }, string, never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", linkTokenType?: PlaidLinkTokenType | undefined], {
29
- verificationStatusCode: string;
30
- paymentAccountId: string;
31
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
32
- linkTokenType: PlaidLinkTokenType;
33
- }, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType], {
34
- paymentAccountIds: string[];
35
- linkTokenType: PlaidLinkTokenType;
36
- }, string, never, never>, updatePaymentAccountStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType], {
37
- error: ZeniAPIStatus<Record<string, unknown>>;
38
- linkTokenType: PlaidLinkTokenType;
39
- }, string, never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", linkTokenType?: PlaidLinkTokenType | undefined], {
40
- isLoginRequired: boolean;
41
- paymentAccountId: string;
42
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
43
- linkTokenType: PlaidLinkTokenType;
44
- }, string, never, never>, updatePaymentAccountLoginStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType], {
45
- paymentAccountIds: string[];
46
- linkTokenType: PlaidLinkTokenType;
47
- }, string, never, never>, updatePaymentAccountLoginStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType], {
48
- error: ZeniAPIStatus<Record<string, unknown>>;
49
- linkTokenType: PlaidLinkTokenType;
50
- }, string, never, never>, getPlaidLinkToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType?: PlaidLinkTokenType | undefined, paymentAccountId?: string | undefined], {
51
- linkTokenType: PlaidLinkTokenType;
52
- paymentAccountId: string | undefined;
53
- }, string, never, never>, getPlaidLinkTokenSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkToken: string, expiration: string, linkTokenType: PlaidLinkTokenType], {
54
- linkToken: string;
55
- expiration: string;
56
- linkTokenType: PlaidLinkTokenType;
57
- }, string, never, never>, getPlaidLinkTokenFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType], {
58
- error: ZeniAPIStatus<Record<string, unknown>>;
59
- linkTokenType: PlaidLinkTokenType;
60
- }, string, never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
61
- publicToken: string;
62
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined;
63
- linkTokenType: PlaidLinkTokenType;
64
- }, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType], {
65
- paymentAccountIds: string[];
66
- linkTokenType: PlaidLinkTokenType;
67
- }, string, never, never>, establishPlaidConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType], {
68
- error: ZeniAPIStatus<Record<string, unknown>>;
69
- linkTokenType: PlaidLinkTokenType;
70
- }, string, never, never>, updateSelectedCompanyOfficer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedOfficerType: "Officer_2" | "Officer_1" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10"], {
17
+ }, string, never, never>, updateBusinessVerificationDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBusinessVerificationDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, updateSelectedCompanyOfficer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedOfficerType: "Officer_2" | "Officer_1" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10"], {
71
18
  selectedOfficerType: "Officer_2" | "Officer_1" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10";
72
19
  }, string, never, never>, updateSetupViewLocalStoreData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
73
20
  companyId: ID;
@@ -77,10 +24,7 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
77
24
  }, string>, saveCompnayOfficerAdditionalDocumentsInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
78
25
  officerType: CompanyOfficerType;
79
26
  fileIds: ID[];
80
- }, string>, updateSetupViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], paymentAccountIds: string[]], {
81
- allBankAccountIds: string[];
82
- paymentAccountIds: string[];
83
- }, string, never, never>, sendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
27
+ }, string>, sendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
84
28
  otpChallenge: string;
85
29
  }, string>, sendOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, verifyOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, saveIndustryAndIncDateInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
86
30
  industry: string;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.updateSetupViewAccountDetails = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.establishPlaidConnectionFailure = exports.establishPlaidConnectionSuccess = exports.establishPlaidConnection = exports.getPlaidLinkTokenFailure = exports.getPlaidLinkTokenSuccess = exports.getPlaidLinkToken = exports.updatePaymentAccountLoginStatusFailure = exports.updatePaymentAccountLoginStatusSuccess = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccountStatusFailure = exports.updatePaymentAccountStatusSuccess = exports.updatePaymentAccountStatus = exports.updatePaymentAccountFailure = exports.updatePaymentAccountSuccess = exports.updatePaymentAccount = exports.getPaymentAccountsFailure = exports.getPaymentAccountsSuccess = exports.getPaymentAccounts = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
4
+ exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
- const zeniDayJS_1 = require("../../../zeniDayJS");
7
6
  const initialFetchStatus = {
8
7
  fetchState: 'Not-Started',
9
8
  error: undefined,
@@ -64,30 +63,6 @@ exports.initialState = {
64
63
  },
65
64
  },
66
65
  primaryContactDetails: {},
67
- accountDetails: {
68
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
69
- updateStatus: { fetchState: 'Not-Started', error: undefined },
70
- paymentAccountIds: [],
71
- allBankAccountIds: [],
72
- },
73
- plaidConnectionDetails: {
74
- link_account: {
75
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
76
- updateStatus: { fetchState: 'Not-Started', error: undefined },
77
- },
78
- update_account: {
79
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
80
- updateStatus: { fetchState: 'Not-Started', error: undefined },
81
- },
82
- link_account_no_microdeposit: {
83
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
84
- updateStatus: { fetchState: 'Not-Started', error: undefined },
85
- },
86
- link_external_account: {
87
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
88
- updateStatus: { fetchState: 'Not-Started', error: undefined },
89
- },
90
- },
91
66
  };
92
67
  const setupView = (0, toolkit_1.createSlice)({
93
68
  name: 'setupView',
@@ -144,299 +119,6 @@ const setupView = (0, toolkit_1.createSlice)({
144
119
  };
145
120
  },
146
121
  },
147
- getPaymentAccounts: {
148
- reducer(draft) {
149
- draft.accountDetails.fetchStatus = {
150
- fetchState: 'In-Progress',
151
- error: undefined,
152
- };
153
- },
154
- prepare(setupViewType, includeBalances = true) {
155
- return { payload: { setupViewType, includeBalances } };
156
- },
157
- },
158
- getPaymentAccountsSuccess: {
159
- reducer(draft, action) {
160
- const { paymentAccountIds } = action.payload;
161
- draft.accountDetails.fetchStatus = {
162
- fetchState: 'Completed',
163
- error: undefined,
164
- };
165
- draft.accountDetails.paymentAccountIds = paymentAccountIds;
166
- },
167
- prepare(paymentAccountIds) {
168
- return {
169
- payload: { paymentAccountIds },
170
- };
171
- },
172
- },
173
- getPaymentAccountsFailure: {
174
- reducer(draft, action) {
175
- draft.accountDetails.fetchStatus = {
176
- fetchState: 'Error',
177
- error: action.payload,
178
- };
179
- },
180
- prepare(error) {
181
- return {
182
- payload: error,
183
- };
184
- },
185
- },
186
- updatePaymentAccount: {
187
- reducer(draft) {
188
- draft.accountDetails.updateStatus = {
189
- fetchState: 'In-Progress',
190
- error: undefined,
191
- };
192
- },
193
- prepare(accountId, paymentAccountId, setupViewType) {
194
- return { payload: { accountId, paymentAccountId, setupViewType } };
195
- },
196
- },
197
- updatePaymentAccountSuccess: {
198
- reducer(draft, action) {
199
- const { paymentAccountIds } = action.payload;
200
- draft.accountDetails.updateStatus = {
201
- fetchState: 'Completed',
202
- error: undefined,
203
- };
204
- draft.accountDetails.paymentAccountIds = paymentAccountIds;
205
- },
206
- prepare(paymentAccountIds) {
207
- return {
208
- payload: { paymentAccountIds },
209
- };
210
- },
211
- },
212
- updatePaymentAccountFailure: {
213
- reducer(draft, action) {
214
- draft.accountDetails.updateStatus = {
215
- fetchState: 'Error',
216
- error: action.payload,
217
- };
218
- },
219
- prepare(error) {
220
- return {
221
- payload: error,
222
- };
223
- },
224
- },
225
- updatePaymentAccountStatus: {
226
- reducer(draft, action) {
227
- const { linkTokenType } = action.payload;
228
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
229
- updateStatus: {
230
- fetchState: 'In-Progress',
231
- error: undefined,
232
- },
233
- });
234
- },
235
- prepare(verificationStatusCode, paymentAccountId, setupViewType, linkTokenType) {
236
- return {
237
- payload: {
238
- verificationStatusCode,
239
- paymentAccountId,
240
- setupViewType,
241
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
242
- },
243
- };
244
- },
245
- },
246
- updatePaymentAccountStatusSuccess: {
247
- reducer(draft, action) {
248
- const { paymentAccountIds, linkTokenType } = action.payload;
249
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
250
- updateStatus: {
251
- fetchState: 'Completed',
252
- error: undefined,
253
- },
254
- });
255
- draft.accountDetails.paymentAccountIds = paymentAccountIds;
256
- },
257
- prepare(paymentAccountIds, linkTokenType) {
258
- return {
259
- payload: { paymentAccountIds, linkTokenType },
260
- };
261
- },
262
- },
263
- updatePaymentAccountStatusFailure: {
264
- reducer(draft, action) {
265
- const { error, linkTokenType } = action.payload;
266
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
267
- updateStatus: {
268
- fetchState: 'Error',
269
- error,
270
- },
271
- });
272
- },
273
- prepare(error, linkTokenType) {
274
- return {
275
- payload: { error, linkTokenType },
276
- };
277
- },
278
- },
279
- updatePaymentAccountLoginStatus: {
280
- reducer(draft, action) {
281
- const { linkTokenType } = action.payload;
282
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
283
- updateStatus: {
284
- fetchState: 'In-Progress',
285
- error: undefined,
286
- },
287
- });
288
- },
289
- prepare(isLoginRequired, paymentAccountId, setupViewType, linkTokenType) {
290
- return {
291
- payload: {
292
- isLoginRequired,
293
- paymentAccountId,
294
- setupViewType,
295
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
296
- },
297
- };
298
- },
299
- },
300
- updatePaymentAccountLoginStatusSuccess: {
301
- reducer(draft, action) {
302
- const { paymentAccountIds, linkTokenType } = action.payload;
303
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
304
- updateStatus: {
305
- fetchState: 'Completed',
306
- error: undefined,
307
- },
308
- });
309
- draft.accountDetails.paymentAccountIds = paymentAccountIds;
310
- },
311
- prepare(paymentAccountIds, linkTokenType) {
312
- return {
313
- payload: { paymentAccountIds, linkTokenType },
314
- };
315
- },
316
- },
317
- updatePaymentAccountLoginStatusFailure: {
318
- reducer(draft, action) {
319
- const { error, linkTokenType } = action.payload;
320
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
321
- updateStatus: {
322
- fetchState: 'Error',
323
- error,
324
- },
325
- });
326
- },
327
- prepare(error, linkTokenType) {
328
- return {
329
- payload: { error, linkTokenType },
330
- };
331
- },
332
- },
333
- getPlaidLinkToken: {
334
- reducer(draft, action) {
335
- const { linkTokenType, paymentAccountId } = action.payload;
336
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
337
- fetchStatus: {
338
- fetchState: 'In-Progress',
339
- error: undefined,
340
- },
341
- });
342
- if (paymentAccountId != null) {
343
- draft.accountDetails.paymentAccountIds = [paymentAccountId];
344
- }
345
- },
346
- prepare(linkTokenType, paymentAccountId) {
347
- return {
348
- payload: {
349
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
350
- paymentAccountId: paymentAccountId,
351
- },
352
- };
353
- },
354
- },
355
- getPlaidLinkTokenSuccess: {
356
- prepare(linkToken, expiration, linkTokenType) {
357
- return { payload: { linkToken, expiration, linkTokenType } };
358
- },
359
- reducer(draft, action) {
360
- const { linkToken, expiration, linkTokenType } = action.payload;
361
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
362
- fetchStatus: {
363
- fetchState: 'Completed',
364
- error: undefined,
365
- },
366
- linkToken,
367
- expiration: (0, zeniDayJS_1.date)(expiration),
368
- });
369
- },
370
- },
371
- getPlaidLinkTokenFailure: {
372
- reducer(draft, action) {
373
- const { error, linkTokenType } = action.payload;
374
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
375
- fetchStatus: {
376
- fetchState: 'Error',
377
- error,
378
- },
379
- });
380
- },
381
- prepare(error, linkTokenType) {
382
- return {
383
- payload: { error, linkTokenType },
384
- };
385
- },
386
- },
387
- establishPlaidConnection: {
388
- reducer(draft, action) {
389
- const { linkTokenType } = action.payload;
390
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
391
- updateStatus: {
392
- fetchState: 'In-Progress',
393
- error: undefined,
394
- },
395
- });
396
- },
397
- prepare(publicToken, setupViewType, linkTokenType) {
398
- return {
399
- payload: {
400
- publicToken,
401
- setupViewType,
402
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
403
- },
404
- };
405
- },
406
- },
407
- establishPlaidConnectionSuccess: {
408
- reducer(draft, action) {
409
- const { paymentAccountIds, linkTokenType } = action.payload;
410
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
411
- updateStatus: {
412
- fetchState: 'Completed',
413
- error: undefined,
414
- },
415
- });
416
- draft.accountDetails.paymentAccountIds = paymentAccountIds;
417
- },
418
- prepare(paymentAccountIds, linkTokenType) {
419
- return {
420
- payload: { paymentAccountIds, linkTokenType },
421
- };
422
- },
423
- },
424
- establishPlaidConnectionFailure: {
425
- reducer(draft, action) {
426
- const { linkTokenType, error } = action.payload;
427
- draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
428
- updateStatus: {
429
- fetchState: 'Error',
430
- error,
431
- },
432
- });
433
- },
434
- prepare(error, linkTokenType) {
435
- return {
436
- payload: { error, linkTokenType },
437
- };
438
- },
439
- },
440
122
  updateSelectedCompanyOfficer: {
441
123
  reducer(draft, action) {
442
124
  const { selectedOfficerType } = action.payload;
@@ -491,20 +173,6 @@ const setupView = (0, toolkit_1.createSlice)({
491
173
  phone: action.payload.phone,
492
174
  });
493
175
  },
494
- updateSetupViewAccountDetails: {
495
- prepare(allBankAccountIds, paymentAccountIds) {
496
- return { payload: { allBankAccountIds, paymentAccountIds } };
497
- },
498
- reducer(draft, action) {
499
- const { allBankAccountIds, paymentAccountIds } = action.payload;
500
- draft.accountDetails.allBankAccountIds = allBankAccountIds;
501
- draft.accountDetails.paymentAccountIds = paymentAccountIds;
502
- draft.accountDetails.fetchStatus = {
503
- fetchState: 'Completed',
504
- error: undefined,
505
- };
506
- },
507
- },
508
176
  sendOtp(draft) {
509
177
  Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
510
178
  var _a;
@@ -619,5 +287,5 @@ const setupView = (0, toolkit_1.createSlice)({
619
287
  },
620
288
  },
621
289
  });
622
- _a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
290
+ _a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
623
291
  exports.default = setupView.reducer;
@@ -9,7 +9,8 @@ import { AccountBase } from '../../../entity/account/accountState';
9
9
  import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
10
10
  import { CompanyView } from '../../companyView/types/companyView';
11
11
  import { NewAddressData } from '../../addressView/addressViewState';
12
- import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PlaidConnectionDetails, PrimaryContactLocalData, SetupViewType } from './setupViewState';
12
+ import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PrimaryContactLocalData, SetupViewType } from './setupViewState';
13
+ import { PlaidAccountKeyType, PlaidConnectionDetails } from '../plaidAccount/plaidAccountViewState';
13
14
  export interface SetupView {
14
15
  companyBillPayInfo?: CompanyBillPayInfo;
15
16
  paymentAccount?: PaymentAccount;
@@ -53,6 +54,6 @@ export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData
53
54
  companyView?: CompanyView;
54
55
  updateStatus: FetchStateAndError;
55
56
  }
56
- export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType): SetupView;
57
+ export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType, plaidAccountKeyType: PlaidAccountKeyType): SetupView;
57
58
  export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
58
59
  export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
@@ -3,18 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  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
- const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
7
6
  const fileViewSelector_1 = require("../../fileView/fileViewSelector");
8
7
  const getCompanyView_1 = require("../../companyView/selectorHelpers/getCompanyView");
9
- function getCommonSetupViewDetails(state, companyId, setupViewType) {
8
+ const plaidAccountViewSelector_1 = require("../plaidAccount/plaidAccountViewSelector");
9
+ const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
10
+ function getCommonSetupViewDetails(state, companyId, setupViewType, plaidAccountKeyType) {
10
11
  var _a;
11
- const { accountState, setupViewState, paymentAccountState } = state;
12
- const { accountDetails, plaidConnectionDetails, updateStatus } = setupViewState;
13
- const { allBankAccountIds } = accountDetails;
12
+ const { accountState, setupViewState, paymentAccountState, plaidAccountViewState, } = state;
13
+ const { updateStatus } = setupViewState;
14
+ const { accountDetails, plaidConnectionDetails } = (0, plaidAccountViewSelector_1.getPlaidAccountwDetails)(plaidAccountViewState, plaidAccountKeyType);
15
+ const { allBankAccountIds, paymentAccountIds } = accountDetails;
14
16
  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 : [];
15
17
  const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
16
18
  const companyBillPayInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo;
17
- const paymentAccount = (0, paymentAccountSelector_1.getSpendManagementPrimaryPaymentAccount)(paymentAccountState);
19
+ let paymentAccount;
20
+ if ((paymentAccountIds === null || paymentAccountIds === void 0 ? void 0 : paymentAccountIds.length) > 0) {
21
+ const paymentAccountId = paymentAccountIds[0];
22
+ paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, paymentAccountId);
23
+ }
18
24
  return {
19
25
  companyBillPayInfo,
20
26
  paymentAccount,