@zeniai/client-epic-state 4.15.19 → 4.15.20

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