@zeniai/client-epic-state 5.0.69-beta2RJ → 5.0.69-betaAR1
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.
- package/lib/entity/account/accountSelector.d.ts +26 -0
- package/lib/entity/account/accountSelector.js +47 -1
- package/lib/entity/account/accountState.d.ts +5 -0
- package/lib/entity/account/accountState.js +11 -4
- package/lib/entity/class/classSelector.d.ts +35 -0
- package/lib/entity/class/classSelector.js +50 -0
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -2
- package/lib/esm/entity/account/accountSelector.js +46 -1
- package/lib/esm/entity/account/accountState.js +7 -1
- package/lib/esm/entity/class/classSelector.js +48 -0
- package/lib/esm/epic.js +1 -2
- package/lib/esm/index.js +10 -6
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
- package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
- package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +11 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +69 -12
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +228 -0
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +0 -4
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +4 -2
- package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/lib/index.d.ts +7 -9
- package/lib/index.js +41 -37
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
- package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +12 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +4 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +71 -12
- package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +65 -0
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +232 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +1 -2
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +0 -4
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +1 -1
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +4 -2
- package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/package.json +1 -1
- package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.d.ts +0 -68
- package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.js +0 -132
- package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.d.ts +0 -6
- package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.js +0 -27
- package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.d.ts +0 -4
- package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.js +0 -17
- package/lib/entity/scheduleActivityLog/scheduleActivityLogState.d.ts +0 -67
- package/lib/entity/scheduleActivityLog/scheduleActivityLogState.js +0 -39
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogPayload.js +0 -126
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogReducer.js +0 -23
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogSelector.js +0 -10
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogState.js +0 -35
- package/lib/esm/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +0 -67
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +0 -1
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +0 -50
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +0 -33
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewState.js +0 -1
- package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.d.ts +0 -11
- package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +0 -72
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.d.ts +0 -8
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +0 -2
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.d.ts +0 -17
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +0 -54
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.d.ts +0 -8
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +0 -36
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.d.ts +0 -5
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.js +0 -2
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateParentTotalCountForTab = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorizationCompletedSubTab = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateParentTotalCountForTab = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorizationCompletedSubTab = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionFilters = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -35,6 +35,10 @@ exports.initialTransactionTabViewState = {
|
|
|
35
35
|
totalCount: {},
|
|
36
36
|
limit: 10,
|
|
37
37
|
},
|
|
38
|
+
filters: {
|
|
39
|
+
categoryCombinationOperator: 'AND',
|
|
40
|
+
categories: [],
|
|
41
|
+
},
|
|
38
42
|
fetchState: 'Not-Started',
|
|
39
43
|
error: undefined,
|
|
40
44
|
hasValidState() {
|
|
@@ -306,6 +310,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
306
310
|
uiState.totalCount;
|
|
307
311
|
}
|
|
308
312
|
},
|
|
313
|
+
updateTransactionFilters(draft, action) {
|
|
314
|
+
const { selectedTab, filters } = action.payload;
|
|
315
|
+
if (filters != null) {
|
|
316
|
+
draft.transactionCategorizationView[selectedTab].filters = filters;
|
|
317
|
+
}
|
|
318
|
+
},
|
|
309
319
|
saveTransactionCategorization: {
|
|
310
320
|
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
|
311
321
|
return {
|
|
@@ -936,5 +946,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
936
946
|
},
|
|
937
947
|
},
|
|
938
948
|
});
|
|
939
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationCompletedSubTab = _a.updateTransactionCategorizationCompletedSubTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.updateParentTotalCountForTab = _a.updateParentTotalCountForTab, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
949
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.updateTransactionFilters = _a.updateTransactionFilters, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationCompletedSubTab = _a.updateTransactionCategorizationCompletedSubTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.updateParentTotalCountForTab = _a.updateParentTotalCountForTab, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
940
950
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { TransactionWithCOT } from '../../../entity/transaction/stateTypes/transaction';
|
|
1
2
|
import { RootState } from '../../../reducer';
|
|
2
|
-
import {
|
|
3
|
+
import { TransactionView } from '../transactionFilterHelpers';
|
|
4
|
+
import { ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
5
|
+
export declare const toTransactionView: (transaction: TransactionWithCOT, transactionLocalData?: TransactionReviewLocalDataSelectorView) => TransactionView;
|
|
3
6
|
export declare function getExpenseAutomationTransactionView(state: RootState): ExpenseAutomationTransactionViewSelector;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.toTransactionView = void 0;
|
|
6
7
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
7
8
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
8
9
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
@@ -10,14 +11,34 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
|
10
11
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
11
12
|
const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
|
|
12
13
|
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
14
|
+
const transactionFilterHelpers_1 = require("../transactionFilterHelpers");
|
|
13
15
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
14
16
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
15
17
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
16
18
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
19
|
+
const toTransactionView = (transaction, transactionLocalData) => {
|
|
20
|
+
return {
|
|
21
|
+
id: transaction.id,
|
|
22
|
+
date: transaction.date,
|
|
23
|
+
amount: transaction.amount,
|
|
24
|
+
vendorName: transaction.vendorName,
|
|
25
|
+
customerName: transaction.customerName,
|
|
26
|
+
vendorId: transaction.vendorId,
|
|
27
|
+
customerId: transaction.customerId,
|
|
28
|
+
description: transaction.description,
|
|
29
|
+
memo: transaction.memo,
|
|
30
|
+
type: transaction.type,
|
|
31
|
+
typeName: transaction.typeName,
|
|
32
|
+
createTime: transaction.createTime,
|
|
33
|
+
transaction: transaction,
|
|
34
|
+
transactionLocalData,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.toTransactionView = toTransactionView;
|
|
17
38
|
function getExpenseAutomationTransactionView(state) {
|
|
18
39
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
19
40
|
const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
20
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
41
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, filters, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
21
42
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
22
43
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
23
44
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
@@ -36,20 +57,58 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
36
57
|
? transactionIdsBySelectedPeriod[monthYearPeriodId]
|
|
37
58
|
: null;
|
|
38
59
|
const transactionIds = transactionIdsForSelectedPeriod ?? [];
|
|
39
|
-
const
|
|
40
|
-
|
|
60
|
+
const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
|
|
61
|
+
const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
|
|
62
|
+
const transactionLocalDataMap = new Map();
|
|
63
|
+
transactionIds.forEach((transactionId) => {
|
|
41
64
|
const transactionData = transactionReviewLocalDataById[transactionId];
|
|
42
65
|
if (transactionData != null) {
|
|
43
|
-
|
|
66
|
+
transactionLocalDataMap.set(transactionId, {
|
|
44
67
|
transactionId,
|
|
45
68
|
transactionReviewLocalData: transactionData.transactionReviewLocalData,
|
|
46
|
-
};
|
|
69
|
+
});
|
|
47
70
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
71
|
+
});
|
|
72
|
+
// Step 2: Convert to TransactionView and apply advanced filters
|
|
73
|
+
const transactionViews = transactionsWithCOT.map((transaction) => {
|
|
74
|
+
const localData = transactionLocalDataMap.get(transaction.id);
|
|
75
|
+
return (0, exports.toTransactionView)(transaction, localData);
|
|
76
|
+
});
|
|
77
|
+
// Apply TC-specific filters (lives under expenseAutomationView, independent
|
|
78
|
+
// of the Spend Management filter pipeline).
|
|
79
|
+
const filteredTransactionViews = (0, transactionFilterHelpers_1.applyTransactionFilters)(transactionViews, filters);
|
|
80
|
+
// Convert back to TransactionWithCOT for return
|
|
81
|
+
const filteredTransactionsWithCOT = filteredTransactionViews.map((view) => view.transaction);
|
|
82
|
+
// Get transactionLocalData for filtered transactions
|
|
83
|
+
// Also include transactionLocalData for transactions that don't exist in transactionState
|
|
84
|
+
// but have local data (to match original behavior)
|
|
85
|
+
const filteredTransactionIds = new Set(filteredTransactionViews.map((view) => view.id));
|
|
86
|
+
// Pre-compute the membership set once. The previous implementation called
|
|
87
|
+
// `transactions.some(t => t.id === transactionId)` inside the per-id loop,
|
|
88
|
+
// turning the pipeline into O(n × m) — measurable on tenants with large
|
|
89
|
+
// transaction lists since this selector runs on every Redux dispatch.
|
|
90
|
+
const transactionExistsById = new Set(transactions.map((t) => t.id));
|
|
91
|
+
// `.flatMap` returns `X[]` directly when the callback returns `[]` for the
|
|
92
|
+
// skip case, so we don't need the trailing `.filter((d): d is X => …)` type
|
|
93
|
+
// predicate that the previous `map → filter` pipeline required.
|
|
94
|
+
const filteredTransactionLocalData = transactionIds.flatMap((transactionId) => {
|
|
95
|
+
const transactionData = transactionReviewLocalDataById[transactionId];
|
|
96
|
+
if (transactionData == null) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
// Include if transaction is in filtered results, or if transaction doesn't exist in state
|
|
100
|
+
// (to maintain backward compatibility with tests)
|
|
101
|
+
const transactionExists = transactionExistsById.has(transactionId);
|
|
102
|
+
if (filteredTransactionIds.has(transactionId) || !transactionExists) {
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
transactionId,
|
|
106
|
+
transactionReviewLocalData: transactionData.transactionReviewLocalData,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
return [];
|
|
111
|
+
});
|
|
53
112
|
const monthEndFetchState = monthYearPeriodId != null
|
|
54
113
|
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
55
114
|
: { fetchState: 'Not-Started', error: undefined };
|
|
@@ -113,7 +172,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
113
172
|
version: 0,
|
|
114
173
|
fetchState: fetchStatus.fetchState,
|
|
115
174
|
error: fetchStatus.error,
|
|
116
|
-
transactions:
|
|
175
|
+
transactions: filteredTransactionsWithCOT,
|
|
117
176
|
selectedCheckBoxTransactionIds,
|
|
118
177
|
transactionIdsWithUnsavedData,
|
|
119
178
|
uncategorizedAccounts: uncategorizedIncomeExpense,
|
|
@@ -124,7 +183,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
124
183
|
classHierarchyList,
|
|
125
184
|
isAccountingProjectsEnabled,
|
|
126
185
|
projectList,
|
|
127
|
-
transactionLocalData,
|
|
186
|
+
transactionLocalData: filteredTransactionLocalData,
|
|
128
187
|
uiState,
|
|
129
188
|
refreshStatus,
|
|
130
189
|
saveStatus,
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter machinery for the Transaction Categorization feature inside
|
|
3
|
+
* Expense Automation. Intentionally self-contained — does NOT import anything
|
|
4
|
+
* from `view/spendManagement/*`, because Transaction Categorization is not a
|
|
5
|
+
* Spend Management product. Generic primitives (`CategoryCombinationOperator`,
|
|
6
|
+
* `FilterCategoryType`) are redeclared locally rather than imported across the
|
|
7
|
+
* feature boundary; their definitions happen to coincide with the
|
|
8
|
+
* spend-management equivalents, which is fine — they're the same primitive
|
|
9
|
+
* concept used independently by both feature groups.
|
|
10
|
+
*/
|
|
11
|
+
import { Amount } from '../../commonStateTypes/amount';
|
|
12
|
+
import { ID } from '../../commonStateTypes/common';
|
|
13
|
+
import { TransactionType } from '../../entity/transaction/stateTypes/transactionType';
|
|
14
|
+
import { SupportedTransactionWithCOT } from '../../entity/transaction/transactionState';
|
|
15
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
16
|
+
import { TransactionReviewLocalDataSelectorView } from './selectorTypes/transactionsViewSelectorTypes';
|
|
17
|
+
/** Local copy of the generic combination operator — independent of SM. */
|
|
18
|
+
export type CategoryCombinationOperator = 'AND' | 'OR';
|
|
19
|
+
/** Local copy of the generic filter category-input type — independent of SM. */
|
|
20
|
+
export type FilterCategoryType = 'searchAutocomplete' | 'user' | 'dateRange' | 'numberRange' | 'dropdown';
|
|
21
|
+
export type TransactionFilterEntityType = 'transaction_categorization' | 'customer' | 'vendor' | 'merchant';
|
|
22
|
+
export type TransactionFilterCategoryField = 'payment_account_name' | 'payment_account_type' | 'payee' | 'category' | 'class' | 'amount';
|
|
23
|
+
export interface TransactionFilterCategoryDropdownOption {
|
|
24
|
+
value: TransactionFilterCategoryField;
|
|
25
|
+
multiple?: boolean;
|
|
26
|
+
type?: FilterCategoryType;
|
|
27
|
+
}
|
|
28
|
+
export declare const TRANSACTION_FILTER_CATEGORIES: TransactionFilterCategoryDropdownOption[];
|
|
29
|
+
/** Amount filter operators for transaction_categorization. */
|
|
30
|
+
export type TransactionFilterAmountMatchingOperator = 'equal' | 'not_equal' | 'less_than' | 'greater_than' | 'in_between';
|
|
31
|
+
export interface TransactionFilterCategory {
|
|
32
|
+
field: TransactionFilterCategoryField;
|
|
33
|
+
matchingOperator: TransactionFilterAmountMatchingOperator;
|
|
34
|
+
values: (string | number)[];
|
|
35
|
+
valuesCombinationOperator: 'ANY';
|
|
36
|
+
}
|
|
37
|
+
export interface TransactionFilters {
|
|
38
|
+
categories: TransactionFilterCategory[];
|
|
39
|
+
categoryCombinationOperator: CategoryCombinationOperator;
|
|
40
|
+
}
|
|
41
|
+
export interface TransactionView {
|
|
42
|
+
amount: Amount;
|
|
43
|
+
createTime: ZeniDate;
|
|
44
|
+
date: ZeniDate;
|
|
45
|
+
description: string;
|
|
46
|
+
id: ID;
|
|
47
|
+
memo: string;
|
|
48
|
+
transaction: SupportedTransactionWithCOT;
|
|
49
|
+
type: TransactionType;
|
|
50
|
+
customerId?: ID;
|
|
51
|
+
customerName?: string;
|
|
52
|
+
transactionLocalData?: TransactionReviewLocalDataSelectorView;
|
|
53
|
+
typeName?: string;
|
|
54
|
+
vendorId?: ID;
|
|
55
|
+
vendorName?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* TC-only equivalent of `applyAdvancedFiltersOnList`. Filters a list of
|
|
59
|
+
* `TransactionView` items against a `TransactionFilters` object using the
|
|
60
|
+
* AND/OR combination semantics from `categoryCombinationOperator`.
|
|
61
|
+
*
|
|
62
|
+
* Independent of `view/spendManagement` — keeps the TC filter pipeline cleanly
|
|
63
|
+
* inside the Expense Automation feature group.
|
|
64
|
+
*/
|
|
65
|
+
export declare const applyTransactionFilters: (transactions: TransactionView[], filters?: TransactionFilters) => TransactionView[];
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyTransactionFilters = exports.TRANSACTION_FILTER_CATEGORIES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Narrowing type-guard for "has a non-empty string here". Used in place of
|
|
6
|
+
* raw `if (foo)` truthiness checks on `string | null | undefined` values so
|
|
7
|
+
* the `@typescript-eslint/strict-boolean-expressions` lint stays clean —
|
|
8
|
+
* empty strings should explicitly fall through to the next candidate
|
|
9
|
+
* (vendorName → customerName → localData.vendor.name → ...) rather than
|
|
10
|
+
* being implicitly coerced to falsy.
|
|
11
|
+
*/
|
|
12
|
+
const isNonEmptyString = (s) => s != null && s !== '';
|
|
13
|
+
exports.TRANSACTION_FILTER_CATEGORIES = [
|
|
14
|
+
{ value: 'payment_account_name', type: 'dropdown' },
|
|
15
|
+
{ value: 'payment_account_type', type: 'dropdown' },
|
|
16
|
+
{ value: 'payee', type: 'searchAutocomplete' },
|
|
17
|
+
{ value: 'category', type: 'dropdown' },
|
|
18
|
+
{ value: 'class', type: 'dropdown' },
|
|
19
|
+
{ value: 'amount', type: 'numberRange' },
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the comparable value for a transaction against a given filter field.
|
|
23
|
+
* Returns undefined when the transaction doesn't carry the field — callers
|
|
24
|
+
* decide whether absence counts as a match (for 'not_equal' it does).
|
|
25
|
+
*/
|
|
26
|
+
const getCategoryValueForTransaction = (key, transaction) => {
|
|
27
|
+
switch (key) {
|
|
28
|
+
case 'amount': {
|
|
29
|
+
// Prefer transactionLocalData line items (sum). Fall back to lines on
|
|
30
|
+
// the transaction itself. Final fallback: transaction-level amount.
|
|
31
|
+
const localDataForAmount = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
32
|
+
if (localDataForAmount?.lineItemById) {
|
|
33
|
+
const lineItems = Object.values(localDataForAmount.lineItemById);
|
|
34
|
+
if (lineItems.length > 0) {
|
|
35
|
+
return lineItems.reduce((sum, lineItem) => sum + (lineItem.amount?.amount ?? 0), 0);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (transaction.transaction.lines &&
|
|
39
|
+
transaction.transaction.lines.length > 0) {
|
|
40
|
+
return transaction.transaction.lines.reduce((sum, line) => sum + (line.amount?.amount ?? 0), 0);
|
|
41
|
+
}
|
|
42
|
+
return transaction.amount.amount;
|
|
43
|
+
}
|
|
44
|
+
case 'payee': {
|
|
45
|
+
if (isNonEmptyString(transaction.vendorName)) {
|
|
46
|
+
return transaction.vendorName;
|
|
47
|
+
}
|
|
48
|
+
if (isNonEmptyString(transaction.customerName)) {
|
|
49
|
+
return transaction.customerName;
|
|
50
|
+
}
|
|
51
|
+
const localData = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
52
|
+
const vendorName = localData?.vendor?.name;
|
|
53
|
+
if (isNonEmptyString(vendorName)) {
|
|
54
|
+
return vendorName;
|
|
55
|
+
}
|
|
56
|
+
const customerName = localData?.customer?.name;
|
|
57
|
+
if (isNonEmptyString(customerName)) {
|
|
58
|
+
return customerName;
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
case 'payment_account_name': {
|
|
63
|
+
// Match what TransactionCategorizationListRow renders for the cell.
|
|
64
|
+
return transaction.transaction.account?.accountName;
|
|
65
|
+
}
|
|
66
|
+
case 'payment_account_type': {
|
|
67
|
+
// Raw `paymentType` enum ("credit_card" / "check" / "cash"). Dropdown
|
|
68
|
+
// option values use the same enum; row uses `paymentTypeName` for the
|
|
69
|
+
// human label.
|
|
70
|
+
return transaction.transaction.paymentType;
|
|
71
|
+
}
|
|
72
|
+
case 'category': {
|
|
73
|
+
const localDataForCategory = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
74
|
+
if (localDataForCategory != null) {
|
|
75
|
+
const firstLineItem = Object.values(localDataForCategory.lineItemById)[0];
|
|
76
|
+
const accountId = firstLineItem?.account?.accountId;
|
|
77
|
+
if (isNonEmptyString(accountId)) {
|
|
78
|
+
return accountId;
|
|
79
|
+
}
|
|
80
|
+
const qboId = firstLineItem?.account?.qboId;
|
|
81
|
+
if (isNonEmptyString(qboId)) {
|
|
82
|
+
return qboId;
|
|
83
|
+
}
|
|
84
|
+
const accountName = firstLineItem?.account?.accountName;
|
|
85
|
+
if (isNonEmptyString(accountName)) {
|
|
86
|
+
return accountName;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const firstLineForCategory = transaction.transaction.lines?.[0];
|
|
90
|
+
if (firstLineForCategory?.type ===
|
|
91
|
+
'transaction_with_account_and_class_line' ||
|
|
92
|
+
firstLineForCategory?.type ===
|
|
93
|
+
'transaction_with_product_or_service_line' ||
|
|
94
|
+
firstLineForCategory?.type === 'journal_entry_transaction_line') {
|
|
95
|
+
const account = firstLineForCategory.account;
|
|
96
|
+
return account?.accountId ?? account?.qboId ?? account?.accountName;
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
case 'class': {
|
|
101
|
+
const localDataForClass = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
102
|
+
if (localDataForClass != null) {
|
|
103
|
+
const firstLineItemForClass = Object.values(localDataForClass.lineItemById)[0];
|
|
104
|
+
const classId = firstLineItemForClass?.class?.classId;
|
|
105
|
+
if (isNonEmptyString(classId)) {
|
|
106
|
+
return classId;
|
|
107
|
+
}
|
|
108
|
+
const qboId = firstLineItemForClass?.class?.qboId;
|
|
109
|
+
if (isNonEmptyString(qboId)) {
|
|
110
|
+
return qboId;
|
|
111
|
+
}
|
|
112
|
+
const className = firstLineItemForClass?.class?.className;
|
|
113
|
+
if (isNonEmptyString(className)) {
|
|
114
|
+
return className;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const firstLineForClass = transaction.transaction.lines?.[0];
|
|
118
|
+
if (firstLineForClass?.type === 'transaction_with_account_and_class_line' ||
|
|
119
|
+
firstLineForClass?.type ===
|
|
120
|
+
'transaction_with_product_or_service_line' ||
|
|
121
|
+
firstLineForClass?.type === 'journal_entry_transaction_line') {
|
|
122
|
+
const classData = firstLineForClass.class;
|
|
123
|
+
return classData?.classId ?? classData?.qboId ?? classData?.className;
|
|
124
|
+
}
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
default:
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* TC-only amount matcher. Supports all five operators TC defines, including
|
|
133
|
+
* the legacy "1000<->5000" range-string form (kept for backward compatibility
|
|
134
|
+
* with persisted filter state that may still contain that encoding).
|
|
135
|
+
*
|
|
136
|
+
* The `'equal' | 'not_equal'` branch matches if `amount` equals ANY of the
|
|
137
|
+
* configured values (consistent with how non-amount filters interpret a
|
|
138
|
+
* multi-value `values` array). `.some()` over the values array also makes
|
|
139
|
+
* the empty-values case behave correctly — empty array → `matched = false`
|
|
140
|
+
* — though in practice `applyTransactionFilters` strips empty-values
|
|
141
|
+
* categories before they reach this matcher. The trailing
|
|
142
|
+
* `op === 'not_equal' ? !matched : matched` line inverts for `not_equal`.
|
|
143
|
+
*/
|
|
144
|
+
const matchAmount = (amount, category) => {
|
|
145
|
+
const op = category.matchingOperator;
|
|
146
|
+
const values = category.values;
|
|
147
|
+
let matched = false;
|
|
148
|
+
if (op === 'in_between') {
|
|
149
|
+
if (values.length >= 2) {
|
|
150
|
+
const min = Number(values[0]);
|
|
151
|
+
const max = Number(values[1]);
|
|
152
|
+
matched = amount >= min && amount <= max;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (op === 'less_than') {
|
|
156
|
+
if (values.length >= 1) {
|
|
157
|
+
matched = amount < Number(values[0]);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else if (op === 'greater_than') {
|
|
161
|
+
if (values.length >= 1) {
|
|
162
|
+
matched = amount > Number(values[0]);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else if (op === 'equal' || op === 'not_equal') {
|
|
166
|
+
matched = values.some((v) => {
|
|
167
|
+
const s = String(v);
|
|
168
|
+
// Backward compatibility: legacy "low<->high" range-string form
|
|
169
|
+
// persisted under `matchingOperator: 'equal'`.
|
|
170
|
+
if (s.includes('<->')) {
|
|
171
|
+
const parts = s.split('<->');
|
|
172
|
+
return (amount >= Number(parts[0] ?? '') && amount <= Number(parts[1] ?? ''));
|
|
173
|
+
}
|
|
174
|
+
return amount === Number(v);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return op === 'not_equal' ? !matched : matched;
|
|
178
|
+
};
|
|
179
|
+
const transactionMatchesCategory = (transaction, category) => {
|
|
180
|
+
const value = getCategoryValueForTransaction(category.field, transaction);
|
|
181
|
+
if (value == null) {
|
|
182
|
+
// Absent values count as a match only under 'not_equal'.
|
|
183
|
+
return category.matchingOperator === 'not_equal';
|
|
184
|
+
}
|
|
185
|
+
if (category.field === 'amount') {
|
|
186
|
+
return matchAmount(Number(value), category);
|
|
187
|
+
}
|
|
188
|
+
const valueStr = value.toString();
|
|
189
|
+
const valueInList = category.values.some((v) => v.toString() === valueStr);
|
|
190
|
+
return category.matchingOperator === 'not_equal' ? !valueInList : valueInList;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* TC-only equivalent of `applyAdvancedFiltersOnList`. Filters a list of
|
|
194
|
+
* `TransactionView` items against a `TransactionFilters` object using the
|
|
195
|
+
* AND/OR combination semantics from `categoryCombinationOperator`.
|
|
196
|
+
*
|
|
197
|
+
* Independent of `view/spendManagement` — keeps the TC filter pipeline cleanly
|
|
198
|
+
* inside the Expense Automation feature group.
|
|
199
|
+
*/
|
|
200
|
+
const applyTransactionFilters = (transactions, filters) => {
|
|
201
|
+
if (filters?.categories == null || filters.categories.length === 0) {
|
|
202
|
+
return transactions;
|
|
203
|
+
}
|
|
204
|
+
// Mirrors the predicate used by `getTransactionAppliedFiltersCount` on the
|
|
205
|
+
// webc side. A half-filled category — e.g. `in_between` with only the
|
|
206
|
+
// `min` typed — would otherwise survive the filter pass and produce zero
|
|
207
|
+
// matches because `Number("")` collapses to `0`, artificially emptying
|
|
208
|
+
// the list while editing. Skipping such categories keeps the filtered
|
|
209
|
+
// view stable while the user finishes typing.
|
|
210
|
+
const activeCategories = filters.categories.filter((c) => {
|
|
211
|
+
if (c.field == null || c.values.length === 0) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
if (c.field === 'amount' && c.matchingOperator === 'in_between') {
|
|
215
|
+
return (c.values.length >= 2 &&
|
|
216
|
+
String(c.values[0] ?? '').trim() !== '' &&
|
|
217
|
+
String(c.values[1] ?? '').trim() !== '');
|
|
218
|
+
}
|
|
219
|
+
return String(c.values[0] ?? '').trim() !== '';
|
|
220
|
+
});
|
|
221
|
+
if (activeCategories.length === 0) {
|
|
222
|
+
return transactions;
|
|
223
|
+
}
|
|
224
|
+
const op = filters.categoryCombinationOperator;
|
|
225
|
+
return transactions.filter((txn) => {
|
|
226
|
+
if (op === 'AND') {
|
|
227
|
+
return activeCategories.every((cat) => transactionMatchesCategory(txn, cat));
|
|
228
|
+
}
|
|
229
|
+
return activeCategories.some((cat) => transactionMatchesCategory(txn, cat));
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
exports.applyTransactionFilters = applyTransactionFilters;
|
|
@@ -16,6 +16,7 @@ import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
|
16
16
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
17
17
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
18
18
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
19
|
+
import { TransactionFilters } from '../transactionFilterHelpers';
|
|
19
20
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
20
21
|
import { CompletedSubTab } from './completedSubTab';
|
|
21
22
|
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
@@ -93,6 +94,7 @@ export interface SupportedTransactionCategorization {
|
|
|
93
94
|
}
|
|
94
95
|
export declare const initialSupportedTransactionCategorization: SupportedTransactionCategorization;
|
|
95
96
|
export interface TransactionsTabViewState extends FetchedState {
|
|
97
|
+
filters: TransactionFilters;
|
|
96
98
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
97
99
|
refreshStatus: FetchStateAndError;
|
|
98
100
|
saveStatus: FetchStateAndError;
|
|
@@ -3,7 +3,6 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
4
|
import { fetchAccountList } from '../../../accountList/accountListReducer';
|
|
5
5
|
import { fetchClassList } from '../../../classList/classListReducer';
|
|
6
|
-
import { fetchScheduleActivityLog } from '../../../scheduleActivityLogView/scheduleActivityLogViewReducer';
|
|
7
6
|
import { fetchScheduleDetails, fetchScheduleDetailsPage } from '../scheduleDetailReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchScheduleDetailsPage>;
|
|
9
8
|
export declare const fetchScheduleDetailsPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const accountListReducer_1 = require("../../../accountList/accountListReducer");
|
|
7
7
|
const classListReducer_1 = require("../../../classList/classListReducer");
|
|
8
|
-
const scheduleActivityLogViewReducer_1 = require("../../../scheduleActivityLogView/scheduleActivityLogViewReducer");
|
|
9
8
|
const scheduleListHelper_1 = require("../../scheduleListView/scheduleListHelper");
|
|
10
9
|
const scheduleDetailReducer_1 = require("../scheduleDetailReducer");
|
|
11
10
|
const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.fetchScheduleDetailsPage.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -23,9 +22,6 @@ const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, ope
|
|
|
23
22
|
}
|
|
24
23
|
if (action.payload.selectedJeScheduleDetailId != null) {
|
|
25
24
|
scheduleDetailsActions.push((0, scheduleDetailReducer_1.fetchScheduleDetails)(action.payload.scheduleType, action.payload.selectedJeScheduleDetailId, action.payload.cacheOverride));
|
|
26
|
-
// Prefetch the schedule activity log alongside the detail page so the
|
|
27
|
-
// side panel renders instantly when the user taps the navbar icon.
|
|
28
|
-
scheduleDetailsActions.push((0, scheduleActivityLogViewReducer_1.fetchScheduleActivityLog)(action.payload.selectedJeScheduleDetailId));
|
|
29
25
|
}
|
|
30
26
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(scheduleDetailsActions));
|
|
31
27
|
}));
|
|
@@ -45,7 +45,7 @@ export interface BillPayFilters {
|
|
|
45
45
|
}
|
|
46
46
|
export interface BillPayFilterCategory {
|
|
47
47
|
field: BillListViewFilterCategoryField;
|
|
48
|
-
matchingOperator: 'equal' | '
|
|
48
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
49
49
|
values: (string | ZeniDate)[];
|
|
50
50
|
valuesCombinationOperator: 'ANY';
|
|
51
51
|
}
|
package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface PaymentHistoryFilters {
|
|
|
36
36
|
}
|
|
37
37
|
export interface PaymentHistoryFilterCategory {
|
|
38
38
|
field: PaymentHistoryFilterCategoryField;
|
|
39
|
-
matchingOperator: 'equal' | '
|
|
39
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
40
40
|
values: (string | ZeniDate)[];
|
|
41
41
|
valuesCombinationOperator: 'ANY';
|
|
42
42
|
}
|
|
@@ -46,7 +46,7 @@ export interface ReimbursementFilters {
|
|
|
46
46
|
}
|
|
47
47
|
export interface ReimbursementFilterCategory {
|
|
48
48
|
field: RemiListViewFilterCategoryField;
|
|
49
|
-
matchingOperator: 'equal' | '
|
|
49
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
50
50
|
values: (string | ZeniDate)[];
|
|
51
51
|
valuesCombinationOperator: 'ANY';
|
|
52
52
|
}
|
|
@@ -15,7 +15,7 @@ export type SpendManagementFilterEntityType = 'bill_pay' | 'reimbursement' | 'ta
|
|
|
15
15
|
export type FilterCategoryType = 'searchAutocomplete' | 'user' | 'dateRange' | 'numberRange' | 'dropdown';
|
|
16
16
|
export interface MatchingOperatorDropdownOption {
|
|
17
17
|
label: 'is' | 'is not';
|
|
18
|
-
value: 'equal' | '
|
|
18
|
+
value: 'equal' | 'not_equal';
|
|
19
19
|
}
|
|
20
20
|
export type CategoryCombinationOperator = 'AND' | 'OR';
|
|
21
21
|
export interface BillPayFilterCategoryDropdownOption {
|
|
@@ -14,6 +14,8 @@ const helpers_1 = require("./helpers");
|
|
|
14
14
|
const remiListSelector_1 = require("./reimbursement/remiListView/remiListSelector");
|
|
15
15
|
const remiListState_1 = require("./reimbursement/remiListView/remiListState");
|
|
16
16
|
//filters items against filter values representing a range. ex: date (from-to), amount(1k<-->5k)
|
|
17
|
+
// Spend Management uses only equal/not_equal — TC amount operators
|
|
18
|
+
// (inBetween, lessThan, greaterThan) live in the TC filter pipeline.
|
|
17
19
|
const filterItemOnRangeCategoryType = (valueForItem, currentFilter) => {
|
|
18
20
|
let doesItemFallInValueRange = false;
|
|
19
21
|
const filterField = currentFilter.field;
|
|
@@ -47,7 +49,7 @@ const filterItemOnCategoriesWithSingleValue = (categoryValue, currentFilter, ran
|
|
|
47
49
|
return filterItemOnRangeCategoryType(categoryValue, currentFilter);
|
|
48
50
|
}
|
|
49
51
|
// if filter category is not rangeType
|
|
50
|
-
if (currentFilter.matchingOperator === '
|
|
52
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
51
53
|
return currentFilter.values.indexOf(categoryValue.toString()) === -1;
|
|
52
54
|
}
|
|
53
55
|
return currentFilter.values.indexOf(categoryValue.toString()) > -1;
|
|
@@ -121,7 +123,7 @@ const applyAdvancedFiltersOnList = (entity, allItems, filters, filteredItems = [
|
|
|
121
123
|
? getCategoryValueForTaskList(key, item)
|
|
122
124
|
: getCategoryValueForPaymentHistory(key, item);
|
|
123
125
|
if (categoryValue == null) {
|
|
124
|
-
if (currentFilter.matchingOperator === '
|
|
126
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
125
127
|
return true;
|
|
126
128
|
}
|
|
127
129
|
return false;
|
|
@@ -217,7 +217,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
217
217
|
const key = currentFilter.field;
|
|
218
218
|
const categoryValue = getCategoryValueForCompany(key, company);
|
|
219
219
|
if (categoryValue == null) {
|
|
220
|
-
if (currentFilter.matchingOperator === '
|
|
220
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
221
221
|
return true;
|
|
222
222
|
}
|
|
223
223
|
return false;
|
|
@@ -44,7 +44,7 @@ export interface TaskListFilters {
|
|
|
44
44
|
}
|
|
45
45
|
export interface TaskFilterCategory {
|
|
46
46
|
field: TaskListFilterCategoryField;
|
|
47
|
-
matchingOperator: 'equal' | '
|
|
47
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
48
48
|
values: (string | ZeniDate)[];
|
|
49
49
|
valuesCombinationOperator: 'ANY';
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.69-
|
|
3
|
+
"version": "5.0.69-betaAR1",
|
|
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",
|