@zeniai/client-epic-state 4.15.19 → 4.15.21

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.
@@ -12,8 +12,11 @@ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsView
12
12
  const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
13
13
  const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
14
14
  const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.fetchAllExpenseAutomationTabs.match), (0, operators_1.switchMap)((action) => {
15
+ var _a, _b;
15
16
  const { cacheOverride, refreshViewInBackground } = action.payload;
16
17
  const state = state$.value;
18
+ const { monthEndCloseChecksState } = state;
19
+ const { monthEndCloseChecksByTenantId } = monthEndCloseChecksState;
17
20
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
18
21
  const companyId = currentTenant.companyId;
19
22
  const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
@@ -22,23 +25,24 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
22
25
  const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
23
26
  const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
24
27
  const monthYearPeriodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
28
+ const monthEndCheckState = (_a = monthEndCloseChecksByTenantId === null || monthEndCloseChecksByTenantId === void 0 ? void 0 : monthEndCloseChecksByTenantId[currentTenant.tenantId]) === null || _a === void 0 ? void 0 : _a[monthYearPeriodId];
29
+ const reconciliationEnabled = (_b = monthEndCheckState === null || monthEndCheckState === void 0 ? void 0 : monthEndCheckState.monthEndCloseCheckList.find((list) => list.id === 'reconciliation')) !== null && _b !== void 0 ? _b : false;
25
30
  if (timePeriodStart == null ||
26
31
  timePeriodEnd == null ||
27
32
  companyId == null) {
28
33
  throw Error(`Invalid start - ${timePeriodStart} and end - ${timePeriodEnd} period from given ${selectedPeriod}`);
29
34
  }
30
35
  if (cacheOverride === true) {
31
- return (0, rxjs_1.from)([
32
- (0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground),
33
- (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
34
- amount: 75.0,
35
- currencyCode: 'USD',
36
- currencySymbol: '$',
37
- }, cacheOverride, refreshViewInBackground),
38
- (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null),
39
- (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride),
40
- (0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground),
41
- ]);
36
+ const actions = [];
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 }, {
38
+ amount: 75.0,
39
+ currencyCode: 'USD',
40
+ currencySymbol: '$',
41
+ }, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
42
+ if (reconciliationEnabled) {
43
+ actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
44
+ }
45
+ return (0, rxjs_1.from)(actions);
42
46
  }
43
47
  else {
44
48
  const fetchActions = [];
@@ -74,7 +78,8 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
74
78
  'In-Progress' &&
75
79
  state.expenseAutomationReconciliationViewState
76
80
  .accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId] ==
77
- null) {
81
+ null &&
82
+ reconciliationEnabled) {
78
83
  fetchActions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
79
84
  }
80
85
  if (state.expenseAutomationTransactionsViewState
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.15.19",
3
+ "version": "4.15.21",
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",