@zeniai/client-epic-state 4.19.96-betaSS1 → 4.19.96-betaSS2

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.
@@ -1,3 +1,4 @@
1
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
1
2
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
2
3
  import { getAccountBase } from '../../../entity/account/accountSelector';
3
4
  import { getClassById } from '../../../entity/class/classSelector';
@@ -6,7 +7,7 @@ import { getUserByUserId } from '../../../entity/user/userSelector';
6
7
  import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
7
8
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
8
9
  export function getExpenseAutomationFluxAnalysisView(state) {
9
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
10
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
10
11
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
11
12
  const fetchStateAndError = {
12
13
  fetchState,
@@ -91,10 +92,17 @@ export function getExpenseAutomationFluxAnalysisView(state) {
91
92
  },
92
93
  };
93
94
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
95
+ const monthEndFetchState = monthYearPeriodId != null
96
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
97
+ : { fetchState: 'Not-Started', error: undefined };
98
+ const reducedFetchStatus = reduceAnyFetchState([
99
+ fetchStateAndError,
100
+ monthEndFetchState,
101
+ ]);
94
102
  return {
95
103
  sections,
96
104
  totalBalancesAndVariance,
97
- fetchStatus: fetchStateAndError,
105
+ fetchStatus: reducedFetchStatus,
98
106
  bulkReviewStatus,
99
107
  reviewOperatingExpensesIds,
100
108
  selectedSectionIds,
@@ -1,5 +1,6 @@
1
1
  import omit from 'lodash/omit';
2
2
  import orderBy from 'lodash/orderBy';
3
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
3
4
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
5
  import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
5
6
  import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
@@ -50,7 +51,7 @@ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
50
51
  export function getExpenseAutomationJESchedulesView(state) {
51
52
  const jeScheduledTransaction = [];
52
53
  const failedJeScheduledTransaction = [];
53
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
54
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
54
55
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
55
56
  const accountSettingsView = getJEAccountSettingsView(state);
56
57
  const currentTenant = getCurrentTenant(state);
@@ -116,6 +117,13 @@ export function getExpenseAutomationJESchedulesView(state) {
116
117
  : [];
117
118
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
118
119
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
120
+ const monthEndFetchState = monthYearPeriodId != null
121
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
122
+ : { fetchState: 'Not-Started', error: undefined };
123
+ const reducedFetchStatus = reduceAnyFetchState([
124
+ { fetchState, error },
125
+ monthEndFetchState,
126
+ ]);
119
127
  return {
120
128
  uncategorizedAccounts,
121
129
  allDepreciationAccountList: filteredDepAccounts,
@@ -131,10 +139,10 @@ export function getExpenseAutomationJESchedulesView(state) {
131
139
  accountSettingsView,
132
140
  postStatusById: postStatusById,
133
141
  ignoreStatusById: ignoreStatusById,
134
- fetchState: fetchState,
142
+ fetchState: reducedFetchStatus.fetchState,
135
143
  jeScheduleLocalDataById: jeScheduleLocalDataById,
136
144
  uiState: uiState,
137
- error: error,
145
+ error: reducedFetchStatus.error,
138
146
  refreshStatus,
139
147
  completionStatus,
140
148
  };
@@ -1,4 +1,5 @@
1
1
  import orderBy from 'lodash/orderBy';
2
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
2
3
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
3
4
  import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
4
5
  import { getSupportedTransactionById, getSupportedTransactionsByIds, } from '../../../entity/transaction/transactionSelector';
@@ -7,7 +8,7 @@ import { getCompletedTransactionsCacheKey } from '../reducers/missingReceiptsVie
7
8
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
8
9
  import { isUnmatchedTabFileStatus, } from '../types/missingReceiptsViewState';
9
10
  export function getExpenseAutomationMissingReceiptsView(state) {
10
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
11
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
11
12
  const currentTenant = getCurrentTenant(state);
12
13
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
13
14
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -175,9 +176,16 @@ export function getExpenseAutomationMissingReceiptsView(state) {
175
176
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
176
177
  };
177
178
  });
179
+ const monthEndFetchState = monthYearPeriodId != null
180
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
181
+ : { fetchState: 'Not-Started', error: undefined };
182
+ const reducedFetchStatus = reduceAnyFetchState([
183
+ { fetchState, error },
184
+ monthEndFetchState,
185
+ ]);
178
186
  return {
179
- fetchState,
180
- error,
187
+ fetchState: reducedFetchStatus.fetchState,
188
+ error: reducedFetchStatus.error,
181
189
  uploadReceiptStatusById,
182
190
  uiState,
183
191
  refreshStatus,
@@ -13,7 +13,7 @@ import { getAccountList, getNestedAccountListHierarchy, } from '../../accountLis
13
13
  import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
14
14
  import { initialActionFetchState, initialReconciliationTabsState, initialState, } from '../reducers/reconciliationViewReducer';
15
15
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
16
- export const getExpenseAutomationReconciliationView = createSelector((state) => state, (state) => getCurrentTenant(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
16
+ export const getExpenseAutomationReconciliationView = createSelector((state) => state, (state) => getCurrentTenant(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state) => state.monthEndCloseChecksViewState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState, monthEndCloseChecksViewState) => {
17
17
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
18
18
  const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
19
19
  const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
@@ -35,6 +35,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
35
35
  }
36
36
  return acc;
37
37
  }, []);
38
+ const monthYearPeriodId = selectedPeriod != null ? toMonthYearPeriodId(selectedPeriod) : null;
39
+ const monthEndFetchState = monthYearPeriodId != null
40
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
41
+ fetchState: 'Not-Started',
42
+ error: undefined,
43
+ })
44
+ : { fetchState: 'Not-Started', error: undefined };
38
45
  if (accountReconForMonthYearPeriod == null) {
39
46
  return {
40
47
  bankAccounts: [],
@@ -44,10 +51,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
44
51
  classListNestedAccountHierarchy: [],
45
52
  allAccountList: [],
46
53
  allClassList: [],
47
- fetchStatus: {
48
- fetchState: reconciliationViewState.fetchState,
49
- error: reconciliationViewState.error,
50
- },
54
+ fetchStatus: reduceAnyFetchState([
55
+ {
56
+ fetchState: reconciliationViewState.fetchState,
57
+ error: reconciliationViewState.error,
58
+ },
59
+ monthEndFetchState,
60
+ ]),
51
61
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
52
62
  .plaidConnectionDetails,
53
63
  completionStatus: 'incomplete',
@@ -270,10 +280,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
270
280
  bankAccounts: uniqueBankAccounts,
271
281
  creditCards: uniqueCreditCards,
272
282
  accountReconciliationsByAccountID: reconList,
273
- fetchStatus: {
274
- fetchState: reconciliationViewState.fetchState,
275
- error: reconciliationViewState.error,
276
- },
283
+ fetchStatus: reduceAnyFetchState([
284
+ {
285
+ fetchState: reconciliationViewState.fetchState,
286
+ error: reconciliationViewState.error,
287
+ },
288
+ monthEndFetchState,
289
+ ]),
277
290
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
278
291
  .plaidConnectionDetails,
279
292
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -1,5 +1,5 @@
1
1
  import omit from 'lodash/omit';
2
- import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
2
+ import { reduceAllFetchState, reduceAnyFetchState, } from '../../../commonStateTypes/reduceFetchState';
3
3
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
4
  import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
5
5
  import { getTransactionWithCOT } from '../../../entity/transaction/transactionHelper';
@@ -8,7 +8,7 @@ import { getAccountList, getNestedAccountListHierarchy, getUncategorizedAccounts
8
8
  import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
9
9
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
10
10
  export function getExpenseAutomationTransactionView(state) {
11
- const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
11
+ const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
12
12
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
13
13
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
14
14
  const uncategorizedIncomeExpense = getUncategorizedAccounts(accountState, accountListState, 'accountList');
@@ -41,10 +41,16 @@ export function getExpenseAutomationTransactionView(state) {
41
41
  .filter((transaction) => transaction != null);
42
42
  const transactions = getSupportedTransactionsByIds(transactionState, transactionIds);
43
43
  const transactionsWithCOT = transactions.map((transaction) => getTransactionWithCOT(transaction));
44
- const fetchStatus = reduceAllFetchState([
45
- accountList,
46
- classList,
47
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
44
+ const monthEndFetchState = monthYearPeriodId != null
45
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
46
+ : { fetchState: 'Not-Started', error: undefined };
47
+ const fetchStatus = reduceAnyFetchState([
48
+ reduceAllFetchState([
49
+ accountList,
50
+ classList,
51
+ expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
52
+ ]),
53
+ monthEndFetchState,
48
54
  ]);
49
55
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
50
56
  .uiState.totalCount;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpenseAutomationFluxAnalysisView = getExpenseAutomationFluxAnalysisView;
4
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
4
5
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
6
  const accountSelector_1 = require("../../../entity/account/accountSelector");
6
7
  const classSelector_1 = require("../../../entity/class/classSelector");
@@ -9,7 +10,7 @@ const userSelector_1 = require("../../../entity/user/userSelector");
9
10
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
10
11
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
11
12
  function getExpenseAutomationFluxAnalysisView(state) {
12
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
13
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
13
14
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
14
15
  const fetchStateAndError = {
15
16
  fetchState,
@@ -94,10 +95,17 @@ function getExpenseAutomationFluxAnalysisView(state) {
94
95
  },
95
96
  };
96
97
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
98
+ const monthEndFetchState = monthYearPeriodId != null
99
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
100
+ : { fetchState: 'Not-Started', error: undefined };
101
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
102
+ fetchStateAndError,
103
+ monthEndFetchState,
104
+ ]);
97
105
  return {
98
106
  sections,
99
107
  totalBalancesAndVariance,
100
- fetchStatus: fetchStateAndError,
108
+ fetchStatus: reducedFetchStatus,
101
109
  bulkReviewStatus,
102
110
  reviewOperatingExpensesIds,
103
111
  selectedSectionIds,
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
7
7
  const omit_1 = __importDefault(require("lodash/omit"));
8
8
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
9
10
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
10
11
  const accountSelector_1 = require("../../../entity/account/accountSelector");
11
12
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
@@ -56,7 +57,7 @@ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
56
57
  function getExpenseAutomationJESchedulesView(state) {
57
58
  const jeScheduledTransaction = [];
58
59
  const failedJeScheduledTransaction = [];
59
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
60
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
60
61
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
61
62
  const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
62
63
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
@@ -122,6 +123,13 @@ function getExpenseAutomationJESchedulesView(state) {
122
123
  : [];
123
124
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
124
125
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
126
+ const monthEndFetchState = monthYearPeriodId != null
127
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
128
+ : { fetchState: 'Not-Started', error: undefined };
129
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
130
+ { fetchState, error },
131
+ monthEndFetchState,
132
+ ]);
125
133
  return {
126
134
  uncategorizedAccounts,
127
135
  allDepreciationAccountList: filteredDepAccounts,
@@ -137,10 +145,10 @@ function getExpenseAutomationJESchedulesView(state) {
137
145
  accountSettingsView,
138
146
  postStatusById: postStatusById,
139
147
  ignoreStatusById: ignoreStatusById,
140
- fetchState: fetchState,
148
+ fetchState: reducedFetchStatus.fetchState,
141
149
  jeScheduleLocalDataById: jeScheduleLocalDataById,
142
150
  uiState: uiState,
143
- error: error,
151
+ error: reducedFetchStatus.error,
144
152
  refreshStatus,
145
153
  completionStatus,
146
154
  };
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationMissingReceiptsView = getExpenseAutomationMissingReceiptsView;
7
7
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
9
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
10
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
10
11
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
@@ -13,7 +14,7 @@ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewRed
13
14
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
14
15
  const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
15
16
  function getExpenseAutomationMissingReceiptsView(state) {
16
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
17
18
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
18
19
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
19
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -181,9 +182,16 @@ function getExpenseAutomationMissingReceiptsView(state) {
181
182
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
182
183
  };
183
184
  });
185
+ const monthEndFetchState = monthYearPeriodId != null
186
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
187
+ : { fetchState: 'Not-Started', error: undefined };
188
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
189
+ { fetchState, error },
190
+ monthEndFetchState,
191
+ ]);
184
192
  return {
185
- fetchState,
186
- error,
193
+ fetchState: reducedFetchStatus.fetchState,
194
+ error: reducedFetchStatus.error,
187
195
  uploadReceiptStatusById,
188
196
  uiState,
189
197
  refreshStatus,
@@ -19,7 +19,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
19
19
  const classListSelector_1 = require("../../classList/classListSelector");
20
20
  const reconciliationViewReducer_1 = require("../reducers/reconciliationViewReducer");
21
21
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
22
- exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
22
+ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state) => state.monthEndCloseChecksViewState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState, monthEndCloseChecksViewState) => {
23
23
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
24
24
  const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
25
25
  const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
@@ -41,6 +41,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
41
41
  }
42
42
  return acc;
43
43
  }, []);
44
+ const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
45
+ const monthEndFetchState = monthYearPeriodId != null
46
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
47
+ fetchState: 'Not-Started',
48
+ error: undefined,
49
+ })
50
+ : { fetchState: 'Not-Started', error: undefined };
44
51
  if (accountReconForMonthYearPeriod == null) {
45
52
  return {
46
53
  bankAccounts: [],
@@ -50,10 +57,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
50
57
  classListNestedAccountHierarchy: [],
51
58
  allAccountList: [],
52
59
  allClassList: [],
53
- fetchStatus: {
54
- fetchState: reconciliationViewState.fetchState,
55
- error: reconciliationViewState.error,
56
- },
60
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
61
+ {
62
+ fetchState: reconciliationViewState.fetchState,
63
+ error: reconciliationViewState.error,
64
+ },
65
+ monthEndFetchState,
66
+ ]),
57
67
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
58
68
  .plaidConnectionDetails,
59
69
  completionStatus: 'incomplete',
@@ -276,10 +286,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
276
286
  bankAccounts: uniqueBankAccounts,
277
287
  creditCards: uniqueCreditCards,
278
288
  accountReconciliationsByAccountID: reconList,
279
- fetchStatus: {
280
- fetchState: reconciliationViewState.fetchState,
281
- error: reconciliationViewState.error,
282
- },
289
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
290
+ {
291
+ fetchState: reconciliationViewState.fetchState,
292
+ error: reconciliationViewState.error,
293
+ },
294
+ monthEndFetchState,
295
+ ]),
283
296
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
284
297
  .plaidConnectionDetails,
285
298
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -14,7 +14,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
14
14
  const classListSelector_1 = require("../../classList/classListSelector");
15
15
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
16
16
  function getExpenseAutomationTransactionView(state) {
17
- const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
19
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
@@ -47,10 +47,16 @@ function getExpenseAutomationTransactionView(state) {
47
47
  .filter((transaction) => transaction != null);
48
48
  const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
49
49
  const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
50
- const fetchStatus = (0, reduceFetchState_1.reduceAllFetchState)([
51
- accountList,
52
- classList,
53
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
50
+ const monthEndFetchState = monthYearPeriodId != null
51
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
52
+ : { fetchState: 'Not-Started', error: undefined };
53
+ const fetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
54
+ (0, reduceFetchState_1.reduceAllFetchState)([
55
+ accountList,
56
+ classList,
57
+ expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
58
+ ]),
59
+ monthEndFetchState,
54
60
  ]);
55
61
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
56
62
  .uiState.totalCount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.96-betaSS1",
3
+ "version": "4.19.96-betaSS2",
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
  "module": "lib/esm/index.js",