@zeniai/client-epic-state 5.0.77 → 5.0.78
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/coreEpics.js +1 -1
- package/lib/entity/account/accountSelector.d.ts +1 -27
- package/lib/entity/account/accountSelector.js +1 -47
- package/lib/entity/account/accountState.d.ts +1 -6
- package/lib/entity/account/accountState.js +4 -11
- package/lib/entity/account/subAccountSelector.d.ts +1 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCardReducer.d.ts +2 -19
- package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
- package/lib/entity/class/classSelector.d.ts +0 -35
- package/lib/entity/class/classSelector.js +0 -50
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/entity/tenant/SessionManager.js +3 -6
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.js +2 -2
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
- package/lib/entity/tenant/tenantReducer.js +1 -6
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
- package/lib/epic.d.ts +10 -11
- package/lib/epic.js +11 -12
- package/lib/esm/coreEpics.js +1 -1
- package/lib/esm/entity/account/accountSelector.js +1 -46
- package/lib/esm/entity/account/accountState.js +1 -7
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
- package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
- package/lib/esm/entity/class/classSelector.js +0 -48
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/esm/entity/tenant/SessionManager.js +1 -4
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
- package/lib/esm/entity/tenant/tenantReducer.js +1 -6
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
- package/lib/esm/epic.js +11 -12
- package/lib/esm/index.js +20 -30
- package/lib/esm/reducer.js +2 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.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/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -21
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -253
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -147
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/esm/view/recommendation/recommendationHelper.js +0 -29
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -26
- package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -26
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +2 -4
- package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +6 -121
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +1 -29
- package/lib/index.d.ts +23 -30
- package/lib/index.js +58 -84
- package/lib/reducer.d.ts +2 -2
- package/lib/reducer.js +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.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/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -23
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -28
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -253
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -16
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -7
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -150
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -44
- package/lib/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
- package/lib/view/recommendation/recommendationHelper.d.ts +0 -9
- package/lib/view/recommendation/recommendationHelper.js +1 -31
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -20
- package/lib/view/recommendation/recommendationReducer.js +2 -27
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -27
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +3 -12
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +2 -4
- 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/lib/view/transactionDetail/transactionDetailReducer.d.ts +1 -11
- package/lib/view/transactionDetail/transactionDetailReducer.js +7 -122
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -2
- package/lib/view/transactionDetail/transactionDetailSelector.js +2 -31
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -1
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
- package/package.json +4 -9
- package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
- package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
- package/lib/commonStateTypes/filterPrimitives.d.ts +0 -23
- package/lib/commonStateTypes/filterPrimitives.js +0 -21
- package/lib/commonStateTypes/pusherActions.d.ts +0 -11
- package/lib/commonStateTypes/pusherActions.js +0 -6
- package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
- package/lib/esm/commonStateTypes/filterPrimitives.js +0 -20
- package/lib/esm/commonStateTypes/pusherActions.js +0 -3
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +0 -258
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
- package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -87
- package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +0 -66
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +0 -262
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +0 -9
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -91
|
@@ -4,14 +4,13 @@ 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.
|
|
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.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = 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"));
|
|
11
11
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
12
12
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
13
13
|
const transactionCategorizationLocalDataHelper_1 = require("../helpers/transactionCategorizationLocalDataHelper");
|
|
14
|
-
const completedSubTab_1 = require("../types/completedSubTab");
|
|
15
14
|
exports.initialTransactionTabViewState = {
|
|
16
15
|
saveStatus: {
|
|
17
16
|
fetchState: 'Not-Started',
|
|
@@ -35,10 +34,6 @@ exports.initialTransactionTabViewState = {
|
|
|
35
34
|
totalCount: {},
|
|
36
35
|
limit: 10,
|
|
37
36
|
},
|
|
38
|
-
filters: {
|
|
39
|
-
categoryCombinationOperator: 'AND',
|
|
40
|
-
categories: [],
|
|
41
|
-
},
|
|
42
37
|
fetchState: 'Not-Started',
|
|
43
38
|
error: undefined,
|
|
44
39
|
hasValidState() {
|
|
@@ -53,74 +48,12 @@ exports.initialTransactionTabViewState = {
|
|
|
53
48
|
selectedTransactionLineId: undefined,
|
|
54
49
|
};
|
|
55
50
|
exports.initialState = {
|
|
56
|
-
autoCategorizedSubTabCache: {},
|
|
57
|
-
parentTotalCountByTab: {
|
|
58
|
-
review: {},
|
|
59
|
-
autoCategorized: {},
|
|
60
|
-
},
|
|
61
51
|
selectedTransactionCategorizationTab: 'review',
|
|
62
|
-
selectedTransactionCategorizationCompletedSubTab: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
|
|
63
52
|
transactionCategorizationView: {
|
|
64
53
|
review: { ...exports.initialTransactionTabViewState },
|
|
65
54
|
autoCategorized: { ...exports.initialTransactionTabViewState },
|
|
66
55
|
},
|
|
67
56
|
};
|
|
68
|
-
/**
|
|
69
|
-
* Capture the autoCategorized tab's current paginated dataset for a sub-tab.
|
|
70
|
-
* The mid-flight `'In-Progress'` state is normalised to `'Completed'` because
|
|
71
|
-
* the in-flight request is cancelled by `switchMap` in the fetch epic when the
|
|
72
|
-
* sub-tab changes — restoring `'In-Progress'` later would leave the UI stuck
|
|
73
|
-
* showing a phantom loading state with no fetch actually running. Length-zero
|
|
74
|
-
* datasets degrade to `'Not-Started'` so the next visit triggers a fresh
|
|
75
|
-
* fetch from page 1 instead of short-circuiting on stale empty caches.
|
|
76
|
-
*
|
|
77
|
-
* Snapshot scope (deliberately narrow):
|
|
78
|
-
* - Captured: `pageToken`, `totalCount`, `transactionIdsBySelectedPeriod`,
|
|
79
|
-
* `fetchState`, `error`, `scrollPosition`. The first five are the keys the
|
|
80
|
-
* fetch epic's cache check reads to decide whether to short-circuit a
|
|
81
|
-
* sub-tab revisit; `scrollPosition` is captured per sub-tab so revisiting
|
|
82
|
-
* restores the user's last offset and switching to a never-visited sub-tab
|
|
83
|
-
* starts at the top instead of inheriting the outgoing sub-tab's offset
|
|
84
|
-
* (which would land the user at a meaningless row index against a
|
|
85
|
-
* completely different list).
|
|
86
|
-
* - Intentionally NOT captured (left in place on `autoCat` and inherited by
|
|
87
|
-
* the incoming sub-tab):
|
|
88
|
-
* - `uiState.searchString`, `uiState.sortKey`, `uiState.sortOrder`,
|
|
89
|
-
* `uiState.nodeCollapseState`, `uiState.limit` — search and sort are
|
|
90
|
-
* user-applied preferences that persist across sub-tabs by design (a
|
|
91
|
-
* search query stays active when the user toggles between Manual / AI
|
|
92
|
-
* Accountant).
|
|
93
|
-
* - `selectedCheckBoxTransactionIds` — selection state is intentionally
|
|
94
|
-
* cleared at the action source (the fetch epic / save flow), not
|
|
95
|
-
* by the snapshot path. Carrying selection across sub-tabs is safe
|
|
96
|
-
* because every sub-tab change goes through a fetch round-trip that
|
|
97
|
-
* reconciles selection against the new row IDs.
|
|
98
|
-
* - `transactionReviewLocalDataById`, `transactionIdsWithUnsavedData`,
|
|
99
|
-
* `uploadReceiptStatusById`, `saveStatus`, `refreshStatus`,
|
|
100
|
-
* `markAsNotMiscategorizedStatus` — these are per-row / per-flight
|
|
101
|
-
* caches that are write-through global state, not sub-tab-scoped.
|
|
102
|
-
*
|
|
103
|
-
* If the contract changes (e.g. selection should reset on every sub-tab
|
|
104
|
-
* switch), update both this comment and the snapshot return shape together.
|
|
105
|
-
*/
|
|
106
|
-
function snapshotAutoCategorizedTab(autoCat) {
|
|
107
|
-
const transactionIdsBySelectedPeriod = {
|
|
108
|
-
...autoCat.transactionIdsBySelectedPeriod,
|
|
109
|
-
};
|
|
110
|
-
const hasAnyLoadedRows = Object.values(transactionIdsBySelectedPeriod).some((ids) => ids.length > 0);
|
|
111
|
-
let normalisedFetchState = autoCat.fetchState;
|
|
112
|
-
if (normalisedFetchState === 'In-Progress') {
|
|
113
|
-
normalisedFetchState = hasAnyLoadedRows ? 'Completed' : 'Not-Started';
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
error: autoCat.error,
|
|
117
|
-
fetchState: normalisedFetchState,
|
|
118
|
-
pageToken: autoCat.uiState.pageToken,
|
|
119
|
-
scrollPosition: autoCat.uiState.scrollPosition,
|
|
120
|
-
totalCount: { ...autoCat.uiState.totalCount },
|
|
121
|
-
transactionIdsBySelectedPeriod,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
57
|
const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
125
58
|
name: 'expenseAutomationTransactionsView',
|
|
126
59
|
initialState: exports.initialState,
|
|
@@ -310,12 +243,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
310
243
|
uiState.totalCount;
|
|
311
244
|
}
|
|
312
245
|
},
|
|
313
|
-
updateTransactionFilters(draft, action) {
|
|
314
|
-
const { selectedTab, filters } = action.payload;
|
|
315
|
-
// `filters` is non-nullable per the payload type, so no runtime
|
|
316
|
-
// null-check is needed — dropping it removes a dead defensive branch.
|
|
317
|
-
draft.transactionCategorizationView[selectedTab].filters = filters;
|
|
318
|
-
},
|
|
319
246
|
saveTransactionCategorization: {
|
|
320
247
|
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
|
321
248
|
return {
|
|
@@ -340,55 +267,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
340
267
|
return { payload: { newSelectedTab } };
|
|
341
268
|
},
|
|
342
269
|
},
|
|
343
|
-
updateTransactionCategorizationCompletedSubTab: {
|
|
344
|
-
reducer(draft, action) {
|
|
345
|
-
const { newSubTab } = action.payload;
|
|
346
|
-
const previousSubTab = draft.selectedTransactionCategorizationCompletedSubTab;
|
|
347
|
-
if (previousSubTab === newSubTab) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const autoCat = draft.transactionCategorizationView.autoCategorized;
|
|
351
|
-
// Snapshot the outgoing sub-tab so a future revisit can short-circuit
|
|
352
|
-
// the fetch epic (mirrors the parent-tab "don't refetch what's
|
|
353
|
-
// already cached" behaviour). Period-scoped data is preserved as-is
|
|
354
|
-
// because the snapshot itself is keyed only by sub-tab; the active
|
|
355
|
-
// tab's per-period maps remain the source of truth while live.
|
|
356
|
-
draft.autoCategorizedSubTabCache[previousSubTab] =
|
|
357
|
-
snapshotAutoCategorizedTab(autoCat);
|
|
358
|
-
const cached = draft.autoCategorizedSubTabCache[newSubTab];
|
|
359
|
-
if (cached != null) {
|
|
360
|
-
autoCat.uiState.pageToken = cached.pageToken;
|
|
361
|
-
autoCat.uiState.totalCount = { ...cached.totalCount };
|
|
362
|
-
autoCat.uiState.scrollPosition = cached.scrollPosition;
|
|
363
|
-
autoCat.transactionIdsBySelectedPeriod = {
|
|
364
|
-
...cached.transactionIdsBySelectedPeriod,
|
|
365
|
-
};
|
|
366
|
-
autoCat.fetchState = cached.fetchState;
|
|
367
|
-
autoCat.error = cached.error;
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
// Sub-tab has never been visited — clear the active slot so the
|
|
371
|
-
// view-epic's `fetchState === 'Not-Started' || transactionIds.length
|
|
372
|
-
// === 0` cache check falls through and triggers a fresh page-1
|
|
373
|
-
// fetch for the new dataset. `scrollPosition` is reset to the top
|
|
374
|
-
// so the incoming list isn't anchored to the outgoing sub-tab's
|
|
375
|
-
// offset (different rows → previous offset is meaningless).
|
|
376
|
-
autoCat.uiState.pageToken = null;
|
|
377
|
-
autoCat.uiState.totalCount = {};
|
|
378
|
-
autoCat.uiState.scrollPosition = {
|
|
379
|
-
scrollTop: 0,
|
|
380
|
-
scrollLeft: undefined,
|
|
381
|
-
};
|
|
382
|
-
autoCat.transactionIdsBySelectedPeriod = {};
|
|
383
|
-
autoCat.fetchState = 'Not-Started';
|
|
384
|
-
autoCat.error = undefined;
|
|
385
|
-
}
|
|
386
|
-
draft.selectedTransactionCategorizationCompletedSubTab = newSubTab;
|
|
387
|
-
},
|
|
388
|
-
prepare(newSubTab) {
|
|
389
|
-
return { payload: { newSubTab } };
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
270
|
updateTransactionCategorization: {
|
|
393
271
|
reducer(draft, action) {
|
|
394
272
|
const selectedTab = action.payload.selectedTab;
|
|
@@ -437,9 +315,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
437
315
|
const selectedCheckBoxTransactionIds = draft.transactionCategorizationView[selectedTab]
|
|
438
316
|
.selectedCheckBoxTransactionIds;
|
|
439
317
|
if (selectedTransaction != null &&
|
|
440
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
318
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
319
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
320
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
441
321
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
442
|
-
...
|
|
322
|
+
...draft.transactionCategorizationView[selectedTab]
|
|
323
|
+
.selectedCheckBoxTransactionIds,
|
|
443
324
|
transactionId,
|
|
444
325
|
];
|
|
445
326
|
}
|
|
@@ -522,26 +403,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
522
403
|
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
523
404
|
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
524
405
|
if (transactionLocalData != null) {
|
|
525
|
-
const newLocalData = (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled);
|
|
526
|
-
// Release the per-line fetch flag for every line this fetch
|
|
527
|
-
// covered. Done in-place on the freshly returned local data
|
|
528
|
-
// (the helper produces a new mutable object), before we write
|
|
529
|
-
// it back to the draft.
|
|
530
|
-
lineIds.forEach((lineId) => {
|
|
531
|
-
const lineItem = newLocalData.lineItemById[lineId];
|
|
532
|
-
if (lineItem != null) {
|
|
533
|
-
newLocalData.lineItemById[lineId] = {
|
|
534
|
-
...lineItem,
|
|
535
|
-
categoryClassRecommendationsFetchState: {
|
|
536
|
-
fetchState: 'Completed',
|
|
537
|
-
error: undefined,
|
|
538
|
-
},
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
406
|
draft.transactionCategorizationView[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
543
407
|
transactionId: transaction.id,
|
|
544
|
-
transactionReviewLocalData:
|
|
408
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationWithCOTByLineId, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled),
|
|
545
409
|
};
|
|
546
410
|
// Mark transaction as dirty (autofill happened)
|
|
547
411
|
if (!draft.transactionCategorizationView[selectedTab].transactionIdsWithUnsavedData.includes(transaction.id)) {
|
|
@@ -554,99 +418,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
554
418
|
}
|
|
555
419
|
},
|
|
556
420
|
},
|
|
557
|
-
// Start arm of the line-update recommendations fetch. Flips covered
|
|
558
|
-
// lines to In-Progress AND removes the transaction from
|
|
559
|
-
// selectedCheckBoxTransactionIds — the row is unchecked + disabled
|
|
560
|
-
// until either the success arm (recheck if limit allows) or the
|
|
561
|
-
// failure arm releases the per-line flag.
|
|
562
|
-
markCategoryClassRecommendationsInProgressForCategorization: {
|
|
563
|
-
reducer(draft, action) {
|
|
564
|
-
const { selectedTab, transactionId, lineIds } = action.payload;
|
|
565
|
-
const tab = draft.transactionCategorizationView[selectedTab];
|
|
566
|
-
const transactionLocalData = (0, get_1.default)(tab.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
567
|
-
if (transactionLocalData != null) {
|
|
568
|
-
lineIds.forEach((lineId) => {
|
|
569
|
-
const lineItem = transactionLocalData.transactionReviewLocalData.lineItemById[lineId];
|
|
570
|
-
if (lineItem != null) {
|
|
571
|
-
transactionLocalData.transactionReviewLocalData.lineItemById[lineId] = {
|
|
572
|
-
...lineItem,
|
|
573
|
-
categoryClassRecommendationsFetchState: {
|
|
574
|
-
fetchState: 'In-Progress',
|
|
575
|
-
error: undefined,
|
|
576
|
-
},
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
// Uncheck on fetch start: the row's existing category/class are
|
|
582
|
-
// stale after a payee change, so we drop the auto-selection until
|
|
583
|
-
// fresh recommendations land.
|
|
584
|
-
if (tab.selectedCheckBoxTransactionIds.includes(transactionId.id)) {
|
|
585
|
-
tab.selectedCheckBoxTransactionIds =
|
|
586
|
-
tab.selectedCheckBoxTransactionIds.filter((id) => id !== transactionId.id);
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
prepare(selectedTab, transactionId, lineIds) {
|
|
590
|
-
return { payload: { selectedTab, transactionId, lineIds } };
|
|
591
|
-
},
|
|
592
|
-
},
|
|
593
|
-
// Completed arm. Used by the epic when the HTTP call succeeds but the
|
|
594
|
-
// server returned no per-line recommendations — we still need to
|
|
595
|
-
// release the In-Progress flag so the skeleton resolves. Successful
|
|
596
|
-
// responses with recommendations go through
|
|
597
|
-
// setEntityRecommendationForLineIdsForCategorization instead (which
|
|
598
|
-
// also flips the lines to Completed).
|
|
599
|
-
markCategoryClassRecommendationsCompletedForCategorization: {
|
|
600
|
-
reducer(draft, action) {
|
|
601
|
-
const { selectedTab, transactionId, lineIds } = action.payload;
|
|
602
|
-
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
603
|
-
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
604
|
-
if (transactionLocalData != null) {
|
|
605
|
-
lineIds.forEach((lineId) => {
|
|
606
|
-
const lineItem = transactionLocalData.transactionReviewLocalData.lineItemById[lineId];
|
|
607
|
-
if (lineItem != null) {
|
|
608
|
-
transactionLocalData.transactionReviewLocalData.lineItemById[lineId] = {
|
|
609
|
-
...lineItem,
|
|
610
|
-
categoryClassRecommendationsFetchState: {
|
|
611
|
-
fetchState: 'Completed',
|
|
612
|
-
error: undefined,
|
|
613
|
-
},
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
},
|
|
619
|
-
prepare(selectedTab, transactionId, lineIds) {
|
|
620
|
-
return { payload: { selectedTab, transactionId, lineIds } };
|
|
621
|
-
},
|
|
622
|
-
},
|
|
623
|
-
// Failure arm. Flips covered lines to Error so the skeleton resolves
|
|
624
|
-
// and downstream UI can react to the failure. The transaction stays
|
|
625
|
-
// unchecked from the start-arm action.
|
|
626
|
-
markCategoryClassRecommendationsFailureForCategorization: {
|
|
627
|
-
reducer(draft, action) {
|
|
628
|
-
const { selectedTab, transactionId, lineIds, error } = action.payload;
|
|
629
|
-
const transactionLocalData = (0, get_1.default)(draft.transactionCategorizationView[selectedTab]
|
|
630
|
-
.transactionReviewLocalDataById, transactionId.id, undefined);
|
|
631
|
-
if (transactionLocalData != null) {
|
|
632
|
-
lineIds.forEach((lineId) => {
|
|
633
|
-
const lineItem = transactionLocalData.transactionReviewLocalData.lineItemById[lineId];
|
|
634
|
-
if (lineItem != null) {
|
|
635
|
-
transactionLocalData.transactionReviewLocalData.lineItemById[lineId] = {
|
|
636
|
-
...lineItem,
|
|
637
|
-
categoryClassRecommendationsFetchState: {
|
|
638
|
-
fetchState: 'Error',
|
|
639
|
-
error,
|
|
640
|
-
},
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
prepare(selectedTab, transactionId, lineIds, error) {
|
|
647
|
-
return { payload: { selectedTab, transactionId, lineIds, error } };
|
|
648
|
-
},
|
|
649
|
-
},
|
|
650
421
|
fetchTransactionCategorizationSuccess(draft, action) {
|
|
651
422
|
const { selectedTab, refreshViewInBackground } = action.payload;
|
|
652
423
|
if (draft.transactionCategorizationView[selectedTab].fetchState ===
|
|
@@ -742,7 +513,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
742
513
|
.selectedCheckBoxTransactionIds;
|
|
743
514
|
if (newTransactionLocalData.customer != null &&
|
|
744
515
|
newTransactionLocalData.customer.id != null &&
|
|
745
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
516
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
517
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
518
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
746
519
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
747
520
|
...selectedCheckBoxTransactionIds,
|
|
748
521
|
transactionId,
|
|
@@ -816,7 +589,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
816
589
|
.selectedCheckBoxTransactionIds;
|
|
817
590
|
if (newTransactionLocalData.vendor != null &&
|
|
818
591
|
newTransactionLocalData.vendor.id != null &&
|
|
819
|
-
(0, transactionCategorizationLocalDataHelper_1.
|
|
592
|
+
(0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData, uncategorizedAccounts, isUncategorizedExpenseCategoryEnabled, isAccountingClassesEnabled) === true && // check if all line items are filled
|
|
593
|
+
selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
|
|
594
|
+
selectedCheckBoxTransactionIds.includes(transactionId) === false) {
|
|
820
595
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds = [
|
|
821
596
|
...selectedCheckBoxTransactionIds,
|
|
822
597
|
transactionId,
|
|
@@ -929,10 +704,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
929
704
|
const { selectedTab, selectedPeriod, totalCount } = action.payload;
|
|
930
705
|
draft.transactionCategorizationView[selectedTab].uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = totalCount;
|
|
931
706
|
},
|
|
932
|
-
updateParentTotalCountForTab(draft, action) {
|
|
933
|
-
const { selectedTab, selectedPeriod, parentTotalCount } = action.payload;
|
|
934
|
-
draft.parentTotalCountByTab[selectedTab][(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = parentTotalCount;
|
|
935
|
-
},
|
|
936
707
|
updateSelectedCheckboxTransactionIds(draft, action) {
|
|
937
708
|
const selectedTab = action.payload.selectedTab;
|
|
938
709
|
const transactionIds = action.payload.transactionIds;
|
|
@@ -943,16 +714,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
943
714
|
draft.transactionCategorizationView[selectedTab] = {
|
|
944
715
|
...exports.initialTransactionTabViewState,
|
|
945
716
|
};
|
|
946
|
-
draft.parentTotalCountByTab[selectedTab] = {};
|
|
947
|
-
// The per-sub-tab snapshot cache lives at the slice root and is
|
|
948
|
-
// exclusively populated by the autoCategorized tab's sub-tab switching
|
|
949
|
-
// (see updateTransactionCategorizationCompletedSubTab). When that tab
|
|
950
|
-
// is reset, leaving stale snapshots behind would short-circuit the
|
|
951
|
-
// next sub-tab visit with phantom row IDs / page tokens that no longer
|
|
952
|
-
// correspond to anything in state — drop them in lockstep.
|
|
953
|
-
if (selectedTab === 'autoCategorized') {
|
|
954
|
-
draft.autoCategorizedSubTabCache = {};
|
|
955
|
-
}
|
|
956
717
|
},
|
|
957
718
|
clearExpenseAutomationTransactionsView(draft) {
|
|
958
719
|
Object.assign(draft, exports.initialState);
|
|
@@ -1049,5 +810,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
1049
810
|
},
|
|
1050
811
|
},
|
|
1051
812
|
});
|
|
1052
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.
|
|
813
|
+
_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.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.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;
|
|
1053
814
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -2,8 +2,7 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { SupportedTransaction } from '../../../entity/transaction/transactionState';
|
|
5
|
-
import type { CompletedSubTab } from '../types/
|
|
6
|
-
import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
5
|
+
import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, CompletedSubTab, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
7
6
|
export interface CompletedTransactionsSelectorData {
|
|
8
7
|
fetchState: FetchStateAndError;
|
|
9
8
|
nextPageToken: string | null;
|
|
@@ -7,7 +7,6 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
7
7
|
import { SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
8
8
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
9
9
|
import { ProjectListSelectorView } from '../../projectList/projectListSelector';
|
|
10
|
-
import { CompletedSubTab } from '../types/completedSubTab';
|
|
11
10
|
import { TransactionReviewLocalData, TransactionsTab, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
12
11
|
export interface TransactionReviewLocalDataSelectorView {
|
|
13
12
|
transactionId: ID;
|
|
@@ -20,27 +19,12 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
20
19
|
classList: ClassBase[];
|
|
21
20
|
completionStatus: CompletionStatusType;
|
|
22
21
|
fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
|
|
23
|
-
hasInFlightCategoryClassRecommendations: boolean;
|
|
24
|
-
inFlightCategoryClassRecommendationsByTransactionId: Record<ID, boolean>;
|
|
25
22
|
isAccountingProjectsEnabled: boolean;
|
|
26
23
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
27
|
-
/**
|
|
28
|
-
* Parent tab badge counts, sourced from the listing response's
|
|
29
|
-
* `parent_tab_total_count`. Used exclusively to drive the navbar / tab
|
|
30
|
-
* strip badge labels — every other count consumer (pagination, in-list
|
|
31
|
-
* "showing X of Y", save flows) keeps reading {@link totalCountByTab}.
|
|
32
|
-
*/
|
|
33
|
-
parentTabTotalCountByTab: Record<TransactionsTab, number>;
|
|
34
24
|
projectList: ProjectListSelectorView;
|
|
35
25
|
refreshStatus: FetchStateAndError;
|
|
36
26
|
saveStatus: FetchStateAndError;
|
|
37
27
|
selectedCheckBoxTransactionIds: ID[];
|
|
38
|
-
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
39
|
-
/**
|
|
40
|
-
* Per-(sub-)tab counts mirroring `total_count` from the listing response.
|
|
41
|
-
* Powers pagination via `InfiniteLoader.itemCount`, in-list count copy,
|
|
42
|
-
* and the `resetTransactionCategorizationLocalData` round-trip.
|
|
43
|
-
*/
|
|
44
28
|
totalCountByTab: Record<TransactionsTab, number>;
|
|
45
29
|
transactionIdsWithUnsavedData: ID[];
|
|
46
30
|
transactionLocalData: TransactionReviewLocalDataSelectorView[];
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { TransactionWithCOT } from '../../../entity/transaction/stateTypes/transaction';
|
|
3
1
|
import { RootState } from '../../../reducer';
|
|
4
|
-
import {
|
|
5
|
-
import { ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
6
|
-
export declare const getCategorizationInFlightRecommendationsByTransactionId: (state: RootState) => Record<ID, boolean>;
|
|
7
|
-
export declare const getCategorizationHasInFlightRecommendations: (state: RootState) => boolean;
|
|
8
|
-
export declare const toTransactionView: (transaction: TransactionWithCOT, transactionLocalData?: TransactionReviewLocalDataSelectorView) => TransactionView;
|
|
2
|
+
import { ExpenseAutomationTransactionViewSelector } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
9
3
|
export declare function getExpenseAutomationTransactionView(state: RootState): ExpenseAutomationTransactionViewSelector;
|