@zeniai/client-epic-state 4.10.67 → 4.10.69

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 (89) 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/reimbursement/reimbursementPayload.d.ts +4 -3
  11. package/lib/entity/reimbursement/reimbursementPayload.js +36 -2
  12. package/lib/entity/reimbursement/reimbursementState.d.ts +4 -4
  13. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  14. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  15. package/lib/epic.d.ts +4 -1
  16. package/lib/epic.js +4 -1
  17. package/lib/index.d.ts +16 -15
  18. package/lib/index.js +15 -10
  19. package/lib/reducer.d.ts +3 -0
  20. package/lib/reducer.js +3 -0
  21. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +1 -0
  22. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +2 -1
  23. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +14 -1
  24. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.d.ts +8 -2
  25. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.js +41 -3
  26. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +7 -0
  27. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +2 -1
  28. package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +1 -0
  29. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  30. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  31. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  32. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  33. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  34. package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.d.ts +2 -1
  35. package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.js +9 -1
  36. package/lib/view/reviewCompanyView/reviewCompanyViewReducer.d.ts +2 -1
  37. package/lib/view/reviewCompanyView/reviewCompanyViewReducer.js +2 -2
  38. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  39. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +2 -2
  40. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +2 -2
  41. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -2
  42. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -5
  43. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -4
  44. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +2 -2
  45. package/lib/view/spendManagement/commonSetup/setupViewPayload.d.ts +2 -0
  46. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +28 -3
  47. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +79 -5
  48. package/lib/view/spendManagement/helpers.d.ts +1 -0
  49. package/lib/view/spendManagement/helpers.js +5 -1
  50. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.d.ts +9 -0
  51. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +31 -0
  52. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.d.ts +8 -0
  53. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +39 -0
  54. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +23 -2
  55. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +96 -8
  56. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.d.ts +1 -1
  57. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.js +3 -3
  58. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +7 -1
  59. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +1 -0
  60. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewPayload.d.ts +5 -1
  61. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewPayload.js +50 -0
  62. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.js +19 -16
  63. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.d.ts +5 -2
  64. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +2 -2
  65. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewState.d.ts +30 -7
  66. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchCurrencyConversionValueEpic.js +1 -1
  67. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRecommendationsAndUpdateMerchantRecommendationsEpic.js +2 -2
  68. package/lib/view/spendManagement/reimbursement/editRemiView/epics/initializeRemiToLocalStoreEpic.d.ts +1 -1
  69. package/lib/view/spendManagement/reimbursement/editRemiView/epics/initializeRemiToLocalStoreEpic.js +51 -7
  70. package/lib/view/spendManagement/reimbursement/editRemiView/epics/parseReceiptsToRemiEpic.js +31 -20
  71. package/lib/view/spendManagement/reimbursement/editRemiView/epics/saveRemiDetailEpic.d.ts +3 -3
  72. package/lib/view/spendManagement/reimbursement/editRemiView/epics/saveRemiDetailEpic.js +4 -4
  73. package/lib/view/spendManagement/reimbursement/remiDetailView/epics/fetchDuplicateReimbursementEpic.js +11 -4
  74. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.d.ts +2 -1
  75. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +18 -3
  76. package/lib/view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector.js +1 -1
  77. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +1 -0
  78. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.d.ts +3 -6
  79. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +3 -44
  80. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailState.d.ts +4 -14
  81. package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
  82. package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
  83. package/lib/view/vendorTabView/fetchVendorTabViewEpic.d.ts +9 -0
  84. package/lib/view/vendorTabView/fetchVendorTabViewEpic.js +53 -0
  85. package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +15 -0
  86. package/lib/view/vendorTabView/vendorTabViewReducer.js +37 -0
  87. package/lib/view/vendorTabView/vendorTabViewState.d.ts +2 -0
  88. package/lib/view/vendorTabView/vendorTabViewState.js +2 -0
  89. package/package.json +2 -2
@@ -6,11 +6,11 @@ const operators_1 = require("rxjs/operators");
6
6
  const editRemiViewReducer_1 = require("../editRemiViewReducer");
7
7
  const zeniDayJS_1 = require("../../../../../zeniDayJS");
8
8
  const accountSelector_1 = require("../../../../../entity/account/accountSelector");
9
- const merchantSelector_1 = require("../../../../../entity/merchant/merchantSelector");
10
- const merchantPayload_1 = require("../../../../../entity/merchant/merchantPayload");
11
9
  const attachmentPayload_1 = require("../../../../../entity/transaction/payloadTypes/attachmentPayload");
12
10
  const classSelector_1 = require("../../../../../entity/class/classSelector");
