@zeniai/client-epic-state 5.3.24-betaAK1 → 5.3.24
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.
|
@@ -16,7 +16,7 @@ import { getInsights } from '../insightsCard/insightsCardSelector';
|
|
|
16
16
|
import { getMonthEndCloseChecksViewByTenantId } from '../monthEndCloseChecksView/monthEndCloseChecksViewSelector';
|
|
17
17
|
import { getNetBurnOrIncomeReport } from '../netBurnOrIncome/netBurnOrIncomeSelector';
|
|
18
18
|
import { getNetBurnOrIncomeStoryCardReport } from '../netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardSelector';
|
|
19
|
-
import {
|
|
19
|
+
import { getOperatingExpensesReportForDashboard } from '../opEx/opExSelector';
|
|
20
20
|
import { getRewardsPlanCard } from '../referralView/referralSelector';
|
|
21
21
|
import { getReimbursementCardReport } from '../reimbursementCard/reimbursementCardSelector';
|
|
22
22
|
import { getRevenueReport } from '../revenue/revenueSelector';
|
|
@@ -27,7 +27,7 @@ import { getTop6Expenses } from '../topEx/topExSelector';
|
|
|
27
27
|
const getNetBurnOrIncomeFilter = createSelector((state) => state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, (state) => state.netBurnOrIncomeState.uiState.timeframe, (state) => state.netBurnOrIncomeState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
28
28
|
const getNetBurnOrIncomeForLast4Periods = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.netBurnOrIncomeState, (state) => state.forecastState, (state) => state.forecastListState, getNetBurnOrIncomeFilter, (accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter) => getNetBurnOrIncomeReport(accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter));
|
|
29
29
|
const getOperatingExpensesFilter = createSelector((state) => state.opExState.opEx.firstMonthOfFY, (state) => state.opExState.uiState.timeframe, (state) => state.opExState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
30
|
-
const getOperatingExpensesForLast5Periods = (state) =>
|
|
30
|
+
const getOperatingExpensesForLast5Periods = (state) => getOperatingExpensesReportForDashboard(state, getOperatingExpensesFilter(state));
|
|
31
31
|
const getRevenueFilter = createSelector((state) => state.revenueState.revenue.firstMonthOfFY, (state) => state.revenueState.uiState.timeframe, (state) => state.revenueState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
32
32
|
const getRevenueForLast4Periods = createSelector(getRevenueFilter, (state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.forecastListState, (state) => state.revenueState, (state) => state.forecastState, (filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState) => getRevenueReport(filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState));
|
|
33
33
|
const getCashPositionFilter = createSelector((state) => state.cashPositionState.firstMonthOfFY, (state) => state.cashPositionState.uiState.timeframe, (state) => state.cashPositionState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
@@ -74,7 +74,7 @@ function getOpExBalancesInTimeFrame(opExState, sectionState, readCustomRangeSlot
|
|
|
74
74
|
}
|
|
75
75
|
return [];
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
const createOperatingExpensesReportSelector = () => createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.opExState, (state) => state.forecastState, (state) => state.forecastListState, (_state, filter) => filter, (_state, _filter, forecastId) => forecastId, (_state, _filter, _forecastId, readCustomRangeSlot) => readCustomRangeSlot === true, (accountState, accountGroupState, sectionsState, opExState, forecastState, forecastListState, filter, forecastId, readCustomRangeSlot) => {
|
|
78
78
|
const opEx = getState(opExState, opExState.uiState.isForecastModeOn, forecastId);
|
|
79
79
|
// The detail screen opts into customFetchState so its Completed check fires
|
|
80
80
|
// off the custom fetch; the dashboard (no flag) reads the shared fetchState,
|
|
@@ -134,6 +134,9 @@ export const getOperatingExpensesReport = createSelector((state) => state.accoun
|
|
|
134
134
|
customTimeframe: opExState.uiState.customTimeframe,
|
|
135
135
|
};
|
|
136
136
|
});
|
|
137
|
+
export const getOperatingExpensesReport = createOperatingExpensesReportSelector();
|
|
138
|
+
// The dashboard card keeps its own cache so the detail page's calls with other filters can't evict it.
|
|
139
|
+
export const getOperatingExpensesReportForDashboard = createOperatingExpensesReportSelector();
|
|
137
140
|
export const getOperatingExpensesForSelectedRange = createSelector((state) => state, (state) => state.opExState, (state, opExWithForecastState) => {
|
|
138
141
|
const { timeframe, selectedCOABalancesRange, selectedAdditionalBalances, isForecastModeOn, selectedForecast, } = opExWithForecastState.uiState;
|
|
139
142
|
const noFilter = newBalancesFilter(opExWithForecastState.opEx.firstMonthOfFY, timeframe, selectedCOABalancesRange.numberOfPeriods, selectedCOABalancesRange.thisPeriod, 'ascending_date', selectedAdditionalBalances);
|
|
@@ -30,7 +30,7 @@ const topExSelector_1 = require("../topEx/topExSelector");
|
|
|
30
30
|
const getNetBurnOrIncomeFilter = (0, toolkit_1.createSelector)((state) => state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, (state) => state.netBurnOrIncomeState.uiState.timeframe, (state) => state.netBurnOrIncomeState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
31
31
|
const getNetBurnOrIncomeForLast4Periods = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.netBurnOrIncomeState, (state) => state.forecastState, (state) => state.forecastListState, getNetBurnOrIncomeFilter, (accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter) => (0, netBurnOrIncomeSelector_1.getNetBurnOrIncomeReport)(accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter));
|
|
32
32
|
const getOperatingExpensesFilter = (0, toolkit_1.createSelector)((state) => state.opExState.opEx.firstMonthOfFY, (state) => state.opExState.uiState.timeframe, (state) => state.opExState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
33
|
-
const getOperatingExpensesForLast5Periods = (state) => (0, opExSelector_1.
|
|
33
|
+
const getOperatingExpensesForLast5Periods = (state) => (0, opExSelector_1.getOperatingExpensesReportForDashboard)(state, getOperatingExpensesFilter(state));
|
|
34
34
|
const getRevenueFilter = (0, toolkit_1.createSelector)((state) => state.revenueState.revenue.firstMonthOfFY, (state) => state.revenueState.uiState.timeframe, (state) => state.revenueState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
35
35
|
const getRevenueForLast4Periods = (0, toolkit_1.createSelector)(getRevenueFilter, (state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.forecastListState, (state) => state.revenueState, (state) => state.forecastState, (filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState) => (0, revenueSelector_1.getRevenueReport)(filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState));
|
|
36
36
|
const getCashPositionFilter = (0, toolkit_1.createSelector)((state) => state.cashPositionState.firstMonthOfFY, (state) => state.cashPositionState.uiState.timeframe, (state) => state.cashPositionState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
@@ -4,7 +4,10 @@ import { RootState } from '../../rootStateTypes';
|
|
|
4
4
|
import { OpExReport, OpExUIStateSelectorView } from './opExSelectorTypes';
|
|
5
5
|
import { OpExWithForecastState } from './opExState';
|
|
6
6
|
export declare const getOperatingExpensesUIState: (state: RootState) => OpExUIStateSelectorView;
|
|
7
|
-
|
|
7
|
+
type OperatingExpensesReportSelector = (state: RootState, filter: COABalancesFilter, forecastId?: ID, readCustomRangeSlot?: boolean) => OpExReport;
|
|
8
|
+
export declare const getOperatingExpensesReport: OperatingExpensesReportSelector;
|
|
9
|
+
export declare const getOperatingExpensesReportForDashboard: OperatingExpensesReportSelector;
|
|
8
10
|
export declare const getOperatingExpensesForSelectedRange: (state: RootState) => OpExReport;
|
|
9
11
|
export declare const getOperatingExpensesForHighlightedRange: (state: RootState) => OpExReport;
|
|
10
12
|
export declare const getOperatingExpensesReportFetchState: (forecastId: ID | undefined, opExState: OpExWithForecastState) => FetchStateAndError;
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOperatingExpensesReportFetchState = exports.getOperatingExpensesForHighlightedRange = exports.getOperatingExpensesForSelectedRange = exports.getOperatingExpensesReport = exports.getOperatingExpensesUIState = void 0;
|
|
3
|
+
exports.getOperatingExpensesReportFetchState = exports.getOperatingExpensesForHighlightedRange = exports.getOperatingExpensesForSelectedRange = exports.getOperatingExpensesReportForDashboard = exports.getOperatingExpensesReport = exports.getOperatingExpensesUIState = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
5
|
const coaBalancesFilter_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilter");
|
|
6
6
|
const getCOABalancesSlice_1 = require("../../commonStateTypes/coaBalance/getCOABalancesSlice");
|
|
@@ -77,7 +77,7 @@ function getOpExBalancesInTimeFrame(opExState, sectionState, readCustomRangeSlot
|
|
|
77
77
|
}
|
|
78
78
|
return [];
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
const createOperatingExpensesReportSelector = () => (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.opExState, (state) => state.forecastState, (state) => state.forecastListState, (_state, filter) => filter, (_state, _filter, forecastId) => forecastId, (_state, _filter, _forecastId, readCustomRangeSlot) => readCustomRangeSlot === true, (accountState, accountGroupState, sectionsState, opExState, forecastState, forecastListState, filter, forecastId, readCustomRangeSlot) => {
|
|
81
81
|
const opEx = (0, opExReducer_1.getState)(opExState, opExState.uiState.isForecastModeOn, forecastId);
|
|
82
82
|
// The detail screen opts into customFetchState so its Completed check fires
|
|
83
83
|
// off the custom fetch; the dashboard (no flag) reads the shared fetchState,
|
|
@@ -137,6 +137,9 @@ exports.getOperatingExpensesReport = (0, toolkit_1.createSelector)((state) => st
|
|
|
137
137
|
customTimeframe: opExState.uiState.customTimeframe,
|
|
138
138
|
};
|
|
139
139
|
});
|
|
140
|
+
exports.getOperatingExpensesReport = createOperatingExpensesReportSelector();
|
|
141
|
+
// The dashboard card keeps its own cache so the detail page's calls with other filters can't evict it.
|
|
142
|
+
exports.getOperatingExpensesReportForDashboard = createOperatingExpensesReportSelector();
|
|
140
143
|
exports.getOperatingExpensesForSelectedRange = (0, toolkit_1.createSelector)((state) => state, (state) => state.opExState, (state, opExWithForecastState) => {
|
|
141
144
|
const { timeframe, selectedCOABalancesRange, selectedAdditionalBalances, isForecastModeOn, selectedForecast, } = opExWithForecastState.uiState;
|
|
142
145
|
const noFilter = (0, coaBalancesFilter_1.newBalancesFilter)(opExWithForecastState.opEx.firstMonthOfFY, timeframe, selectedCOABalancesRange.numberOfPeriods, selectedCOABalancesRange.thisPeriod, 'ascending_date', selectedAdditionalBalances);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.3.24
|
|
3
|
+
"version": "5.3.24",
|
|
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",
|