@zeniai/client-epic-state 4.10.66 → 4.10.68

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/company/companyPayload.d.ts +4 -0
  2. package/lib/entity/company/companyPayload.js +10 -1
  3. package/lib/entity/company/companyStateTypes.d.ts +5 -0
  4. package/lib/entity/depositAccount/depositAccount.d.ts +1 -0
  5. package/lib/entity/depositAccount/depositAccountPayload.d.ts +1 -0
  6. package/lib/entity/depositAccount/depositAccountPayload.js +1 -0
  7. package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +1 -0
  8. package/lib/entity/paymentAccount/paymentAccountPayload.js +1 -0
  9. package/lib/entity/paymentAccount/paymentAccountState.d.ts +1 -0
  10. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  11. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  12. package/lib/entity/tenant/tenantSelector.js +4 -2
  13. package/lib/epic.d.ts +4 -1
  14. package/lib/epic.js +4 -1
  15. package/lib/index.d.ts +12 -11
  16. package/lib/index.js +15 -10
  17. package/lib/reducer.d.ts +3 -0
  18. package/lib/reducer.js +3 -0
  19. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +1 -0
  20. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +2 -1
  21. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +14 -1
  22. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.d.ts +8 -2
  23. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.js +41 -3
  24. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +7 -0
  25. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +2 -1
  26. package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +1 -0
  27. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  28. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  29. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  30. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  31. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  32. package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.d.ts +2 -1
  33. package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.js +9 -1
  34. package/lib/view/reviewCompanyView/reviewCompanyViewReducer.d.ts +2 -1
  35. package/lib/view/reviewCompanyView/reviewCompanyViewReducer.js +2 -2
  36. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  37. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +2 -2
  38. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +2 -2
  39. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -2
  40. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -5
  41. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -4
  42. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +2 -2
  43. package/lib/view/spendManagement/commonSetup/setupViewPayload.d.ts +2 -0
  44. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +28 -3
  45. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +79 -5
  46. package/lib/view/spendManagement/helpers.d.ts +1 -0
  47. package/lib/view/spendManagement/helpers.js +5 -1
  48. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.d.ts +9 -0
  49. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +31 -0
  50. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.d.ts +8 -0
  51. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +39 -0
  52. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +23 -2
  53. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +96 -8
  54. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.d.ts +1 -1
  55. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.js +3 -3
  56. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +7 -1
  57. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +1 -0
  58. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.d.ts +2 -1
  59. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +18 -3
  60. package/lib/view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector.js +1 -1
  61. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +1 -0
  62. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.d.ts +3 -6
  63. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +3 -44
  64. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailState.d.ts +4 -14
  65. package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
  66. package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
  67. package/lib/view/vendorTabView/fetchVendorTabViewEpic.d.ts +9 -0
  68. package/lib/view/vendorTabView/fetchVendorTabViewEpic.js +53 -0
  69. package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +15 -0
  70. package/lib/view/vendorTabView/vendorTabViewReducer.js +37 -0
  71. package/lib/view/vendorTabView/vendorTabViewState.d.ts +2 -0
  72. package/lib/view/vendorTabView/vendorTabViewState.js +2 -0
  73. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearPlaidAccountView = exports.updatePlaidAccountViewAccountDetails = 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.initialState = void 0;
4
+ exports.clearPlaidAccountView = exports.updateMappedCashAccountFailure = exports.updateMappedCashAccountSuccess = exports.updateMappedCashAccount = exports.updatePrimaryFundingAccountFailure = exports.updatePrimaryFundingAccountSuccess = exports.updatePrimaryFundingAccount = exports.updatePlaidAccountViewAccountDetails = 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.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const zeniDayJS_1 = require("../../../zeniDayJS");
7
7
  const plaidAccountViewState_1 = require("./plaidAccountViewState");
@@ -9,6 +9,7 @@ exports.initialState = {
9
9
  spend_management_setup: plaidAccountViewState_1.initialPlaidAccountState,
10
10
  user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
11
11
  external_account: plaidAccountViewState_1.initialPlaidAccountState,
12
+ reimbursement_setup: plaidAccountViewState_1.initialPlaidAccountState,
12
13
  };
