@zeniai/client-epic-state 4.17.29 → 4.17.30

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.
@@ -32,12 +32,9 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
32
32
  companyId == null) {
33
33
  throw Error(`Invalid start - ${timePeriodStart} and end - ${timePeriodEnd} period from given ${selectedPeriod}`);
34
34
  }
35
- const remainingTransactionCategorizationTab = selectedTransactionCategorizationTab === 'review'
36
- ? 'autoCategorized'
37
- : 'review';
38
35
  if (cacheOverride === true) {
39
36
  const actions = [];
40
- actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground), (0, transactionsViewReducer_1.fetchTransactionCategorizationView)(remainingTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, true), (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
37
+ actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground), (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
41
38
  amount: 75.0,
42
39
  currencyCode: 'USD',
43
40
  currencySymbol: '$',
@@ -84,26 +81,14 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
84
81
  reconciliationEnabled) {
85
82
  fetchActions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
86
83
  }
87
- const selectedTabTransactionCategorizationViewState = state.expenseAutomationTransactionsViewState
88
- .transactionCategorizationView[selectedTransactionCategorizationTab];
89
- const remainingTabTransactionCategorizationViewState = state.expenseAutomationTransactionsViewState
90
- .transactionCategorizationView[remainingTransactionCategorizationTab];
91
- if (selectedTabTransactionCategorizationViewState.fetchState !==
92
- 'In-Progress' &&
93
- (selectedTabTransactionCategorizationViewState.hasValidState() ===
94
- false ||
95
- selectedTabTransactionCategorizationViewState
96
- .transactionIdsBySelectedPeriod[monthYearPeriodId] == null)) {
84
+ if (state.expenseAutomationTransactionsViewState
85
+ .transactionCategorizationView[selectedTransactionCategorizationTab]
86
+ .fetchState !== 'In-Progress' &&
87
+ (state.expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab].hasValidState() === false ||
88
+ state.expenseAutomationTransactionsViewState
89
+ .transactionCategorizationView[selectedTransactionCategorizationTab].transactionIdsBySelectedPeriod[monthYearPeriodId] == null)) {
97
90
  fetchActions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground));
98
91
  }
99
- if (remainingTabTransactionCategorizationViewState.fetchState !==
100
- 'In-Progress' &&
101
- (remainingTabTransactionCategorizationViewState.hasValidState() ===
102
- false ||
103
- remainingTabTransactionCategorizationViewState
104
- .transactionIdsBySelectedPeriod[monthYearPeriodId] == null)) {
105
- fetchActions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(remainingTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, true));
106
- }
107
92
  return (0, rxjs_1.from)(fetchActions);
108
93
  }
109
94
  }));
@@ -10,16 +10,9 @@ const responsePayload_1 = require("../../../../responsePayload");
10
10
  const transactionCategorizationLocalDataHelper_1 = require("../../helpers/transactionCategorizationLocalDataHelper");
11
11
  const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
12
12
  const transactionsViewState_1 = require("../../types/transactionsViewState");
13
- const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchTransactionCategorization.match),
14
- // Group requests by selectedTab to handle them differently
15
- (0, operators_1.groupBy)((action) => action.payload.selectedTab), (0, operators_1.mergeMap)((tabGroup$) => tabGroup$.pipe((0, operators_1.switchMap)((action) => {
16
- // Processing new request for tab "selectedTab" - will ignore any previous request for this tab
17
- return processTransactionCategorizationRequest(action, state$, zeniAPI);
18
- }))));
19
- exports.fetchTransactionCategorizationEpic = fetchTransactionCategorizationEpic;
20
- const processTransactionCategorizationRequest = (action, state$, zeniAPI) => {
13
+ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchTransactionCategorization.match), (0, operators_1.switchMap)((action) => {
21
14
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationTransactionsViewState, } = state$.value;
22
- const { period, keepExistingListItems, selectedTab, refreshViewInBackground } = action.payload;
15
+ const { period, keepExistingListItems, selectedTab, refreshViewInBackground, } = action.payload;
23
16
  const uiState = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab].uiState;
24
17
  const { pageToken, sortOrder, sortKey } = uiState;
25
18
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
@@ -77,4 +70,5 @@ const processTransactionCategorizationRequest = (action, state$, zeniAPI) => {
77
70
  status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch Transaction Categorization REST API call errored out' +
78
71
  JSON.stringify(error)),
79
72
  }))));
80
- };
73
+ }));
74
+ exports.fetchTransactionCategorizationEpic = fetchTransactionCategorizationEpic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.17.29",
3
+ "version": "4.17.30",
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",