13
11
  const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
12
+ const merchantSelector_1 = require("../../../../../entity/merchant/merchantSelector");
13
+ const merchantPayload_1 = require("../../../../../entity/merchant/merchantPayload");
14
14
  const parseReceiptsToRemiEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.parseReceiptsToRemi.match), (0, operators_1.mergeMap)((action) => {
15
15
  var _a;
16
16
  const { receiptsProcessingPayload, lineId, reimbursementId, shouldOverwrite, } = action.payload;
@@ -51,6 +51,7 @@ const parseReceiptsToRemiEpic = (actions$, state$) => actions$.pipe((0, operator
51
51
  let currentLineId = lineId;
52
52
  const merchants = (0, merchantSelector_1.getMerchantsByMerchantIds)(state.merchantState, state.merchantListState.merchantIds);
53
53
  receiptsProcessingPayload.receipts.forEach((receipt) => {
54
+ var _a, _b, _c;
54
55
  const parsedMerchantId = receipt.merchant_id;
55
56
  const parsedMerchant = merchantsById[parsedMerchantId];
56
57
  const parsedMerchantName = parsedMerchant === null || parsedMerchant === void 0 ? void 0 : parsedMerchant.name;
@@ -58,7 +59,18 @@ const parseReceiptsToRemiEpic = (actions$, state$) => actions$.pipe((0, operator
58
59
  if (parsedMerchantName != null && parsedMerchantName.length > 0) {
59
60
  finalMerchant = merchants.filter((merchant) => merchant.name.toLowerCase() === parsedMerchantName.toLowerCase())[0];
60
61
  }
61
- newUpdatesByLineId[currentLineId] = Object.assign(Object.assign({}, toUpdateLine(state.accountState, state.classState, receipt, currentLineId, finalMerchant, loggedInUserDepartmentId)), { recommendations: [], isCategoryUpdateSelected: false, isCategoryFirstTimeAutofilled: false, isRetainedCategorySelected: false });
62
+ newUpdatesByLineId[currentLineId] = {
63
+ lineId: String(currentLineId),
64
+ type: 'out_of_pocket',
65
+ fileId: (_a = receipt.file_id) !== null && _a !== void 0 ? _a : '',
66
+ homeCurrencyConversions: {
67
+ amount: receipt.amount,
68
+ currencyCode: (_b = receipt.currency_code) !== null && _b !== void 0 ? _b : 'USD',
69
+ currencySymbol: (_c = receipt.currency_symbol) !== null && _c !== void 0 ? _c : '$',
70
+ },
71
+ outOfPocket: Object.assign({}, toUpdateLine(state.accountState, state.classState, receipt, finalMerchant, loggedInUserDepartmentId)),
72
+ mileage: {},
73
+ };
62
74
  if (receipt.currency_code !== 'USD') {
63
75
  currencyConversionActions.push((0, editRemiViewReducer_1.fetchCurrencyConversionValue)('USD', currentLineId.toString(), reimbursementId));
64
76
  }
@@ -93,8 +105,8 @@ const parseReceiptsToRemiEpic = (actions$, state$) => actions$.pipe((0, operator
93
105
  }
94
106
  }));
95
107
  exports.parseReceiptsToRemiEpic = parseReceiptsToRemiEpic;
96
- const toUpdateLine = (accountState, classState, receiptPayload, lineId, finalMerchant, classId) => {
97
- var _a, _b, _c, _d, _e, _f;
108
+ const toUpdateLine = (accountState, classState, receiptPayload, finalMerchant, classId) => {
109
+ var _a, _b, _c;
98
110
  return {
99
111
  merchant: finalMerchant != null
100
112
  ? {
@@ -102,15 +114,9 @@ const toUpdateLine = (accountState, classState, receiptPayload, lineId, finalMer
102
114
  name: finalMerchant.name,
103
115
  }
104
116
  : undefined,
105
- fileId: (_a = receiptPayload.file_id) !== null && _a !== void 0 ? _a : '',
106
- homeCurrencyConversions: {
107
- amount: receiptPayload.amount,
108
- currencyCode: (_b = receiptPayload.currency_code) !== null && _b !== void 0 ? _b : 'USD',
109
- currencySymbol: (_c = receiptPayload.currency_symbol) !== null && _c !== void 0 ? _c : '$',
110
- },
111
117
  description: receiptPayload.transaction_memo,
112
118
  lineDetail: {
113
- account: (0, accountSelector_1.getAccountBase)(accountState, (_d = finalMerchant === null || finalMerchant === void 0 ? void 0 : finalMerchant.accountId) !== null && _d !== void 0 ? _d : '', 'account_list'),
119
+ account: (0, accountSelector_1.getAccountBase)(accountState, (_a = finalMerchant === null || finalMerchant === void 0 ? void 0 : finalMerchant.accountId) !== null && _a !== void 0 ? _a : '', 'account_list'),
114
120
  class: classId != null
115
121
  ? (0, classSelector_1.getClassById)(classState, {
116
122
  classId,
@@ -118,24 +124,29 @@ const toUpdateLine = (accountState, classState, receiptPayload, lineId, finalMer
118
124
  })
119
125
  : undefined,
120
126
  },
121
- lineId: String(lineId),
122
- type: 'out_of_pocket',
123
127
  transactionDate: (0, zeniDayJS_1.date)(receiptPayload.transaction_date),
124
128
  amount: receiptPayload.amount,
125
- currencyCode: (_e = receiptPayload.currency_code) !== null && _e !== void 0 ? _e : 'USD',
126
- currencySymbol: (_f = receiptPayload.currency_symbol) !== null && _f !== void 0 ? _f : '$',
129
+ currencyCode: (_b = receiptPayload.currency_code) !== null && _b !== void 0 ? _b : 'USD',
130
+ currencySymbol: (_c = receiptPayload.currency_symbol) !== null && _c !== void 0 ? _c : '$',
131
+ recommendations: [],
132
+ isCategoryUpdateSelected: false,
133
+ isCategoryFirstTimeAutofilled: false,
134
+ isRetainedCategorySelected: false,
127
135
  };
128
136
  };
129
137
  const getAutoFieldData = (reimbursementLine) => {
130
138
  const fields = [];
131
- Object.keys(reimbursementLine).forEach((item) => {
139
+ const lineData = reimbursementLine.type === 'mileage'
140
+ ? reimbursementLine.mileage
141
+ : reimbursementLine.outOfPocket;
142
+ Object.keys(lineData).forEach((item) => {
132
143
  var _a, _b;
133
144
  switch (item) {
134
145
  case 'merchant':
135
146
  fields.push('merchant');
136
147
  break;
137
148
  case 'amount':
138
- if (reimbursementLine.amount !== 0) {
149
+ if (lineData.amount !== 0) {
139
150
  fields.push('amount');
140
151
  }
141
152
  break;
@@ -143,12 +154,12 @@ const getAutoFieldData = (reimbursementLine) => {
143
154
  fields.push('transactionDate');
144
155
  break;
145
156
  case 'description':
146
- if (reimbursementLine.description !== '') {
157
+ if (lineData.description !== '') {
147
158
  fields.push('memo');
148
159
  }
149
160
  break;
150
161
  case 'lineDetail':
151
- if (((_b = (_a = reimbursementLine.lineDetail) === null || _a === void 0 ? void 0 : _a.account) === null || _b === void 0 ? void 0 : _b.accountId) != null) {
162
+ if (((_b = (_a = lineData.lineDetail) === null || _a === void 0 ? void 0 : _a.account) === null || _b === void 0 ? void 0 : _b.accountId) != null) {
152
163
  fields.push('account');
153
164
  }
154
165
  break;
@@ -1,15 +1,15 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { ZeniAPI } from '../../../../../zeniAPI';
3
3
  import { RootState } from '../../../../../reducer';
4
- import { saveRemiDetail, saveRemiSuccessOrFailure } from '../editRemiViewReducer';
4
+ import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
5
  import { updateReimbursement } from '../../../../../entity/reimbursement/reimbursementReducer';
6
6
  import { updateAllUsers } from '../../../../../entity/user/userReducer';
7
7
  import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
8
8
  import { updateEntityApprovalStatus } from '../../../../../entity/entityApprovalStatus/entityApprovalStatusReducer';
9
- import { clearDuplicateReimbursementDetail, updateRemiDetail } from '../../remiDetailView/remiDetailViewReducer';
10
9
  import { updateMerchants } from '../../../../../entity/merchant/merchantReducer';
11
10
  import { updateMerchantListIds } from '../../../merchantList/merchantListReducer';
12
- import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
13
11
  import { updateRecommendationForEntity } from '../../../../recommendation/recommendationReducer';
12
+ import { clearDuplicateReimbursementDetail, updateRemiDetail } from '../../remiDetailView/remiDetailViewReducer';
13
+ import { saveRemiDetail, saveRemiSuccessOrFailure } from '../editRemiViewReducer';
14
14
  export declare type ActionType = ReturnType<typeof saveRemiDetail> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof updateMerchants> | ReturnType<typeof updateRemiDetail> | ReturnType<typeof updateReimbursement> | ReturnType<typeof updateMerchantListIds> | ReturnType<typeof updateRecommendationForEntity> | ReturnType<typeof clearDuplicateReimbursementDetail> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveRemiSuccessOrFailure>;
15
15
  export declare const saveRemiDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
@@ -7,20 +7,20 @@ exports.saveRemiDetailEpic = void 0;
7
7
  const rxjs_1 = require("rxjs");
8
8
  const operators_1 = require("rxjs/operators");
9
9
  const get_1 = __importDefault(require("lodash/get"));
10
+ const zeniDayJS_1 = require("../../../../../zeniDayJS");
10
11
  const responsePayload_1 = require("../../../../../responsePayload");
11
- const editRemiViewReducer_1 = require("../editRemiViewReducer");
12
+ const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
12
13
  const reimbursementPayload_1 = require("../../../../../entity/reimbursement/reimbursementPayload");
13
14
  const reimbursementReducer_1 = require("../../../../../entity/reimbursement/reimbursementReducer");
14
15
  const userReducer_1 = require("../../../../../entity/user/userReducer");
15
16
  const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
16
17
  const entityApprovalStatusReducer_1 = require("../../../../../entity/entityApprovalStatus/entityApprovalStatusReducer");
17
- const remiDetailViewReducer_1 = require("../../remiDetailView/remiDetailViewReducer");
18
18
  const merchantReducer_1 = require("../../../../../entity/merchant/merchantReducer");
19
19
  const merchantListReducer_1 = require("../../../merchantList/merchantListReducer");
20
- const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
21
- const zeniDayJS_1 = require("../../../../../zeniDayJS");
22
20
  const recommendationHelper_1 = require("../../../../recommendation/recommendationHelper");
23
21
  const recommendationReducer_1 = require("../../../../recommendation/recommendationReducer");
22
+ const remiDetailViewReducer_1 = require("../../remiDetailView/remiDetailViewReducer");
23
+ const editRemiViewReducer_1 = require("../editRemiViewReducer");
24
24
  const saveRemiDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.saveRemiDetail.match), (0, operators_1.mergeMap)((action) => {
25
25
  const state = state$.value;
26
26
  const { remiStageCode, reimbursementId, isSubmitted } = action.payload;
@@ -6,8 +6,9 @@ const operators_1 = require("rxjs/operators");
6
6
  const remiDetailViewReducer_1 = require("../remiDetailViewReducer");
7
7
  const responsePayload_1 = require("../../../../../responsePayload");
8
8
  const reimbursementPayload_1 = require("../../../../../entity/reimbursement/reimbursementPayload");
9
+ const editRemiViewPayload_1 = require("../../editRemiView/editRemiViewPayload");
9
10
  const fetchDuplicateReimbursementEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiDetailViewReducer_1.fetchDuplicateReimbursement.match), (0, operators_1.switchMap)((action) => {
10
- var _a, _b, _c, _d;
11
+ var _a, _b, _c;
11
12
  const { reimbursementId, signedInUserId, isManuallyTriggered } = action.payload;
12
13
  const { editRemiDetailViewState, reimbursementState } = state$.value;
13
14
  let lines = [];
@@ -30,9 +31,15 @@ const fetchDuplicateReimbursementEpic = (actions$, state$, zeniAPI) => actions$.
30
31
  //reimbursement detail page case
31
32
  else if (reimbursementId != null) {
32
33
  //get from reimbursememntState
33
- lines =
34
- (_c = (_b = reimbursementState.reimbursementById[reimbursementId]) === null || _b === void 0 ? void 0 : _b.lines) !== null && _c !== void 0 ? _c : [];
35
- createdByUserId = (_d = reimbursementState.reimbursementById[reimbursementId]) === null || _d === void 0 ? void 0 : _d.createdBy;
34
+ const currentLines = (_c = (_b = reimbursementState.reimbursementById[reimbursementId]) === null || _b === void 0 ? void 0 : _b.lines) !== null && _c !== void 0 ? _c : [];
35
+ lines = currentLines.map((line) => {
36
+ if (line.type === 'mileage') {
37
+ return (0, editRemiViewPayload_1.toReimbursementLineWithRecommendationFromMileage)(line);
38
+ }
39
+ else {
40
+ return (0, editRemiViewPayload_1.toReimbursementLineWithRecommendationFromOutOfPocket)(line);
41
+ }
42
+ });
36
43
  }
37
44
  const payload = {
38
45
  reimbursement_provider: 'zeni',
@@ -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.67",
3
+ "version": "4.10.69",
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",