13
14
  const plaidAccountView = (0, toolkit_1.createSlice)({
14
15
  name: 'plaidAccountView',
@@ -77,13 +78,11 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
77
78
  },
78
79
  updatePaymentAccountSuccess: {
79
80
  reducer(draft, action) {
80
- const { paymentAccountIds, plaidAccountKeyType } = action.payload;
81
+ const { plaidAccountKeyType } = action.payload;
81
82
  draft[plaidAccountKeyType].accountDetails.updateStatus = {
82
83
  fetchState: 'Completed',
83
84
  error: undefined,
84
85
  };
85
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
86
- paymentAccountIds;
87
86
  },
88
87
  prepare(paymentAccountIds, plaidAccountKeyType) {
89
88
  return {
@@ -306,27 +305,116 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
306
305
  },
307
306
  },
308
307
  updatePlaidAccountViewAccountDetails: {
309
- prepare(allBankAccountIds, paymentAccountIds, plaidAccountKeyType) {
308
+ prepare(allBankAccountIds, paymentAccountIds, plaidAccountKeyType, depositAccountIds, primaryFundingAccount) {
310
309
  return {
311
- payload: { allBankAccountIds, paymentAccountIds, plaidAccountKeyType },
310
+ payload: {
311
+ allBankAccountIds,
312
+ paymentAccountIds,
313
+ plaidAccountKeyType,
314
+ depositAccountIds,
315
+ primaryFundingAccount,
316
+ },
312
317
  };
313
318
  },
314
319
  reducer(draft, action) {
315
- const { allBankAccountIds, paymentAccountIds, plaidAccountKeyType } = action.payload;
320
+ const { allBankAccountIds, paymentAccountIds, depositAccountIds, primaryFundingAccount, plaidAccountKeyType, } = action.payload;
316
321
  draft[plaidAccountKeyType].accountDetails.allBankAccountIds =
317
322
  allBankAccountIds;
318
323
  draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
319
324
  paymentAccountIds;
325
+ draft[plaidAccountKeyType].accountDetails.depositAccountIds =
326
+ depositAccountIds !== null && depositAccountIds !== void 0 ? depositAccountIds : [];
327
+ draft[plaidAccountKeyType].accountDetails.primaryFundingAccount =
328
+ primaryFundingAccount;
320
329
  draft[plaidAccountKeyType].accountDetails.fetchStatus = {
321
330
  fetchState: 'Completed',
322
331
  error: undefined,
323
332
  };
324
333
  },
325
334
  },
335
+ updatePrimaryFundingAccount: {
336
+ reducer(draft) {
337
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccountUpdateStatus = {
338
+ fetchState: 'In-Progress',
339
+ error: undefined,
340
+ };
341
+ },
342
+ prepare(companyId, accountId, accountType) {
343
+ return { payload: { companyId, accountId, accountType } };
344
+ },
345
+ },
346
+ updatePrimaryFundingAccountSuccess: {
347
+ reducer(draft, action) {
348
+ const { accountId, accountType } = action.payload;
349
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccountUpdateStatus = {
350
+ fetchState: 'Completed',
351
+ error: undefined,
352
+ };
353
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccount = {
354
+ accountId: accountId,
355
+ accountType: accountType,
356
+ };
357
+ },
358
+ prepare(accountId, accountType) {
359
+ return {
360
+ payload: { accountId, accountType },
361
+ };
362
+ },
363
+ },
364
+ updatePrimaryFundingAccountFailure: {
365
+ reducer(draft, action) {
366
+ draft['reimbursement_setup'].accountDetails.primaryFundingAccountUpdateStatus = {
367
+ fetchState: 'Error',
368
+ error: action.payload,
369
+ };
370
+ },
371
+ prepare(error) {
372
+ return {
373
+ payload: error,
374
+ };
375
+ },
376
+ },
377
+ updateMappedCashAccount: {
378
+ reducer(draft) {
379
+ draft['reimbursement_setup'].accountDetails.updateStatus = {
380
+ fetchState: 'In-Progress',
381
+ error: undefined,
382
+ };
383
+ },
384
+ prepare(accountId, depositAccountId) {
385
+ return { payload: { accountId, depositAccountId } };
386
+ },
387
+ },
388
+ updateMappedCashAccountSuccess: {
389
+ reducer(draft) {
390
+ draft['reimbursement_setup'].accountDetails.updateStatus = {
391
+ fetchState: 'Completed',
392
+ error: undefined,
393
+ };
394
+ },
395
+ prepare(depositAccountIds) {
396
+ return {
397
+ payload: { depositAccountIds },
398
+ };
399
+ },
400
+ },
401
+ updateMappedCashAccountFailure: {
402
+ reducer(draft, action) {
403
+ draft['reimbursement_setup'].accountDetails.updateStatus = {
404
+ fetchState: 'Error',
405
+ error: action.payload,
406
+ };
407
+ },
408
+ prepare(error) {
409
+ return {
410
+ payload: error,
411
+ };
412
+ },
413
+ },
326
414
  clearPlaidAccountView(draft) {
327
415
  Object.assign(draft, exports.initialState);
328
416
  },
329
417
  },
330
418
  });
