@zeniai/client-epic-state 4.19.100 → 4.20.0-beta0ND
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.
Potentially problematic release.
This version of @zeniai/client-epic-state might be problematic. Click here for more details.
- package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +2 -0
- package/lib/commonStateTypes/coaBalance/coaBalanceType.js +6 -0
- package/lib/commonStateTypes/currencyHelper.d.ts +3 -0
- package/lib/commonStateTypes/currencyHelper.js +6 -1
- package/lib/commonStateTypes/reduceFetchState.d.ts +9 -0
- package/lib/commonStateTypes/reduceFetchState.js +26 -0
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountPayload.js +2 -0
- package/lib/entity/account/accountState.d.ts +2 -0
- package/lib/entity/customer/customerState.d.ts +0 -2
- package/lib/entity/customer/customerState.js +0 -5
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +8 -1
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -0
- package/lib/entity/reimbursement/reimbursementPayload.js +7 -0
- package/lib/entity/reimbursement/reimbursementState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/task/taskPayload.d.ts +1 -0
- package/lib/entity/task/taskPayload.js +1 -0
- package/lib/entity/task/taskState.d.ts +1 -0
- package/lib/entity/userGroups/userGroupsPayload.d.ts +7 -0
- package/lib/entity/userGroups/userGroupsPayload.js +10 -0
- package/lib/entity/userGroups/userGroupsReducer.d.ts +8 -0
- package/lib/entity/userGroups/userGroupsReducer.js +29 -0
- package/lib/entity/userGroups/userGroupsSelector.d.ts +4 -0
- package/lib/entity/userGroups/userGroupsSelector.js +12 -0
- package/lib/entity/userGroups/userGroupsState.d.ts +9 -0
- package/lib/entity/userGroups/userGroupsState.js +2 -0
- package/lib/epic.d.ts +12 -1
- package/lib/epic.js +12 -1
- package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +5 -0
- package/lib/esm/commonStateTypes/currencyHelper.js +5 -0
- package/lib/esm/commonStateTypes/reduceFetchState.js +25 -0
- package/lib/esm/entity/account/accountPayload.js +2 -0
- package/lib/esm/entity/customer/customerState.js +1 -4
- package/lib/esm/entity/depositAccount/depositAccount.js +8 -1
- package/lib/esm/entity/reimbursement/reimbursementPayload.js +7 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/entity/task/taskPayload.js +1 -0
- package/lib/esm/entity/userGroups/userGroupsPayload.js +7 -0
- package/lib/esm/entity/userGroups/userGroupsReducer.js +25 -0
- package/lib/esm/entity/userGroups/userGroupsSelector.js +8 -0
- package/lib/esm/entity/userGroups/userGroupsState.js +1 -0
- package/lib/esm/epic.js +12 -1
- package/lib/esm/index.js +18 -10
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
- package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +10 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +29 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +56 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +77 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +79 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +189 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +433 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +23 -1
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +244 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +44 -0
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/esm/view/financeStatement/financeStatementReducer.js +11 -8
- package/lib/esm/view/financeStatement/financeStatementSelector.js +24 -9
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +317 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +9 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
- package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +282 -0
- package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +9 -7
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +3 -1
- package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +2 -16
- package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +65 -0
- package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +16 -0
- package/lib/esm/view/userGroupListView/userGroupListViewState.js +1 -0
- package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +11 -0
- package/lib/esm/zeniAPI.js +0 -2
- package/lib/index.d.ts +19 -12
- package/lib/index.js +81 -23
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
- package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +10 -0
- package/lib/view/expenseAutomationView/bulkUploadTiming.js +13 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +33 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +37 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +61 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +81 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +25 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +85 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +118 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +201 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +76 -3
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +434 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +24 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +243 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +142 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +54 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/view/financeStatement/financeStatementReducer.js +11 -8
- package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
- package/lib/view/financeStatement/financeStatementSelector.js +24 -9
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +13 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +321 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +111 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +13 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +4 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +7 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +4 -0
- package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +6 -0
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +285 -0
- package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +8 -6
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +1 -0
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -0
- package/lib/view/taskManager/taskListView/taskListSelector.js +3 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +1 -15
- package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
- package/lib/view/userGroupListView/userGroupListViewReducer.js +69 -0
- package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +7 -0
- package/lib/view/userGroupListView/userGroupListViewSelector.js +20 -0
- package/lib/view/userGroupListView/userGroupListViewState.d.ts +8 -0
- package/lib/view/userGroupListView/userGroupListViewState.js +2 -0
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +3 -1
- package/lib/view/userListView/fetchUserListByTypeEpic.js +11 -0
- package/lib/view/userListView/userListViewPayload.d.ts +2 -0
- package/lib/zeniAPI.js +0 -2
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import { NestedClassID } from '../../commonStateTypes/classesView/nestedClassID'
|
|
|
2
2
|
import { AccountViewMode, ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { ZeniAPIStatus, ZeniReportData } from '../../responsePayload';
|
|
4
4
|
import { ProfitAndLossClassesViewPayload } from './profitAndLossClassesViewPayload';
|
|
5
|
-
import { ProfitAndLossClassesViewState } from './profitAndLossClassesViewState';
|
|
5
|
+
import { ClassViewLayout, ProfitAndLossClassesViewState } from './profitAndLossClassesViewState';
|
|
6
6
|
export declare const initialState: ProfitAndLossClassesViewState;
|
|
7
7
|
export declare const fetchProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
8
8
|
cacheOverride: boolean;
|
|
@@ -30,6 +30,8 @@ export declare const fetchProfitAndLossClassesView: import("@reduxjs/toolkit").A
|
|
|
30
30
|
};
|
|
31
31
|
}, "profitAndLossClassesView/updateProfitAndLossClassesViewUIState">, updateAccountViewMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
32
32
|
viewMode: AccountViewMode;
|
|
33
|
-
}, "profitAndLossClassesView/updateAccountViewMode">,
|
|
33
|
+
}, "profitAndLossClassesView/updateAccountViewMode">, updateClassViewLayout: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
|
+
classViewLayout: ClassViewLayout;
|
|
35
|
+
}, "profitAndLossClassesView/updateClassViewLayout">, resetProfitAndLossClassesNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/resetProfitAndLossClassesNodeCollapseState">, clearProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/clearProfitAndLossClassesView">;
|
|
34
36
|
declare const _default: import("redux").Reducer<ProfitAndLossClassesViewState>;
|
|
35
37
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearProfitAndLossClassesView = exports.resetProfitAndLossClassesNodeCollapseState = exports.updateAccountViewMode = exports.updateProfitAndLossClassesViewUIState = exports.updateClassesToFilterOut = exports.updateProfitAndLossForTimeframeClassesViewFailure = exports.updateProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossClassesView = exports.initialState = void 0;
|
|
4
|
+
exports.clearProfitAndLossClassesView = exports.resetProfitAndLossClassesNodeCollapseState = exports.updateClassViewLayout = exports.updateAccountViewMode = exports.updateProfitAndLossClassesViewUIState = exports.updateClassesToFilterOut = exports.updateProfitAndLossForTimeframeClassesViewFailure = exports.updateProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossClassesView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
7
7
|
const getNestedClassIDHierarchyForReport_1 = require("../../commonStateTypes/classesView/getNestedClassIDHierarchyForReport");
|
|
@@ -27,6 +27,7 @@ exports.initialState = {
|
|
|
27
27
|
nodeCollapseState: {},
|
|
28
28
|
scrollPosition: undefined,
|
|
29
29
|
accountViewMode: 'account_group',
|
|
30
|
+
classViewLayout: 'vertical',
|
|
30
31
|
classesToFilterOut: [],
|
|
31
32
|
},
|
|
32
33
|
firstMonthOfFY: 1,
|
|
@@ -98,6 +99,9 @@ const profitAndLossClassesView = (0, toolkit_1.createSlice)({
|
|
|
98
99
|
updateAccountViewMode(draft, action) {
|
|
99
100
|
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
100
101
|
},
|
|
102
|
+
updateClassViewLayout(draft, action) {
|
|
103
|
+
draft.uiState.classViewLayout = action.payload.classViewLayout;
|
|
104
|
+
},
|
|
101
105
|
resetProfitAndLossClassesNodeCollapseState(draft) {
|
|
102
106
|
draft.uiState.nodeCollapseState = {};
|
|
103
107
|
},
|
|
@@ -106,10 +110,11 @@ const profitAndLossClassesView = (0, toolkit_1.createSlice)({
|
|
|
106
110
|
},
|
|
107
111
|
},
|
|
108
112
|
});
|
|
109
|
-
_a = profitAndLossClassesView.actions, exports.fetchProfitAndLossClassesView = _a.fetchProfitAndLossClassesView, exports.fetchProfitAndLossForTimeframeClassesView = _a.fetchProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesView = _a.updateProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesViewFailure = _a.updateProfitAndLossForTimeframeClassesViewFailure, exports.updateClassesToFilterOut = _a.updateClassesToFilterOut, exports.updateProfitAndLossClassesViewUIState = _a.updateProfitAndLossClassesViewUIState, exports.updateAccountViewMode = _a.updateAccountViewMode, exports.resetProfitAndLossClassesNodeCollapseState = _a.resetProfitAndLossClassesNodeCollapseState, exports.clearProfitAndLossClassesView = _a.clearProfitAndLossClassesView;
|
|
113
|
+
_a = profitAndLossClassesView.actions, exports.fetchProfitAndLossClassesView = _a.fetchProfitAndLossClassesView, exports.fetchProfitAndLossForTimeframeClassesView = _a.fetchProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesView = _a.updateProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesViewFailure = _a.updateProfitAndLossForTimeframeClassesViewFailure, exports.updateClassesToFilterOut = _a.updateClassesToFilterOut, exports.updateProfitAndLossClassesViewUIState = _a.updateProfitAndLossClassesViewUIState, exports.updateAccountViewMode = _a.updateAccountViewMode, exports.updateClassViewLayout = _a.updateClassViewLayout, exports.resetProfitAndLossClassesNodeCollapseState = _a.resetProfitAndLossClassesNodeCollapseState, exports.clearProfitAndLossClassesView = _a.clearProfitAndLossClassesView;
|
|
110
114
|
exports.default = profitAndLossClassesView.reducer;
|
|
111
115
|
const doUpdatedProfitAndLossClassesView = (draft, timeframe, pandLReport) => {
|
|
112
116
|
const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(pandLReport.report);
|
|
117
|
+
draft.currency = report.currency;
|
|
113
118
|
draft.dataAvailable = report.dataAvailable;
|
|
114
119
|
draft.firstMonthOfFY = report.firstMonthOfFY;
|
|
115
120
|
draft.bookCloseDate = report.bookCloseDate;
|
|
@@ -4,6 +4,7 @@ exports.getProfitAndLossClassesView = exports.profitAndLossIdsInOrder = void 0;
|
|
|
4
4
|
const getDifferenceOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod");
|
|
5
5
|
const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
|
|
6
6
|
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
7
|
+
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
7
8
|
const sectionClassesViewSelector_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewSelector");
|
|
8
9
|
const profitAndLossClassesViewSelectorTypes_1 = require("./profitAndLossClassesViewSelectorTypes");
|
|
9
10
|
exports.profitAndLossIdsInOrder = [
|
|
@@ -18,7 +19,7 @@ exports.profitAndLossIdsInOrder = [
|
|
|
18
19
|
'netIncome',
|
|
19
20
|
];
|
|
20
21
|
const getProfitAndLossClassesView = (filter, accountState, classState, sectionsState, profitAndLossClassesViewState) => {
|
|
21
|
-
const fetchState =
|
|
22
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
|
|
22
23
|
profitAndLossClassesViewState.fetchState.month,
|
|
23
24
|
profitAndLossClassesViewState.fetchState.quarter,
|
|
24
25
|
profitAndLossClassesViewState.fetchState.year,
|
|
@@ -68,31 +69,3 @@ const getProfitAndLossClassesView = (filter, accountState, classState, sectionsS
|
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
71
|
exports.getProfitAndLossClassesView = getProfitAndLossClassesView;
|
|
71
|
-
function reduceFetchState(fetchStateList) {
|
|
72
|
-
const isAnyProgress = fetchStateList.reduce((prevValue, currentValue) => {
|
|
73
|
-
return prevValue === true || currentValue.fetchState === 'In-Progress';
|
|
74
|
-
}, false);
|
|
75
|
-
const isAllCompleted = fetchStateList.reduce((prevValue, currentValue) => {
|
|
76
|
-
return prevValue === true && currentValue.fetchState === 'Completed';
|
|
77
|
-
}, true);
|
|
78
|
-
const isAnyError = fetchStateList.reduce((prevValue, currentValue) => {
|
|
79
|
-
return prevValue === true || currentValue.fetchState === 'Error';
|
|
80
|
-
}, false);
|
|
81
|
-
const error = fetchStateList.reduce((prevValue, currentValue) => {
|
|
82
|
-
return prevValue ?? currentValue.error;
|
|
83
|
-
}, undefined);
|
|
84
|
-
let fetchState = 'Not-Started';
|
|
85
|
-
if (isAnyProgress) {
|
|
86
|
-
fetchState = 'In-Progress';
|
|
87
|
-
}
|
|
88
|
-
else if (isAllCompleted) {
|
|
89
|
-
fetchState = 'Completed';
|
|
90
|
-
}
|
|
91
|
-
else if (isAnyError) {
|
|
92
|
-
fetchState = 'Error';
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
fetchState,
|
|
96
|
-
error,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Currency } from '../../commonStateTypes/amount';
|
|
1
2
|
import { NestedClassHierarchyForReport, NestedClassID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
2
3
|
import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
3
4
|
import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
+
export type ClassViewLayout = 'vertical' | 'horizontal';
|
|
4
6
|
export interface ProfitAndLossClassesViewUIState {
|
|
5
7
|
accountViewMode: AccountViewMode;
|
|
6
8
|
classesToFilterOut: NestedClassID[];
|
|
9
|
+
classViewLayout: ClassViewLayout;
|
|
7
10
|
nodeCollapseState: Record<ID, boolean>;
|
|
8
11
|
scrollPosition: {
|
|
9
12
|
scrollTop: number;
|
|
@@ -18,4 +21,5 @@ export interface ProfitAndLossClassesViewState extends Report {
|
|
|
18
21
|
year: FetchStateAndError;
|
|
19
22
|
};
|
|
20
23
|
uiState: ProfitAndLossClassesViewUIState;
|
|
24
|
+
currency?: Currency;
|
|
21
25
|
}
|
|
@@ -27,11 +27,13 @@ const fetchProfitAndLossForTimeframeClassesViewEpic = (actions$, _, zeniAPI) =>
|
|
|
27
27
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
28
28
|
if (response.data != null && (0, responsePayload_1.isSuccessResponse)(response)) {
|
|
29
29
|
const actions = [];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
33
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
34
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
30
|
+
const report = response.data.report;
|
|
31
|
+
const currency = report.currency;
|
|
32
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'cogs', 'profit_and_loss_by_classes', report.cogs, report.classes, report.accounts, currency));
|
|
33
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'expenses', 'profit_and_loss_by_classes', report.expenses, report.classes, report.accounts, currency));
|
|
34
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'income', 'profit_and_loss_by_classes', report.income, report.classes, report.accounts, currency));
|
|
35
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherExpenses', 'profit_and_loss_by_classes', report.other_expenses, report.classes, report.accounts, currency));
|
|
36
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherIncome', 'profit_and_loss_by_classes', report.other_income, report.classes, report.accounts, currency));
|
|
35
37
|
actions.push((0, profitAndLossClassesViewReducer_1.updateProfitAndLossForTimeframeClassesView)({
|
|
36
38
|
timeframe: action.payload.timeframe,
|
|
37
39
|
report: response.data,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProfitAndLossByClassHorizontalReport } from './profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Populates `sectionHeaderBalancesSlice`, and per-account `accountReportData`, so the
|
|
4
|
+
* web layer only maps selector output to tree nodes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function enrichProfitAndLossByClassHorizontalReport(report: ProfitAndLossByClassHorizontalReport): void;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enrichProfitAndLossByClassHorizontalReport = enrichProfitAndLossByClassHorizontalReport;
|
|
4
|
+
const currencyHelper_1 = require("../../commonStateTypes/currencyHelper");
|
|
5
|
+
const profitAndLossClassesByClassHorizontalSelectorTypes_1 = require("./profitAndLossClassesByClassHorizontalSelectorTypes");
|
|
6
|
+
/**
|
|
7
|
+
* Populates `sectionHeaderBalancesSlice`, and per-account `accountReportData`, so the
|
|
8
|
+
* web layer only maps selector output to tree nodes.
|
|
9
|
+
*/
|
|
10
|
+
function enrichProfitAndLossByClassHorizontalReport(report) {
|
|
11
|
+
if (report.fetchState !== 'Completed' || report.selectedPeriod == null) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
for (const section of Object.values(report.sections)) {
|
|
15
|
+
if (section != null) {
|
|
16
|
+
enrichHorizontalSection(report, section);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
for (const calc of Object.values(report.calculatedSections)) {
|
|
20
|
+
if (calc != null) {
|
|
21
|
+
enrichHorizontalCalculatedSection(report, calc);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function enrichHorizontalSection(report, section) {
|
|
26
|
+
const classAmounts = report.classColumns.map((col) => {
|
|
27
|
+
const total = section.classTotals.find((ct) => ct.classId === col.classId);
|
|
28
|
+
return total?.balance.amount ?? 0;
|
|
29
|
+
});
|
|
30
|
+
section.sectionHeaderBalancesSlice = buildHorizontalClassColumnBalancesSlice(report, classAmounts, section.sectionTotal.amount);
|
|
31
|
+
const parentIndices = computeHorizontalAccountParentIndices(section.accounts);
|
|
32
|
+
const childrenRowIndicesByParent = buildHorizontalAccountChildIndicesByParent(parentIndices);
|
|
33
|
+
const childrenRecord = {};
|
|
34
|
+
childrenRowIndicesByParent.forEach((childIndices, parentIndex) => {
|
|
35
|
+
childrenRecord[parentIndex] = childIndices;
|
|
36
|
+
});
|
|
37
|
+
section.treeLayout = {
|
|
38
|
+
rootAccountRowIndices: section.accounts
|
|
39
|
+
.map((_, i) => (parentIndices[i] === -1 ? i : -1))
|
|
40
|
+
.filter((i) => i >= 0),
|
|
41
|
+
childrenRowIndicesByParent: childrenRecord,
|
|
42
|
+
};
|
|
43
|
+
const siblingsPerRow = buildSiblingIndicesPerRow(section.accounts, parentIndices);
|
|
44
|
+
const hasChildFlags = computeHorizontalHasChildFlags(parentIndices);
|
|
45
|
+
for (let i = 0; i < section.accounts.length; i++) {
|
|
46
|
+
const row = section.accounts[i];
|
|
47
|
+
// Same column order as `report.classColumns` (see `pivotSectionToHorizontal`).
|
|
48
|
+
const classRowAmounts = row.classBalances.map((b) => b.balance.amount);
|
|
49
|
+
row.accountReportData = {
|
|
50
|
+
accountId: row.accountId,
|
|
51
|
+
accountName: row.accountName,
|
|
52
|
+
accountType: row.accountType,
|
|
53
|
+
depth: row.depth,
|
|
54
|
+
balancesInTimeframe: buildHorizontalClassColumnBalancesSlice(report, classRowAmounts, row.rowTotal.amount),
|
|
55
|
+
horizontalTreeView: buildHorizontalTreeViewFromPrecomputed(section.accounts, i, parentIndices, siblingsPerRow, hasChildFlags),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function enrichHorizontalCalculatedSection(report, calcSection) {
|
|
60
|
+
const classAmounts = report.classColumns.map((col) => {
|
|
61
|
+
const total = calcSection.classTotals.find((ct) => ct.classId === col.classId);
|
|
62
|
+
return total?.balance.amount ?? 0;
|
|
63
|
+
});
|
|
64
|
+
calcSection.sectionHeaderBalancesSlice =
|
|
65
|
+
buildHorizontalClassColumnBalancesSlice(report, classAmounts, calcSection.sectionTotal.amount);
|
|
66
|
+
}
|
|
67
|
+
function buildHorizontalClassColumnBalancesSlice(report, classAmounts, totalAmount) {
|
|
68
|
+
const fallback = currencyHelper_1.defaultCustomerCurrency;
|
|
69
|
+
const firstHeader = report.headerBalances[0];
|
|
70
|
+
const currencyCode = firstHeader?.balance.currencyCode ?? fallback.currencyCode;
|
|
71
|
+
const currencySymbol = firstHeader?.balance.currencySymbol ?? fallback.currencySymbol;
|
|
72
|
+
const timeframe = firstHeader?.balanceTimeFrame ?? 'month';
|
|
73
|
+
const emptySlice = {
|
|
74
|
+
balances: [],
|
|
75
|
+
additionalBalances: [],
|
|
76
|
+
filter: {
|
|
77
|
+
firstMonthOfFY: report.firstMonthOfFY,
|
|
78
|
+
timeframe,
|
|
79
|
+
balancesRange: { numberOfPeriods: 0, orderBy: 'ascending_date' },
|
|
80
|
+
additionalBalances: [],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
if (report.selectedPeriod == null) {
|
|
84
|
+
return emptySlice;
|
|
85
|
+
}
|
|
86
|
+
const { startDate, endDate } = report.selectedPeriod;
|
|
87
|
+
const balances = report.classColumns.map((col, i) => ({
|
|
88
|
+
balance: {
|
|
89
|
+
amount: classAmounts[i] ?? 0,
|
|
90
|
+
currencyCode,
|
|
91
|
+
currencySymbol,
|
|
92
|
+
},
|
|
93
|
+
balanceTimeFrame: timeframe,
|
|
94
|
+
startDate,
|
|
95
|
+
endDate,
|
|
96
|
+
type: 'default',
|
|
97
|
+
id: col.classId,
|
|
98
|
+
label: col.className,
|
|
99
|
+
}));
|
|
100
|
+
balances.push({
|
|
101
|
+
balance: {
|
|
102
|
+
amount: totalAmount,
|
|
103
|
+
currencyCode,
|
|
104
|
+
currencySymbol,
|
|
105
|
+
},
|
|
106
|
+
balanceTimeFrame: timeframe,
|
|
107
|
+
startDate,
|
|
108
|
+
endDate,
|
|
109
|
+
type: 'default',
|
|
110
|
+
id: profitAndLossClassesByClassHorizontalSelectorTypes_1.HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
|
|
111
|
+
label: 'Total',
|
|
112
|
+
});
|
|
113
|
+
return {
|
|
114
|
+
balances,
|
|
115
|
+
additionalBalances: [],
|
|
116
|
+
filter: {
|
|
117
|
+
firstMonthOfFY: report.firstMonthOfFY,
|
|
118
|
+
timeframe,
|
|
119
|
+
balancesRange: {
|
|
120
|
+
numberOfPeriods: balances.length,
|
|
121
|
+
orderBy: 'ascending_date',
|
|
122
|
+
},
|
|
123
|
+
additionalBalances: [],
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Parent index per DFS row — O(n). Matches the scan in the former
|
|
129
|
+
* `findHorizontalAccountParentIndex` (depth <= 2 rows have no parent).
|
|
130
|
+
*/
|
|
131
|
+
function computeHorizontalAccountParentIndices(rows) {
|
|
132
|
+
const accountRowCount = rows.length;
|
|
133
|
+
const parentIndex = new Array(accountRowCount).fill(-1);
|
|
134
|
+
const stack = [];
|
|
135
|
+
for (let rowIndex = 0; rowIndex < accountRowCount; rowIndex++) {
|
|
136
|
+
const accountRow = rows[rowIndex];
|
|
137
|
+
if (accountRow == null) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const d = accountRow.depth;
|
|
141
|
+
while (stack.length > 0) {
|
|
142
|
+
const topIdx = stack[stack.length - 1];
|
|
143
|
+
if (topIdx == null) {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
const topRow = rows[topIdx];
|
|
147
|
+
if (topRow == null) {
|
|
148
|
+
stack.pop();
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (topRow.depth < d) {
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
stack.pop();
|
|
155
|
+
}
|
|
156
|
+
if (d <= 2) {
|
|
157
|
+
parentIndex[rowIndex] = -1;
|
|
158
|
+
}
|
|
159
|
+
else if (stack.length === 0) {
|
|
160
|
+
parentIndex[rowIndex] = -1;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const peek = stack[stack.length - 1];
|
|
164
|
+
if (peek == null) {
|
|
165
|
+
parentIndex[rowIndex] = -1;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
const parentRow = rows[peek];
|
|
169
|
+
parentIndex[rowIndex] =
|
|
170
|
+
parentRow != null && parentRow.depth === d - 1 ? peek : -1;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
stack.push(rowIndex);
|
|
174
|
+
}
|
|
175
|
+
return parentIndex;
|
|
176
|
+
}
|
|
177
|
+
/** Sibling row indices (same parent + depth), in traversal order — O(n). */
|
|
178
|
+
function buildSiblingIndicesPerRow(rows, parentIndices) {
|
|
179
|
+
const accountRowCount = rows.length;
|
|
180
|
+
const keyToIndices = new Map();
|
|
181
|
+
for (let rowIndex = 0; rowIndex < accountRowCount; rowIndex++) {
|
|
182
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
183
|
+
const accountRow = rows[rowIndex];
|
|
184
|
+
if (parentRowIndex == null || accountRow == null) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const key = `${parentRowIndex}:${accountRow.depth}`;
|
|
188
|
+
let g = keyToIndices.get(key);
|
|
189
|
+
if (g == null) {
|
|
190
|
+
g = [];
|
|
191
|
+
keyToIndices.set(key, g);
|
|
192
|
+
}
|
|
193
|
+
g.push(rowIndex);
|
|
194
|
+
}
|
|
195
|
+
const siblingsPerRow = new Array(accountRowCount);
|
|
196
|
+
for (let rowIndex = 0; rowIndex < accountRowCount; rowIndex++) {
|
|
197
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
198
|
+
const accountRow = rows[rowIndex];
|
|
199
|
+
if (parentRowIndex == null || accountRow == null) {
|
|
200
|
+
siblingsPerRow[rowIndex] = [rowIndex];
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const key = `${parentRowIndex}:${accountRow.depth}`;
|
|
204
|
+
const group = keyToIndices.get(key);
|
|
205
|
+
siblingsPerRow[rowIndex] = group != null ? group : [rowIndex];
|
|
206
|
+
}
|
|
207
|
+
return siblingsPerRow;
|
|
208
|
+
}
|
|
209
|
+
function computeHorizontalHasChildFlags(parentIndices) {
|
|
210
|
+
const rowCount = parentIndices.length;
|
|
211
|
+
const flags = new Array(rowCount).fill(false);
|
|
212
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
213
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
214
|
+
if (parentRowIndex != null &&
|
|
215
|
+
parentRowIndex >= 0 &&
|
|
216
|
+
parentRowIndex < rowCount) {
|
|
217
|
+
flags[parentRowIndex] = true;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return flags;
|
|
221
|
+
}
|
|
222
|
+
function buildHorizontalSubAccountAncestorMetadataFromPrecomputed(dfsOrderedAccountRows, currentRowIndex, parentIndices, siblingsPerRow, hasChildFlags) {
|
|
223
|
+
const chain = [];
|
|
224
|
+
let walkRowIndex = currentRowIndex;
|
|
225
|
+
while (walkRowIndex >= 0) {
|
|
226
|
+
chain.unshift(walkRowIndex);
|
|
227
|
+
const parentRowIndex = parentIndices[walkRowIndex];
|
|
228
|
+
if (parentRowIndex == null) {
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
walkRowIndex = parentRowIndex;
|
|
232
|
+
}
|
|
233
|
+
return chain.map((rowIndex) => {
|
|
234
|
+
const accountRow = dfsOrderedAccountRows[rowIndex];
|
|
235
|
+
const siblingIndices = siblingsPerRow[rowIndex];
|
|
236
|
+
const hasChild = hasChildFlags[rowIndex];
|
|
237
|
+
if (accountRow == null || siblingIndices == null) {
|
|
238
|
+
return {
|
|
239
|
+
depth: 0,
|
|
240
|
+
hasSibling: false,
|
|
241
|
+
hasChildren: hasChild === true,
|
|
242
|
+
isLastNode: true,
|
|
243
|
+
name: '',
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
depth: accountRow.depth - 2,
|
|
248
|
+
hasSibling: siblingIndices.length > 1,
|
|
249
|
+
hasChildren: hasChild === true,
|
|
250
|
+
isLastNode: rowIndex === siblingIndices[siblingIndices.length - 1],
|
|
251
|
+
name: accountRow.accountName,
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function buildHorizontalTreeViewFromPrecomputed(dfsOrderedAccountRows, currentRowIndex, parentIndices, siblingsPerRow, hasChildFlags) {
|
|
256
|
+
const siblingIndices = siblingsPerRow[currentRowIndex];
|
|
257
|
+
const accountRow = dfsOrderedAccountRows[currentRowIndex];
|
|
258
|
+
const hasChildrenFlag = hasChildFlags[currentRowIndex];
|
|
259
|
+
const treeDepth = accountRow != null ? Math.max(0, accountRow.depth - 2) : 0;
|
|
260
|
+
const hasChildren = hasChildrenFlag === true;
|
|
261
|
+
const sibs = siblingIndices ?? [currentRowIndex];
|
|
262
|
+
return {
|
|
263
|
+
subAccountAncestorMetadata: buildHorizontalSubAccountAncestorMetadataFromPrecomputed(dfsOrderedAccountRows, currentRowIndex, parentIndices, siblingsPerRow, hasChildFlags),
|
|
264
|
+
treeDepth,
|
|
265
|
+
hasChildren,
|
|
266
|
+
hasSiblings: sibs.length > 1,
|
|
267
|
+
isLeaf: !hasChildren,
|
|
268
|
+
isLastNode: currentRowIndex === sibs[sibs.length - 1],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function buildHorizontalAccountChildIndicesByParent(parentIndices) {
|
|
272
|
+
const childIndicesByParentRowIndex = new Map();
|
|
273
|
+
for (let rowIndex = 0; rowIndex < parentIndices.length; rowIndex++) {
|
|
274
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
275
|
+
if (parentRowIndex != null && parentRowIndex >= 0) {
|
|
276
|
+
let childRowIndices = childIndicesByParentRowIndex.get(parentRowIndex);
|
|
277
|
+
if (childRowIndices == null) {
|
|
278
|
+
childRowIndices = [];
|
|
279
|
+
childIndicesByParentRowIndex.set(parentRowIndex, childRowIndices);
|
|
280
|
+
}
|
|
281
|
+
childRowIndices.push(rowIndex);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return childIndicesByParentRowIndex;
|
|
285
|
+
}
|
|
@@ -11,9 +11,13 @@ const opExReducer_1 = require("../opEx/opExReducer");
|
|
|
11
11
|
const revenueReducer_1 = require("../revenue/revenueReducer");
|
|
12
12
|
const reportUIOptionsReducer_1 = require("./reportUIOptionsReducer");
|
|
13
13
|
const updateReportUIOptionCOABalancesRangeEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(reportUIOptionsReducer_1.updateReportUIOptionCOABalancesRange.match), (0, operators_1.switchMap)((action) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
14
|
+
const selectedRange = action.payload.selectedCOABalancesRange;
|
|
15
|
+
const thisPeriod = selectedRange.thisPeriod;
|
|
16
|
+
const orderBy = selectedRange.orderBy;
|
|
17
|
+
const numberOfPeriodsFromSelection = selectedRange.numberOfPeriods;
|
|
18
|
+
const highlightedNoOfPeriods = state$.value.reportUIOptionsState.isCompareModeOn === true
|
|
19
|
+
? numberOfPeriodsFromSelection
|
|
20
|
+
: 1;
|
|
17
21
|
const highlightedCOABalancesRange = action.payload.highlightedCOABalancesRange == null && thisPeriod != null
|
|
18
22
|
? {
|
|
19
23
|
numberOfPeriods: highlightedNoOfPeriods,
|
|
@@ -65,9 +69,7 @@ const updateReportUIOptionCOABalancesRangeEpic = (actions$, state$) => actions$.
|
|
|
65
69
|
thisPeriod: action.payload.highlightedCOABalancesRange != null
|
|
66
70
|
? action.payload.highlightedCOABalancesRange.thisPeriod
|
|
67
71
|
: thisPeriod,
|
|
68
|
-
numberOfPeriods:
|
|
69
|
-
? 4
|
|
70
|
-
: financeStatementReducer_1.initialFinanceStatementState.maxNumOfPeriodsToHighlight,
|
|
72
|
+
numberOfPeriods: numberOfPeriodsFromSelection,
|
|
71
73
|
orderBy,
|
|
72
74
|
}));
|
|
73
75
|
}));
|
|
@@ -79,6 +79,7 @@ const toTaskPayload = (state, task) => {
|
|
|
79
79
|
name: task.name,
|
|
80
80
|
assignees: task.assignees,
|
|
81
81
|
description: task.description,
|
|
82
|
+
group_assignees: task.groupAssignees,
|
|
82
83
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
83
84
|
priority: task.priority.code,
|
|
84
85
|
status: task.status.code,
|
|
@@ -8,6 +8,7 @@ import { UserState } from '../../../entity/user/userState';
|
|
|
8
8
|
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
9
9
|
import { RootState } from '../../../reducer';
|
|
10
10
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
11
|
+
import { UserGroupListSelectorView } from '../../userGroupListView/userGroupListViewSelector';
|
|
11
12
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
12
13
|
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
13
14
|
export interface TaskWithUserDetails extends Task {
|
|
@@ -30,6 +31,7 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
30
31
|
taskGroupUpdateStatus: FetchStateAndError;
|
|
31
32
|
uiState: TaskListUIState;
|
|
32
33
|
updateTasksFetchState: FetchStateAndError;
|
|
34
|
+
userGroupList: UserGroupListSelectorView;
|
|
33
35
|
userList: UserListSelectorView;
|
|
34
36
|
}
|
|
35
37
|
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
@@ -17,6 +17,7 @@ const taskGroupTemplateSelector_1 = require("../../../entity/taskGroupTemplate/t
|
|
|
17
17
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
18
18
|
const userAndRole_1 = require("../../companyView/types/userAndRole");
|
|
19
19
|
const spendManagementFilterHelpers_1 = require("../../spendManagement/spendManagementFilterHelpers");
|
|
20
|
+
const userGroupListViewSelector_1 = require("../../userGroupListView/userGroupListViewSelector");
|
|
20
21
|
const userListViewSelector_1 = require("../../userListView/userListViewSelector");
|
|
21
22
|
const taskDetailSelector_1 = require("../taskDetailView/taskDetailSelector");
|
|
22
23
|
const taskList_1 = require("./taskList");
|
|
@@ -316,7 +317,7 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
316
317
|
tagState,
|
|
317
318
|
});
|
|
318
319
|
};
|
|
319
|
-
exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (_state, isTaskTemplatesEnabled) => isTaskTemplatesEnabled, (taskListState, taskState, userState, userRoleState, userListViewState, addressState, taskGroupState, taskGroupViewState, tagViewState, tagState, taskGroupTemplateState, taskGroupTemplateViewState, isTaskTemplatesEnabled) => {
|
|
320
|
+
exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (state) => state.userGroupsState, (state) => state.userGroupListViewState, (_state, isTaskTemplatesEnabled) => isTaskTemplatesEnabled, (taskListState, taskState, userState, userRoleState, userListViewState, addressState, taskGroupState, taskGroupViewState, tagViewState, tagState, taskGroupTemplateState, taskGroupTemplateViewState, userGroupsState, userGroupListViewState, isTaskTemplatesEnabled) => {
|
|
320
321
|
const { localData } = taskListState;
|
|
321
322
|
const taskGroupsWithTasksList = getTaskGroupsWithTaskList({
|
|
322
323
|
taskListState,
|
|
@@ -344,6 +345,7 @@ exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListSta
|
|
|
344
345
|
taskGroupTemplates,
|
|
345
346
|
fetchState: fetchState,
|
|
346
347
|
userList: (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'taskManagerCandidate'),
|
|
348
|
+
userGroupList: (0, userGroupListViewSelector_1.getUserGroupList)(userGroupsState, userGroupListViewState, 'taskManagerCandidate'),
|
|
347
349
|
error: error,
|
|
348
350
|
version: 0,
|
|
349
351
|
taskGroupsWithTasksList,
|
|
@@ -10,4 +10,4 @@ import { resendOtpCardHolder, sendOtpCardHolderFailure, sendOtpCardHolderSuccess
|
|
|
10
10
|
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
11
11
|
import { resendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
12
12
|
export type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure> | ReturnType<typeof resendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof resendOtpMyProfile> | ReturnType<typeof resendOtpCardHolder> | ReturnType<typeof sendOtpCardHolderSuccess> | ReturnType<typeof sendOtpCardHolderFailure> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
13
|
-
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>,
|
|
13
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -11,20 +11,11 @@ const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/card
|
|
|
11
11
|
const chargeCardDetailReducer_1 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
12
12
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
13
13
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
14
|
-
const resendOtpEpic = (actions$,
|
|
14
|
+
const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
const resendOtpActions = [];
|
|
16
16
|
const { otpChallenge, twoFASource, entityId } = action.payload;
|
|
17
|
-
const chargeCard = twoFASource === 'ChargeCardHolder' && entityId != null
|
|
18
|
-
? state$.value.chargeCardState.chargeCardByID[entityId]
|
|
19
|
-
: null;
|
|
20
17
|
const payload = {
|
|
21
18
|
otp_challenge: otpChallenge,
|
|
22
|
-
...(chargeCard != null
|
|
23
|
-
? {
|
|
24
|
-
provider_card_id: chargeCard.cardProviderID,
|
|
25
|
-
is_for_charge_cards: true,
|
|
26
|
-
}
|
|
27
|
-
: {}),
|
|
28
19
|
};
|
|
29
20
|
switch (twoFASource) {
|
|
30
21
|
case 'SpendManagementSetup':
|
|
@@ -42,11 +33,6 @@ const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
42
33
|
case 'CardUserOnboarding':
|
|
43
34
|
resendOtpActions.push((0, cardUserOnboardingReducer_1.resendOtpCardUserOnboarding)());
|
|
44
35
|
break;
|
|
45
|
-
case 'ChargeCardHolder':
|
|
46
|
-
if (entityId != null) {
|
|
47
|
-
resendOtpActions.push((0, chargeCardDetailReducer_1.resendOtpCardHolder)({ chargeCardId: entityId }));
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
36
|
}
|
|
51
37
|
const resendOtp$ = zeniAPI
|
|
52
38
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/resend`, payload)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { UserGroupPayload } from '../../entity/userGroups/userGroupsPayload';
|
|
3
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { UserGroupListType, UserGroupListViewState } from './userGroupListViewState';
|
|
5
|
+
export declare const initialState: UserGroupListViewState;
|
|
6
|
+
export declare const fetchUserGroupListByType: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userGroupType: "taskManagerCandidate", cacheOverride?: any], {
|
|
7
|
+
userGroupType: "taskManagerCandidate";
|
|
8
|
+
cacheOverride: any;
|
|
9
|
+
}, "userGroupListView/fetchUserGroupListByType", never, never>, updateUserGroupIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
userGroupsPayload: UserGroupPayload[];
|
|
11
|
+
userGroupType: UserGroupListType;
|
|
12
|
+
}, "userGroupListView/updateUserGroupIds">, addUserGroupId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
id: ID;
|
|
14
|
+
userGroupType: UserGroupListType;
|
|
15
|
+
}, "userGroupListView/addUserGroupId">, removeUserGroupId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
+
id: ID;
|
|
17
|
+
userGroupType: UserGroupListType;
|
|
18
|
+
}, "userGroupListView/removeUserGroupId">, updateUserGroupListFetchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
+
status: ZeniAPIStatus;
|
|
20
|
+
userGroupType: UserGroupListType;
|
|
21
|
+
}, "userGroupListView/updateUserGroupListFetchFailure">, clearUserGroupListView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"userGroupListView/clearUserGroupListView">;
|
|
22
|
+
declare const _default: import("redux").Reducer<UserGroupListViewState>;
|
|
23
|
+
export default _default;
|