331
- _a = plaidAccountView.actions, 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.updatePlaidAccountViewAccountDetails = _a.updatePlaidAccountViewAccountDetails, exports.clearPlaidAccountView = _a.clearPlaidAccountView;
419
+ _a = plaidAccountView.actions, 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.updatePlaidAccountViewAccountDetails = _a.updatePlaidAccountViewAccountDetails, exports.updatePrimaryFundingAccount = _a.updatePrimaryFundingAccount, exports.updatePrimaryFundingAccountSuccess = _a.updatePrimaryFundingAccountSuccess, exports.updatePrimaryFundingAccountFailure = _a.updatePrimaryFundingAccountFailure, exports.updateMappedCashAccount = _a.updateMappedCashAccount, exports.updateMappedCashAccountSuccess = _a.updateMappedCashAccountSuccess, exports.updateMappedCashAccountFailure = _a.updateMappedCashAccountFailure, exports.clearPlaidAccountView = _a.clearPlaidAccountView;
332
420
  exports.default = plaidAccountView.reducer;
@@ -1,2 +1,2 @@
1
1
  import { PlaidAccountKeyType, PlaidAccountState, PlaidAccountViewState } from './plaidAccountViewState';
2
- export declare function getPlaidAccountwDetails(plaidAccountViewState: PlaidAccountViewState, plaidAccountKeyType: PlaidAccountKeyType): PlaidAccountState;
2
+ export declare function getPlaidAccountDetails(plaidAccountViewState: PlaidAccountViewState, plaidAccountKeyType: PlaidAccountKeyType): PlaidAccountState;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPlaidAccountwDetails = void 0;
4
- function getPlaidAccountwDetails(plaidAccountViewState, plaidAccountKeyType) {
3
+ exports.getPlaidAccountDetails = void 0;
4
+ function getPlaidAccountDetails(plaidAccountViewState, plaidAccountKeyType) {
5
5
  return plaidAccountViewState[plaidAccountKeyType];
6
6
  }
7
- exports.getPlaidAccountwDetails = getPlaidAccountwDetails;
7
+ exports.getPlaidAccountDetails = getPlaidAccountDetails;
@@ -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' | 'user_reimbursement_account' | 'external_account';
4
+ export declare type PlaidAccountKeyType = 'spend_management_setup' | 'reimbursement_setup' | 'user_reimbursement_account' | 'external_account';
5
5
  export declare type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
6
6
  linkToken?: string;
7
7
  expiration?: ZeniDate;
@@ -13,7 +13,13 @@ export interface PlaidAccountState {
13
13
  accountDetails: {
14
14
  fetchStatus: FetchStateAndError;
15
15
  updateStatus: FetchStateAndError;
16
+ primaryFundingAccountUpdateStatus?: FetchStateAndError;
17
+ primaryFundingAccount?: {
18
+ accountId: ID;
19
+ accountType: string;
20
+ };
16
21
  paymentAccountIds: ID[];
22
+ depositAccountIds: ID[];
17
23
  allBankAccountIds: ID[];
18
24
  };
19
25
  plaidConnectionDetails: PlaidConnectionDetails;
@@ -6,6 +6,7 @@ exports.initialPlaidAccountState = {
6
6
  fetchStatus: { fetchState: 'Not-Started', error: undefined },
7
7
  updateStatus: { fetchState: 'Not-Started', error: undefined },
8
8
  paymentAccountIds: [],
9
+ depositAccountIds: [],
9
10
  allBankAccountIds: [],
10
11
  },
11
12
  plaidConnectionDetails: {
@@ -13,5 +13,6 @@ import { openSnackbar } from '../../../../../../entity/snackbar/snackbarReducer'
13
13
  import { updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
14
14
  import { fetchRemiSetupView, fetchRemiSetupViewSuccess, fetchRemiSetupViewFailure, updateRemiSetupViewLocalStoreData } from '../../remiSetupViewReducer';
15
15
  import { updatePlaidAccountViewAccountDetails } from '../../../../plaidAccount/plaidAccountViewReducer';
16
- export declare type ActionType = ReturnType<typeof fetchRemiSetupView> | 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 updateRemiSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchRemiSetupViewSuccess> | ReturnType<typeof fetchRemiSetupViewFailure>;
16
+ import { updateDepositAccounts } from '../../../../../../entity/depositAccount/depositAccountReducer';
17
+ export declare type ActionType = ReturnType<typeof fetchRemiSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateDepositAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof updateRemiSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchRemiSetupViewSuccess> | ReturnType<typeof fetchRemiSetupViewFailure>;
17
18
  export declare const fetchRemiSetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -16,6 +16,9 @@ const snackbarReducer_1 = require("../../../../../../entity/snackbar/snackbarRed
16
16
  const setupViewReducer_1 = require("../../../../commonSetup/setupViewReducer");
17
17
  const remiSetupViewReducer_1 = require("../../remiSetupViewReducer");
18
18
  const plaidAccountViewReducer_1 = require("../../../../plaidAccount/plaidAccountViewReducer");
19
+ const billPayConfigPayload_1 = require("../../../../billPay/billPayConfig/billPayConfigPayload");
20
+ const billPayConfigState_1 = require("../../../../billPay/billPayConfig/billPayConfigState");
21
+ const depositAccountReducer_1 = require("../../../../../../entity/depositAccount/depositAccountReducer");
19
22
  const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupViewReducer_1.fetchRemiSetupView.match), (0, operators_1.switchMap)((action) => {
20
23
  var _a;
21
24
  const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
@@ -29,9 +32,20 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
29
32
  return zeniAPI
30
33
  .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"reimbursement_setup"}`)
31
34
  .pipe((0, operators_1.mergeMap)((response) => {
35
+ var _a, _b;
32
36
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
33
37
  const allBankAccountIds = response.data.accounts.map((account) => account.account_id);
34
38
  const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
39
+ const depositAccountIds = (_a = response.data.deposit_accounts) === null || _a === void 0 ? void 0 : _a.map((depositAccount) => depositAccount.deposit_account_id);
40
+ const primaryFundingAccountPayload = response.data.companies[0].reimbursement_info
41
+ .primary_funding_account;
42
+ const primaryFundingAccount = primaryFundingAccountPayload.account_id != null &&
43
+ primaryFundingAccountPayload.account_type != null
44
+ ? {
45
+ accountId: primaryFundingAccountPayload.account_id,
46
+ accountType: (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)((0, billPayConfigState_1.toAccType)(primaryFundingAccountPayload.account_type)),
47
+ }
48
+ : undefined;
35
49
  const actions = [
36
50
  (0, userReducer_1.updateAllUsers)({ users: response.data.users }),
37
51
  (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
@@ -43,13 +57,14 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
43
57
  (0, fileReducer_1.updateFiles)({ files: response.data.files }),
44
58
  (0, accountReducer_1.updateAccounts)(response.data.accounts, 'reimbursement'),
45
59
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
60
+ (0, depositAccountReducer_1.updateDepositAccounts)((_b = response.data.deposit_accounts) !== null && _b !== void 0 ? _b : []),
46
61
  (0, setupViewReducer_1.updateSetupViewLocalStoreData)({
47
62
  companyId: response.data.companies[0].company_id,
48
63
  }),
49
64
  (0, remiSetupViewReducer_1.updateRemiSetupViewLocalStoreData)({
50
65
  companyId: response.data.companies[0].company_id,
51
66
  }),
52
- (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'),
67
+ (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'reimbursement_setup', depositAccountIds, primaryFundingAccount),
53
68
  (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)(),
54
69
  ];
55
70
  return (0, rxjs_1.from)(actions);
@@ -64,10 +79,10 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
64
79
  }), (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))))));
65
80
  }
66
81
  else {
67
- const { allBankAccountIds, paymentAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
82
+ const { allBankAccountIds, paymentAccountIds, depositAccountIds, primaryFundingAccount, } = plaidAccountViewState['reimbursement_setup'].accountDetails;
68
83
  return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
69
84
  companyId,
70
- }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'), (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)());
85
+ }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'reimbursement_setup', depositAccountIds, primaryFundingAccount), (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)());
71
86
  }
72
87
  }));
73
88
  exports.fetchRemiSetupViewEpic = fetchRemiSetupViewEpic;
@@ -5,7 +5,7 @@ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
5
5
  const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompanyView");
6
6
  const helpers_1 = require("../../helpers");
7
7
  function getRemiSetupViewDetails(state, companyId) {
8
- const remiSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement', 'spend_management_setup');
8
+ const remiSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement', 'reimbursement_setup');
9
9
  const { remiSetupViewState, setupViewState } = state;
10
10
  const { mileageDetails, isRefreshingViewInBackground } = remiSetupViewState;
11
11
  const { remiTermsDetails } = remiSetupViewState;
@@ -57,6 +57,7 @@ const transferDetail = (0, toolkit_1.createSlice)({
57
57
  maskedAccountNumber: action.payload.maskedAccountNumber,
58
58
  accountBalance: action.payload.accountBalance,
59
59
  logo: undefined,
60
+ zeniAccountId: undefined,
60
61
  };
61
62
  draft.localData = Object.assign(Object.assign({}, draft.localData), { transferTo: transferMoneyParty });
62
63
  },
@@ -1,17 +1,14 @@
1
1
  import { FetchState } from '../../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
3
- import { DepositAccount } from '../../../../entity/depositAccount/depositAccount';
4
3
  import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
5
4
  import { RootState } from '../../../../reducer';
6
- import { ReviewTransferDetail, TransferDetailLocalData, TransferMoneyParty } from './transferDetailState';
5
+ import { FundingAccount } from '../../commonSetup/setupViewSelector';
6
+ import { ReviewTransferDetail, TransferDetailLocalData } from './transferDetailState';
7
7
  export interface TransferDetailSelectorView extends SelectorView {
8
8
  transferDetailLocalData: TransferDetailLocalData;
9
- transferMoneyParties: TransferMoneyParty[];
9
+ transferMoneyParties: FundingAccount[];
10
10
  transferMoneyPartiesFetchState: FetchState;
11
11
  reviewTransferDetail: ReviewTransferDetail;
12
12
  primaryPaymentAccount?: PaymentAccount;
13
13
  }
14
14
  export declare const getTransferDetail: (state: RootState) => TransferDetailSelectorView;
15
- export declare const getTransferMoneyParties: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[]) => TransferMoneyParty[];
16
- export declare const mapDepositAccToTransferMoneyParty: (depositAcc: DepositAccount) => TransferMoneyParty;
17
- export declare const mapPaymentAccToTransferMoneyParty: (paymentAcc: PaymentAccount) => TransferMoneyParty;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapPaymentAccToTransferMoneyParty = exports.mapDepositAccToTransferMoneyParty = exports.getTransferMoneyParties = exports.getTransferDetail = void 0;
3
+ exports.getTransferDetail = void 0;
4
4
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
5
- const depositAccountPayload_1 = require("../../../../entity/depositAccount/depositAccountPayload");
5
+ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
6
6
  const depositAccountListSelector_1 = require("../depositAccountList/depositAccountListSelector");
7
7
  const paymentAccountListSelector_1 = require("../paymentAccountList/paymentAccountListSelector");
8
8
  const getTransferDetail = (state) => {
@@ -17,7 +17,7 @@ const getTransferDetail = (state) => {
17
17
  ]).fetchState;
18
18
  if (depositAccountsView.fetchState === 'Completed' &&
19
19
  paymentAccountsView.fetchState === 'Completed') {
20
- transferParties = (0, exports.getTransferMoneyParties)(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts);
20
+ transferParties = (0, setupViewSelector_1.getAllFundingAccounts)(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts);
21
21
  }
22
22
  const primaryPaymentAccount = (0, paymentAccountListSelector_1.getPrimaryPaymentAccount)(paymentAccountState, paymentAccountListState);
23
23
  return {
@@ -32,44 +32,3 @@ const getTransferDetail = (state) => {
32
32
  };
33
33
  };
34
34
  exports.getTransferDetail = getTransferDetail;
35
- /* This helper function takes deposit accounts and payment accounts
36
- and give back TrasferMoneyParty type array
37
- to support single dropdown with both lists */
38
- const getTransferMoneyParties = (depositAccounts, paymentAccounts) => {
39
- return [
40
- ...depositAccounts.map((depositAcc) => (0, exports.mapDepositAccToTransferMoneyParty)(depositAcc)),
41
- ...paymentAccounts
42
- .filter((paymentAccount) => {
43
- var _a, _b, _c;
44
- return ((_a = paymentAccount.providerVerificationStatus) === null || _a === void 0 ? void 0 : _a.code) === 'verified' ||
45
- ((_b = paymentAccount.providerVerificationStatus) === null || _b === void 0 ? void 0 : _b.code) ===
46
- 'manually_verified' ||
47
- ((_c = paymentAccount.providerVerificationStatus) === null || _c === void 0 ? void 0 : _c.code) ===
48
- 'automatically_verified';
49
- })
50
- .map((paymentAcc) => (0, exports.mapPaymentAccToTransferMoneyParty)(paymentAcc)),
51
- ];
52
- };
53
- exports.getTransferMoneyParties = getTransferMoneyParties;
54
- const mapDepositAccToTransferMoneyParty = (depositAcc) => ({
55
- id: depositAcc.id,
56
- accType: 'depositAccount',
57
- label: depositAcc.accountName,
58
- maskedAccountNumber: depositAcc.maskedAccountNumber,
59
- accountBalance: depositAcc.accountBalance,
60
- logo: undefined,
61
- });
62
- exports.mapDepositAccToTransferMoneyParty = mapDepositAccToTransferMoneyParty;
63
- const mapPaymentAccToTransferMoneyParty = (paymentAcc) => {
64
- var _a;
65
- return ({
66
- id: paymentAcc.paymentAccountId,
67
- accType: 'paymentAccount',
68
- maskedAccountNumber: paymentAcc.maskedAccountNumber,
69
- label: Boolean(paymentAcc.institutionDetails.institutionName) === true
70
- ? paymentAcc.institutionDetails.institutionName
71
- : (0, depositAccountPayload_1.getZeniAccountFallbackName)(paymentAcc.maskedAccountNumber, (_a = paymentAcc.accountSubType) === null || _a === void 0 ? void 0 : _a.name),
72
- logo: paymentAcc.institutionDetails.logo,
73
- });
74
- };
75
- exports.mapPaymentAccToTransferMoneyParty = mapPaymentAccToTransferMoneyParty;
@@ -1,9 +1,7 @@
1
1
  import { Amount } from '../../../../commonStateTypes/amount';
2
- import { Balance } from '../../../../commonStateTypes/balance';
3
- import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
4
- import { Logo } from '../../../../entity/paymentAccount/paymentAccountState';
2
+ import { FetchStateAndError } from '../../../../commonStateTypes/common';
5
3
  import { ZeniDate } from '../../../../zeniDayJS';
6
- import { AccountTypeSubConfigCodeKeyType } from '../../billPay/billPayConfig/billPayConfigState';
4
+ import { FundingAccount } from '../../commonSetup/setupViewSelector';
7
5
  export interface TransferDetailState extends FetchStateAndError {
8
6
  localData: TransferDetailLocalData;
9
7
  reviewTransferDetail: ReviewTransferDetail;
@@ -13,16 +11,8 @@ export interface ReviewTransferDetail extends FetchStateAndError {
13
11
  }
14
12
  export interface TransferDetailLocalData {
15
13
  amount: Amount;
16
- transferFrom?: TransferMoneyParty;
17
- transferTo?: TransferMoneyParty;
18
- }
19
- export interface TransferMoneyParty {
20
- id: ID;
21
- accType: AccountTypeSubConfigCodeKeyType;
22
- label: string;
23
- maskedAccountNumber: string;
24
- accountBalance?: Balance;
25
- logo?: Logo;
14
+ transferFrom?: FundingAccount;
15
+ transferTo?: FundingAccount;
26
16
  }
27
17
  export interface ReviewTransferMoney {
28
18
  isShowDailyAchLimitWarning: boolean;
@@ -8,7 +8,7 @@ import { updateCreatedTagToLocalStore } from '../../taskManager/taskDetailView/t
8
8
  export declare type ActionType = ReturnType<typeof createTag> | ReturnType<typeof updateTagCreateStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateCreatedTagToLocalStore> | ReturnType<typeof updateTags>;
9
9
  export declare const createTagEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
10
10
  payload: {
11
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated";
11
+ messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated";
12
12
  messageText: "failed" | "success";
13
13
  type: import("../../..").SnackbarMessageType;
14
14
  showStatusIcon?: boolean | undefined;
@@ -9,7 +9,7 @@ export declare const deleteTagEpic: (actions$: ActionsObservable<ActionType>, _s
9
9
  type: string;
10
10
  } | {
11
11
  payload: {
12
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated";
12
+ messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated";
13
13
  messageText: "failed" | "success";
14
14
  type: import("../../..").SnackbarMessageType;
15
15
  showStatusIcon?: boolean | undefined;
@@ -0,0 +1,9 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../reducer';
4
+ import { fetchVendorTabView } from './vendorTabViewReducer';
5
+ import { fetchScheduleList } from '../scheduleView/scheduleListView/scheduleListReducer';
6
+ import { fetchOpExByVendor } from '../opExByVendor/opExByVendorReducer';
7
+ import { fetchVendorsList } from '../vendorList/vendorListReducer';
8
+ export declare type ActionType = ReturnType<typeof fetchVendorTabView> | ReturnType<typeof fetchOpExByVendor> | ReturnType<typeof fetchVendorsList> | ReturnType<typeof fetchScheduleList>;
9
+ export declare const fetchVendorTabViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchVendorTabViewEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const vendorTabViewReducer_1 = require("./vendorTabViewReducer");
7
+ const scheduleListReducer_1 = require("../scheduleView/scheduleListView/scheduleListReducer");
8
+ const opExByVendorReducer_1 = require("../opExByVendor/opExByVendorReducer");
9
+ const vendorListReducer_1 = require("../vendorList/vendorListReducer");
10
+ const scheduleListSelector_1 = require("../scheduleView/scheduleListView/scheduleListSelector");
11
+ const scheduleListHelper_1 = require("../scheduleView/scheduleListView/scheduleListHelper");
12
+ const opExByVendorSelector_1 = require("../opExByVendor/opExByVendorSelector");
13
+ const vendorListSelector_1 = require("../vendorList/vendorListSelector");
14
+ const fetchVendorTabViewEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(vendorTabViewReducer_1.fetchVendorTabView.match), (0, operators_1.switchMap)((action) => {
15
+ const { shouldFetchFixedAssets, shouldFetchOpexByVendor, shouldFetchPrepaidExpenses, shouldFetchVendorsList, } = action.payload;
16
+ const state = state$.value;
17
+ const fetchActions = [];
18
+ const accountFetchState = (0, scheduleListSelector_1.getFetchStateForScheduleAccountList)(state);
19
+ const fixedAssetsSchedulesListFetchState = (0, scheduleListSelector_1.getFetchStateForScheduleListByType)(state, 'fixed_assets');
20
+ const prepaidExpensesSchedulesListFetchState = (0, scheduleListSelector_1.getFetchStateForScheduleListByType)(state, 'prepaid_expenses');
21
+ const opExByVendorFetchState = (0, opExByVendorSelector_1.getOpExByVendorReport)(state).fetchState;
22
+ const vendorsListFetchState = (0, vendorListSelector_1.getVendorList)(state, 'vendorsTab').fetchState;
23
+ if (shouldFetchFixedAssets === true &&
24
+ accountFetchState === 'Completed' &&
25
+ fixedAssetsSchedulesListFetchState !== 'In-Progress' &&
26
+ fixedAssetsSchedulesListFetchState !== 'Completed') {
27
+ fetchActions.push((0, scheduleListReducer_1.fetchScheduleList)('fixed_assets', {
28
+ selectedTimeframe: (0, scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType)('fixed_assets'),
29
+ selectedCategoryId: 'all',
30
+ }));
31
+ }
32
+ if (shouldFetchPrepaidExpenses === true &&
33
+ accountFetchState === 'Completed' &&
34
+ prepaidExpensesSchedulesListFetchState !== 'In-Progress' &&
35
+ prepaidExpensesSchedulesListFetchState !== 'Completed') {
36
+ fetchActions.push((0, scheduleListReducer_1.fetchScheduleList)('prepaid_expenses', {
37
+ selectedTimeframe: (0, scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType)('prepaid_expenses'),
38
+ selectedCategoryId: 'all',
39
+ }));
40
+ }
41
+ if (shouldFetchOpexByVendor &&
42
+ opExByVendorFetchState !== 'In-Progress' &&
43
+ opExByVendorFetchState !== 'Completed') {
44
+ fetchActions.push((0, opExByVendorReducer_1.fetchOpExByVendor)());
45
+ }
46
+ if (shouldFetchVendorsList &&
47
+ vendorsListFetchState !== 'In-Progress' &&
48
+ vendorsListFetchState !== 'Completed') {
49
+ fetchActions.push((0, vendorListReducer_1.fetchVendorsList)('', false, 'vendorsTab'));
50
+ }
51
+ return (0, rxjs_1.from)(fetchActions);
52
+ }));
53
+ exports.fetchVendorTabViewEpic = fetchVendorTabViewEpic;
@@ -0,0 +1,15 @@
1
+ import { VendorTabViewState } from './vendorTabViewState';
2
+ export declare const initialState: VendorTabViewState;
3
+ export declare const fetchVendorTabView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
4
+ shouldFetchPrepaidExpenses: boolean;
5
+ shouldFetchFixedAssets: boolean;
6
+ shouldFetchVendorsList: boolean;
7
+ shouldFetchOpexByVendor: boolean;
8
+ }], {
9
+ shouldFetchPrepaidExpenses: boolean;
10
+ shouldFetchFixedAssets: boolean;
11
+ shouldFetchVendorsList: boolean;
12
+ shouldFetchOpexByVendor: boolean;
13
+ }, string, never, never>;
14
+ declare const _default: import("@reduxjs/toolkit").Reducer<import("../..").FetchedState, import("@reduxjs/toolkit").AnyAction>;
15
+ export default _default;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchVendorTabView = exports.initialState = void 0;
4
+ const toolkit_1 = require("@reduxjs/toolkit");
5
+ exports.initialState = {
6
+ fetchState: 'Not-Started',
7
+ hasValidState() {
8
+ return this.fetchState == 'Completed';
9
+ },
10
+ };
11
+ const vendorTabView = (0, toolkit_1.createSlice)({
12
+ name: 'vendorTabView',
13
+ initialState: exports.initialState,
14
+ reducers: {
15
+ fetchVendorTabView: {
16
+ prepare({ shouldFetchPrepaidExpenses, shouldFetchFixedAssets, shouldFetchVendorsList, shouldFetchOpexByVendor, }) {
17
+ return {
18
+ payload: {
19
+ shouldFetchPrepaidExpenses,
20
+ shouldFetchFixedAssets,
21
+ shouldFetchVendorsList,
22
+ shouldFetchOpexByVendor,
23
+ },
24
+ };
25
+ },
26
+ reducer(
27
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
+ _draft,
29
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
+ _action) {
31
+ //do nothing
32
+ },
33
+ },
34
+ },
35
+ });
36
+ exports.fetchVendorTabView = vendorTabView.actions.fetchVendorTabView;
37
+ exports.default = vendorTabView.reducer;
@@ -0,0 +1,2 @@
1
+ import { FetchedState } from '../../commonStateTypes/common';
2
+ export declare type VendorTabViewState = FetchedState;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.10.66",
3
+ "version": "4.10.68",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "scripts": {
79
79
  "clean": "rimraf lib",
80
- "test": "jest --config jest.config.json --runInBand --detectOpenHandles",
80
+ "test": "jest --config jest.config.json --detectOpenHandles",
81
81
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
82
82
  "find-dead-code": "ts-prune | grep -v '(used in module)'",
83
83
  "find-unused-exports": "ts-unused-exports ./tsconfig.json",