@zeniai/client-epic-state 5.0.71-betaVR3 → 5.0.72

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.
Files changed (138) hide show
  1. package/lib/coreEpics.js +1 -1
  2. package/lib/entity/account/accountSelector.d.ts +1 -1
  3. package/lib/entity/account/accountState.d.ts +1 -1
  4. package/lib/entity/account/subAccountSelector.d.ts +1 -1
  5. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
  6. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
  7. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
  8. package/lib/entity/chargeCard/chargeCardReducer.d.ts +2 -19
  9. package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
  10. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
  11. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
  12. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
  13. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  14. package/lib/entity/tenant/SessionManager.js +3 -6
  15. package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
  16. package/lib/entity/tenant/clearAllEpic.js +2 -2
  17. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
  18. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
  19. package/lib/entity/tenant/tenantReducer.js +1 -6
  20. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
  21. package/lib/epic.d.ts +10 -12
  22. package/lib/epic.js +11 -13
  23. package/lib/esm/coreEpics.js +1 -1
  24. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
  25. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
  26. package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
  27. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
  28. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  29. package/lib/esm/entity/tenant/SessionManager.js +1 -4
  30. package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
  31. package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
  32. package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
  33. package/lib/esm/entity/tenant/tenantReducer.js +1 -6
  34. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
  35. package/lib/esm/epic.js +11 -13
  36. package/lib/esm/index.js +15 -19
  37. package/lib/esm/reducer.js +2 -2
  38. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
  39. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
  40. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
  41. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  42. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
  43. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  44. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
  45. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +5 -21
  46. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
  47. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
  48. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +9 -13
  49. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
  50. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -81
  51. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -127
  52. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -2
  53. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
  54. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
  55. package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
  56. package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
  57. package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
  58. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
  59. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
  60. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
  61. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -26
  62. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
  63. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
  64. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  65. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
  66. package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
  67. package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
  68. package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
  69. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +1 -7
  70. package/lib/index.d.ts +16 -20
  71. package/lib/index.js +58 -75
  72. package/lib/reducer.d.ts +2 -2
  73. package/lib/reducer.js +2 -2
  74. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  75. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
  76. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
  77. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
  78. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
  79. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
  80. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
  81. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  82. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  83. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
  84. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +5 -21
  85. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
  86. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
  87. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +5 -11
  88. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +8 -12
  89. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
  90. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
  91. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  92. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
  93. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -15
  94. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +3 -83
  95. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -9
  96. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -128
  97. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -14
  98. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -14
  99. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -2
  100. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
  101. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -20
  102. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
  103. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -41
  104. package/lib/view/financeStatement/financeStatementSelector.js +1 -1
  105. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
  106. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
  107. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
  108. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
  109. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
  110. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
  111. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
  112. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
  113. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
  114. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -27
  115. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
  116. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
  117. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
  118. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  119. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
  120. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
  121. package/lib/view/transactionDetail/transactionDetailSelector.js +1 -7
  122. package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
  123. package/package.json +4 -9
  124. package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
  125. package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
  126. package/lib/commonStateTypes/pusherActions.d.ts +0 -11
  127. package/lib/commonStateTypes/pusherActions.js +0 -6
  128. package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
  129. package/lib/esm/commonStateTypes/pusherActions.js +0 -3
  130. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +0 -52
  131. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +0 -53
  132. package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
  133. package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.d.ts +0 -18
  134. package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +0 -56
  135. package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.d.ts +0 -28
  136. package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +0 -57
  137. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
  138. package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
@@ -4,9 +4,9 @@ import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePerio
4
4
  import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
5
5
  import { AccountBase } from '../../../entity/account/accountState';
6
6
  import { ClassBase } from '../../../entity/class/classState';
7
+ import { ProjectBase } from '../../../entity/project/projectState';
7
8
  import { CustomerBase } from '../../../entity/customer/customerState';
8
9
  import { Entity } from '../../../entity/genericEntity/entity';
9
- import { ProjectBase } from '../../../entity/project/projectState';
10
10
  import { RecommendationWithCOTByLineId, TransactionID } from '../../../entity/transaction/stateTypes/transaction';
11
11
  import { SupportedTransaction, SupportedTransactionPayload, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
12
12
  import { VendorBase } from '../../../entity/vendor/vendorState';
@@ -65,9 +65,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
65
65
  isUncategorizedExpenseCategoryEnabled: boolean | undefined;
66
66
  }, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
67
67
  newSelectedTab: "review" | "autoCategorized";
68
- }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "manual" | "ai_accountant"], {
69
- newSubTab: "all" | "manual" | "ai_accountant";
70
- }, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
68
+ }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
71
69
  selectedTab: "review" | "autoCategorized";
72
70
  fetchState: FetchState;
73
71
  error: ZeniAPIStatus<Record<string, unknown>> | undefined;
@@ -122,11 +120,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
122
120
  selectedPeriod: MonthYearPeriod;
123
121
  selectedTab: TransactionsTab;
124
122
  totalCount: number;
125
- }, "expenseAutomationTransactionsView/updateTotalCountForTransactionCategorization">, updateParentTotalCountForTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
126
- parentTotalCount: number;
127
- selectedPeriod: MonthYearPeriod;
128
- selectedTab: TransactionsTab;
129
- }, "expenseAutomationTransactionsView/updateParentTotalCountForTab">, fetchTransactionCategorizationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
123
+ }, "expenseAutomationTransactionsView/updateTotalCountForTransactionCategorization">, fetchTransactionCategorizationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
130
124
  selectedTab: TransactionsTab;
131
125
  status: ZeniAPIStatus;
132
126
  refreshViewInBackground?: boolean;
@@ -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.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.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',
@@ -49,74 +48,12 @@ exports.initialTransactionTabViewState = {
49
48
  selectedTransactionLineId: undefined,
50
49
  };
51
50
  exports.initialState = {
52
- autoCategorizedSubTabCache: {},
53
- parentTotalCountByTab: {
54
- review: {},
55
- autoCategorized: {},
56
- },
57
51
  selectedTransactionCategorizationTab: 'review',
58
- selectedTransactionCategorizationCompletedSubTab: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
59
52
  transactionCategorizationView: {
60
53
  review: { ...exports.initialTransactionTabViewState },
61
54
  autoCategorized: { ...exports.initialTransactionTabViewState },
62
55
  },
63
56
  };
64
- /**
65
- * Capture the autoCategorized tab's current paginated dataset for a sub-tab.
66
- * The mid-flight `'In-Progress'` state is normalised to `'Completed'` because
67
- * the in-flight request is cancelled by `switchMap` in the fetch epic when the
68
- * sub-tab changes — restoring `'In-Progress'` later would leave the UI stuck
69
- * showing a phantom loading state with no fetch actually running. Length-zero
70
- * datasets degrade to `'Not-Started'` so the next visit triggers a fresh
71
- * fetch from page 1 instead of short-circuiting on stale empty caches.
72
- *
73
- * Snapshot scope (deliberately narrow):
74
- * - Captured: `pageToken`, `totalCount`, `transactionIdsBySelectedPeriod`,
75
- * `fetchState`, `error`, `scrollPosition`. The first five are the keys the
76
- * fetch epic's cache check reads to decide whether to short-circuit a
77
- * sub-tab revisit; `scrollPosition` is captured per sub-tab so revisiting
78
- * restores the user's last offset and switching to a never-visited sub-tab
79
- * starts at the top instead of inheriting the outgoing sub-tab's offset
80
- * (which would land the user at a meaningless row index against a
81
- * completely different list).
82
- * - Intentionally NOT captured (left in place on `autoCat` and inherited by
83
- * the incoming sub-tab):
84
- * - `uiState.searchString`, `uiState.sortKey`, `uiState.sortOrder`,
85
- * `uiState.nodeCollapseState`, `uiState.limit` — search and sort are
86
- * user-applied preferences that persist across sub-tabs by design (a
87
- * search query stays active when the user toggles between Manual / AI
88
- * Accountant).
89
- * - `selectedCheckBoxTransactionIds` — selection state is intentionally
90
- * cleared at the action source (the fetch epic / save flow), not
91
- * by the snapshot path. Carrying selection across sub-tabs is safe
92
- * because every sub-tab change goes through a fetch round-trip that
93
- * reconciles selection against the new row IDs.
94
- * - `transactionReviewLocalDataById`, `transactionIdsWithUnsavedData`,
95
- * `uploadReceiptStatusById`, `saveStatus`, `refreshStatus`,
96
- * `markAsNotMiscategorizedStatus` — these are per-row / per-flight
97
- * caches that are write-through global state, not sub-tab-scoped.
98
- *
99
- * If the contract changes (e.g. selection should reset on every sub-tab
100
- * switch), update both this comment and the snapshot return shape together.
101
- */
102
- function snapshotAutoCategorizedTab(autoCat) {
103
- const transactionIdsBySelectedPeriod = {
104
- ...autoCat.transactionIdsBySelectedPeriod,
105
- };
106
- const hasAnyLoadedRows = Object.values(transactionIdsBySelectedPeriod).some((ids) => ids.length > 0);
107
- let normalisedFetchState = autoCat.fetchState;
108
- if (normalisedFetchState === 'In-Progress') {
109
- normalisedFetchState = hasAnyLoadedRows ? 'Completed' : 'Not-Started';
110
- }
111
- return {
112
- error: autoCat.error,
113
- fetchState: normalisedFetchState,
114
- pageToken: autoCat.uiState.pageToken,
115
- scrollPosition: autoCat.uiState.scrollPosition,
116
- totalCount: { ...autoCat.uiState.totalCount },
117
- transactionIdsBySelectedPeriod,
118
- };
119
- }
120
57
  const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
121
58
  name: 'expenseAutomationTransactionsView',
122
59
  initialState: exports.initialState,
@@ -330,55 +267,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
330
267
  return { payload: { newSelectedTab } };
331
268
  },
332
269
  },
333
- updateTransactionCategorizationCompletedSubTab: {
334
- reducer(draft, action) {
335
- const { newSubTab } = action.payload;
336
- const previousSubTab = draft.selectedTransactionCategorizationCompletedSubTab;
337
- if (previousSubTab === newSubTab) {
338
- return;
339
- }
340
- const autoCat = draft.transactionCategorizationView.autoCategorized;
341
- // Snapshot the outgoing sub-tab so a future revisit can short-circuit
342
- // the fetch epic (mirrors the parent-tab "don't refetch what's
343
- // already cached" behaviour). Period-scoped data is preserved as-is
344
- // because the snapshot itself is keyed only by sub-tab; the active
345
- // tab's per-period maps remain the source of truth while live.
346
- draft.autoCategorizedSubTabCache[previousSubTab] =
347
- snapshotAutoCategorizedTab(autoCat);
348
- const cached = draft.autoCategorizedSubTabCache[newSubTab];
349
- if (cached != null) {
350
- autoCat.uiState.pageToken = cached.pageToken;
351
- autoCat.uiState.totalCount = { ...cached.totalCount };
352
- autoCat.uiState.scrollPosition = cached.scrollPosition;
353
- autoCat.transactionIdsBySelectedPeriod = {
354
- ...cached.transactionIdsBySelectedPeriod,
355
- };
356
- autoCat.fetchState = cached.fetchState;
357
- autoCat.error = cached.error;
358
- }
359
- else {
360
- // Sub-tab has never been visited — clear the active slot so the
361
- // view-epic's `fetchState === 'Not-Started' || transactionIds.length
362
- // === 0` cache check falls through and triggers a fresh page-1
363
- // fetch for the new dataset. `scrollPosition` is reset to the top
364
- // so the incoming list isn't anchored to the outgoing sub-tab's
365
- // offset (different rows → previous offset is meaningless).
366
- autoCat.uiState.pageToken = null;
367
- autoCat.uiState.totalCount = {};
368
- autoCat.uiState.scrollPosition = {
369
- scrollTop: 0,
370
- scrollLeft: undefined,
371
- };
372
- autoCat.transactionIdsBySelectedPeriod = {};
373
- autoCat.fetchState = 'Not-Started';
374
- autoCat.error = undefined;
375
- }
376
- draft.selectedTransactionCategorizationCompletedSubTab = newSubTab;
377
- },
378
- prepare(newSubTab) {
379
- return { payload: { newSubTab } };
380
- },
381
- },
382
270
  updateTransactionCategorization: {
383
271
  reducer(draft, action) {
384
272
  const selectedTab = action.payload.selectedTab;
@@ -816,10 +704,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
816
704
  const { selectedTab, selectedPeriod, totalCount } = action.payload;
817
705
  draft.transactionCategorizationView[selectedTab].uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = totalCount;
818
706
  },
819
- updateParentTotalCountForTab(draft, action) {
820
- const { selectedTab, selectedPeriod, parentTotalCount } = action.payload;
821
- draft.parentTotalCountByTab[selectedTab][(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = parentTotalCount;
822
- },
823
707
  updateSelectedCheckboxTransactionIds(draft, action) {
824
708
  const selectedTab = action.payload.selectedTab;
825
709
  const transactionIds = action.payload.transactionIds;
@@ -830,16 +714,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
830
714
  draft.transactionCategorizationView[selectedTab] = {
831
715
  ...exports.initialTransactionTabViewState,
832
716
  };
833
- draft.parentTotalCountByTab[selectedTab] = {};
834
- // The per-sub-tab snapshot cache lives at the slice root and is
835
- // exclusively populated by the autoCategorized tab's sub-tab switching
836
- // (see updateTransactionCategorizationCompletedSubTab). When that tab
837
- // is reset, leaving stale snapshots behind would short-circuit the
838
- // next sub-tab visit with phantom row IDs / page tokens that no longer
839
- // correspond to anything in state — drop them in lockstep.
840
- if (selectedTab === 'autoCategorized') {
841
- draft.autoCategorizedSubTabCache = {};
842
- }
843
717
  },
844
718
  clearExpenseAutomationTransactionsView(draft) {
845
719
  Object.assign(draft, exports.initialState);
@@ -936,5 +810,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
936
810
  },
937
811
  },
938
812
  });
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;
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;
940
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/completedSubTab';
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;
@@ -29,12 +28,6 @@ export interface ResolvedBatchFile {
29
28
  export interface BulkUploadSelectorData {
30
29
  batchDetails: ResolvedBatchDetails | undefined;
31
30
  batchDetailsPaginationState: FetchStateAndError;
32
- /**
33
- * True while a stale-while-revalidate refresh of `batchDetailsById` is in flight (e.g. manual
34
- * refresh button). UI should keep rendering existing data and show only a lightweight refresh
35
- * indicator — never the full skeleton.
36
- */
37
- batchDetailsRevalidating: boolean;
38
31
  batchList: BatchListItem[];
39
32
  batchListFetchState: FetchStateAndError;
40
33
  batchStatus: BatchStatus | undefined;
@@ -43,12 +36,6 @@ export interface BulkUploadSelectorData {
43
36
  confirmMatchStatus: FetchStateAndError;
44
37
  currentResultsTab: BulkUploadResultsTab;
45
38
  hasMoreBatchDetails: boolean;
46
- /**
47
- * `true` once the first batch-details page has loaded for the current scope (period/tenant).
48
- * Stays `true` across refreshes — flips back to `false` only on `clearBulkUpload` or on an
49
- * explicit scope change. Used by the Unmatched tab to gate the initial-load skeleton.
50
- */
51
- initialBatchDetailsLoaded: boolean;
52
39
  manualSearch: ManualSearchState;
53
40
  /** Bumps when manual search state is cleared — remount manual search inputs. */
54
41
  manualSearchUiResetKey: number;
@@ -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;
@@ -22,23 +21,10 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
22
21
  fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
23
22
  isAccountingProjectsEnabled: boolean;
24
23
  markAsNotMiscategorizedStatus: FetchStateAndError;
25
- /**
26
- * Parent tab badge counts, sourced from the listing response's
27
- * `parent_tab_total_count`. Used exclusively to drive the navbar / tab
28
- * strip badge labels — every other count consumer (pagination, in-list
29
- * "showing X of Y", save flows) keeps reading {@link totalCountByTab}.
30
- */
31
- parentTabTotalCountByTab: Record<TransactionsTab, number>;
32
24
  projectList: ProjectListSelectorView;
33
25
  refreshStatus: FetchStateAndError;
34
26
  saveStatus: FetchStateAndError;
35
27
  selectedCheckBoxTransactionIds: ID[];
36
- selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
37
- /**
38
- * Per-(sub-)tab counts mirroring `total_count` from the listing response.
39
- * Powers pagination via `InfiniteLoader.itemCount`, in-list count copy,
40
- * and the `resetTransactionCategorizationLocalData` round-trip.
41
- */
42
28
  totalCountByTab: Record<TransactionsTab, number>;
43
29
  transactionIdsWithUnsavedData: ID[];
44
30
  transactionLocalData: TransactionReviewLocalDataSelectorView[];
@@ -230,8 +230,6 @@ function getExpenseAutomationMissingReceiptsView(state) {
230
230
  manualSearchUiResetKey: bulkUpload.manualSearchUiResetKey,
231
231
  hasMoreBatchDetails,
232
232
  batchDetailsPaginationState: bulkUpload.batchDetailsPaginationState,
233
- batchDetailsRevalidating: bulkUpload.batchDetailsRevalidating,
234
- initialBatchDetailsLoaded: bulkUpload.initialBatchDetailsLoaded,
235
233
  manualSearch: {
236
234
  ...bulkUpload.manualSearch,
237
235
  results: manualSearchResults,
@@ -16,7 +16,7 @@ const projectListSelector_1 = require("../../projectList/projectListSelector");
16
16
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
17
17
  function getExpenseAutomationTransactionView(state) {
18
18
  const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
19
- const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
19
+ const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
20
20
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
21
21
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
22
22
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
@@ -69,27 +69,10 @@ function getExpenseAutomationTransactionView(state) {
69
69
  .uiState.totalCount;
70
70
  const totalCountByAutoCat = expenseAutomationTransactionsViewState.transactionCategorizationView
71
71
  .autoCategorized.uiState.totalCount;
72
- // Per-(sub-)tab counts powering pagination, in-list "showing X of Y", and
73
- // any save/refresh round-trips. Sourced from `uiState.totalCount` which
74
- // mirrors the response's `total_count` for whatever tab/sub-tab the user is
75
- // viewing (e.g. only the Manual sub-tab rows for Completed → Manual).
76
72
  const totalCountByTab = {
77
73
  review: monthYearPeriodId != null ? totalCountByReview[monthYearPeriodId] : 0,
78
74
  autoCategorized: monthYearPeriodId != null ? totalCountByAutoCat[monthYearPeriodId] : 0,
79
75
  };
80
- // Parent-tab badge counts. Sourced from `parent_tab_total_count` in the
81
- // listing response and used exclusively by the navbar / tab strip badges.
82
- // Independent of which Completed sub-tab is active so the badge stays
83
- // stable across sub-tab switches.
84
- const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
85
- const parentTabTotalCountByTab = {
86
- review: monthYearPeriodId != null
87
- ? (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
88
- : 0,
89
- autoCategorized: monthYearPeriodId != null
90
- ? (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
91
- : 0,
92
- };
93
76
  const fetchStateByTab = {
94
77
  review: {
95
78
  fetchState: expenseAutomationTransactionsViewState.transactionCategorizationView
@@ -131,11 +114,9 @@ function getExpenseAutomationTransactionView(state) {
131
114
  markAsNotMiscategorizedStatus,
132
115
  completionStatus,
133
116
  totalCountByTab,
134
- parentTabTotalCountByTab,
135
117
  fetchStateByTransactionTabs: fetchStateByTab,
136
118
  uploadReceiptStatusById,
137
119
  selectedTransactionId,
138
120
  selectedTransactionLineId,
139
- selectedTransactionCategorizationCompletedSubTab,
140
121
  };
141
122
  }
@@ -1,7 +1,6 @@
1
1
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
2
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
- import { CompletedSubTab } from './completedSubTab';
5
4
  export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
6
5
  export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
7
6
  export interface MissingReceiptsViewUIState {
@@ -32,6 +31,8 @@ export declare const toBulkUploadResultsTab: (v: string) => "completed" | "unmat
32
31
  export type BulkUploadResultsTab = ReturnType<typeof toBulkUploadResultsTab>;
33
32
  export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatched" | "missing";
34
33
  export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
34
+ export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
35
+ export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
35
36
  export declare const toMatchSource: (v: string) => "manual" | "ai";
36
37
  export type MatchSource = ReturnType<typeof toMatchSource>;
37
38
  export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
@@ -129,13 +130,6 @@ export interface CompletedTransactionsState {
129
130
  export interface BulkUploadState {
130
131
  batchDetailsById: Record<ID, BatchDetails>;
131
132
  batchDetailsPaginationState: FetchStateAndError;
132
- /**
133
- * True while a stale-while-revalidate refresh of `batchDetailsById` is in flight (manual refresh
134
- * or scope-change replacement). Existing entries are kept on screen during this window; the UI
135
- * can surface a lightweight refresh indicator. Cleared on `fetchMoreBatchDetailsComplete` /
136
- * `fetchMoreBatchDetailsFailure`.
137
- */
138
- batchDetailsRevalidating: boolean;
139
133
  batchListByPeriod: Record<MonthYearPeriodId, BatchListItem[]>;
140
134
  batchListFetchState: FetchStateAndError;
141
135
  batchStatusById: Record<ID, BatchStatus>;
@@ -144,18 +138,6 @@ export interface BulkUploadState {
144
138
  confirmMatchStatus: FetchStateAndError;
145
139
  currentResultsTab: BulkUploadResultsTab;
146
140
  failedBatchDetailIds: ID[];
147
- /**
148
- * Set to `true` once the first batch-details page has resolved (success or empty completion).
149
- * Drives stale-while-revalidate: the Unmatched skeleton is shown only while this is `false`.
150
- * Reset only by `clearBulkUpload` or by an explicit scope-change (period/tenant) clear.
151
- */
152
- initialBatchDetailsLoaded: boolean;
153
- /**
154
- * Last time `GET /1.0/batches/:id` was issued for a given batch via the targeted refresh epic.
155
- * Used to throttle Pusher resend storms — repeat completion events for the same batchId within
156
- * the dedupe window are dropped.
157
- */
158
- lastBatchDetailRefreshAtById: Record<ID, number>;
159
141
  /**
160
142
  * Incremented when manual search Redux state is cleared so Unmatched `ManualSearchInput`
161
143
  * instances remount and drop local query text.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toBulkUploadSortKey = exports.toMatchSource = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
3
+ exports.toBulkUploadSortKey = exports.toMatchSource = exports.toCompletedSubTab = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
4
4
  exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
5
5
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
6
6
  const MISSING_RECEIPTS_SORT_KEYS = [
@@ -49,6 +49,9 @@ exports.toBulkUploadResultsTab = toBulkUploadResultsTab;
49
49
  const MISSING_RECEIPTS_TABS = ['missing', 'completed', 'unmatched'];
50
50
  const toMissingReceiptsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MISSING_RECEIPTS_TABS);
51
51
  exports.toMissingReceiptsTab = toMissingReceiptsTab;
52
+ const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
53
+ const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
54
+ exports.toCompletedSubTab = toCompletedSubTab;
52
55
  const MATCH_SOURCES = ['ai', 'manual'];
53
56
  const toMatchSource = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MATCH_SOURCES);
54
57
  exports.toMatchSource = toMatchSource;
@@ -1,5 +1,5 @@
1
1
  import { Amount } from '../../../commonStateTypes/amount';
2
- import { FetchState, FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
+ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
3
  import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
4
4
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
5
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
@@ -7,17 +7,15 @@ import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport
7
7
  import { AccountBase } from '../../../entity/account/accountState';
8
8
  import { ClassBase } from '../../../entity/class/classState';
9
9
  import { CustomerBase } from '../../../entity/customer/customerState';
10
- import { Entity, EntityType } from '../../../entity/genericEntity/entity';
11
10
  import { ProjectBase } from '../../../entity/project/projectState';
11
+ import { Entity, EntityType } from '../../../entity/genericEntity/entity';
12
12
  import { TransactionID } from '../../../entity/transaction/stateTypes/transaction';
13
13
  import { BillableStatus, CategorizationStatusType, PlatformLineDetailType, ProductOrService, TransactionLineBase } from '../../../entity/transaction/stateTypes/transactionLine';
14
14
  import { TransactionCategory, TransactionType } from '../../../entity/transaction/stateTypes/transactionType';
15
15
  import { VendorBase } from '../../../entity/vendor/vendorState';
16
- import { ZeniAPIStatus } from '../../../responsePayload';
17
16
  import { ZeniDate } from '../../../zeniDayJS';
18
17
  import { EntityRecommendationKey } from '../../recommendation/recommendationState';
19
18
  import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
20
- import { CompletedSubTab } from './completedSubTab';
21
19
  export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
22
20
  export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
23
21
  export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
@@ -105,44 +103,7 @@ export interface TransactionsTabViewState extends FetchedState {
105
103
  selectedTransactionId?: ID;
106
104
  selectedTransactionLineId?: ID;
107
105
  }
108
- /**
109
- * Snapshot of the autoCategorized tab's paginated dataset for a single
110
- * Completed sub-tab. Stored in {@link TransactionsViewState.autoCategorizedSubTabCache}
111
- * so revisiting an already-loaded sub-tab can short-circuit the fetch epic
112
- * (mirrors parent-tab caching). The snapshot is period-spanning — both the
113
- * `totalCount` map and `transactionIdsBySelectedPeriod` map preserve every
114
- * period the user has paged through under that sub-tab.
115
- *
116
- * `scrollPosition` is captured per sub-tab so revisiting a sub-tab restores
117
- * the user's last scroll offset; switching to a fresh / never-visited sub-tab
118
- * starts at the top instead of inheriting the previous sub-tab's offset.
119
- */
120
- export interface AutoCategorizedSubTabSnapshot {
121
- error: ZeniAPIStatus | undefined;
122
- fetchState: FetchState;
123
- pageToken: PageToken;
124
- scrollPosition: TransactionsViewUIState['scrollPosition'];
125
- totalCount: Record<MonthYearPeriodId, number>;
126
- transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
127
- }
128
106
  export type TransactionsViewState = {
129
- /**
130
- * Per-sub-tab snapshot cache for the Completed (autoCategorized) tab. Keyed
131
- * by {@link CompletedSubTab}. Populated as the user navigates between
132
- * sub-tabs and consulted on every switch — the active autoCategorized slot
133
- * is restored from here when a snapshot exists, otherwise it is reset and
134
- * the fetch epic loads page 1 fresh.
135
- */
136
- autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
137
- /**
138
- * Period-keyed parent tab counts, scoped per {@link TransactionsTab}.
139
- * Sourced from the listing response's `parent_tab_total_count` and used
140
- * exclusively to drive the parent tab badges on the UI — every other
141
- * count consumer (pagination, sub-tab chips, in-tab "showing X of Y")
142
- * keeps reading from {@link TransactionsViewUIState.totalCount}.
143
- */
144
- parentTotalCountByTab: Record<TransactionsTab, Record<MonthYearPeriodId, number>>;
145
- selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
146
107
  selectedTransactionCategorizationTab: TransactionsTab;
147
108
  transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
148
109
  };
@@ -5,7 +5,6 @@ const toolkit_1 = require("@reduxjs/toolkit");
5
5
  const coaBalanceType_1 = require("../../commonStateTypes/coaBalance/coaBalanceType");
6
6
  const coaBalancesFilter_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilter");
7
7
  const coaBalancesFilterClassesView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterClassesView");
8
- const coaBalancesFilterProjectView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterProjectView");
9
8
  const dataAvailable_1 = require("../../commonStateTypes/dataAvailable");
10
9
  const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
11
10
  const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
@@ -13,6 +12,7 @@ const thisPeriodHelpers_1 = require("../../commonStateTypes/viewAndReport/thisPe
13
12
  const balanceSheetSelector_1 = require("../balanceSheet/balanceSheetSelector");
14
13
  const cashFlowSelector_1 = require("../cashFlow/cashFlowSelector");
15
14
  const profitAndLossSelector_1 = require("../profitAndLoss/profitAndLossSelector");
15
+ const coaBalancesFilterProjectView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterProjectView");
16
16
  const profitAndLossClassesByClassHorizontalSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector");
17
17
  const profitAndLossClassesViewSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesViewSelector");
18
18
  const profitAndLossProjectViewSelector_1 = require("../profitAndLossProjectView/profitAndLossProjectViewSelector");
@@ -1,10 +1,10 @@
1
+ import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
1
2
  import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
2
3
  import { ID } from '../../commonStateTypes/common';
3
4
  import { DataAvailable } from '../../commonStateTypes/dataAvailable';
4
5
  import { CalculatedSection } from '../../commonStateTypes/selectorTypes/selectorTypes';
5
6
  import { SelectorReport } from '../../commonStateTypes/viewAndReport/viewAndReport';
6
7
  import { Project } from '../../entity/project/projectState';
7
- import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
8
8
  import { PandLReportViewCalculatedSectionID, PandLReportViewSectionID } from '../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
9
9
  import { ProfitAndLossProjectViewUIState } from './profitAndLossProjectViewState';
10
10
  export interface ProfitAndLossProjectViewReport extends SelectorReport {
@@ -2,9 +2,7 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ChargeCardCashbackPayload } from './cashbackDetailPayload';
3
3
  import { CashbackDetailState, CashbackDetailUIState } from './cashbackDetailState';
4
4
  export declare const initialState: CashbackDetailState;
5
- export declare const fetchCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
6
- cacheOverride: boolean;
7
- }, "cashbackDetail/fetchCashbackDetail", never, never>, updateCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardCashbackPayload, "cashbackDetail/updateCashbackDetail">, updateCashbackDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cashbackDetail/updateCashbackDetailFailure">, updateCashbackDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
5
+ export declare const fetchCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashbackDetail/fetchCashbackDetail">, updateCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardCashbackPayload, "cashbackDetail/updateCashbackDetail">, updateCashbackDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cashbackDetail/updateCashbackDetailFailure">, updateCashbackDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
6
  uiState: Partial<CashbackDetailUIState>;
9
7
  }, "cashbackDetail/updateCashbackDetailUIState">, clearCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashbackDetail/clearCashbackDetail">;
10
8
  declare const _default: import("redux").Reducer<CashbackDetailState>;
@@ -5,7 +5,6 @@ exports.clearCashbackDetail = exports.updateCashbackDetailUIState = exports.upda
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const viewAndReportPayloadv2_1 = require("../../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
7
7
  const amount_1 = require("../../../../commonStateTypes/amount");
8
- const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
9
8
  const cashbackDetailState_1 = require("./cashbackDetailState");
10
9
  exports.initialState = {
11
10
  fetchState: 'Not-Started',
@@ -32,10 +31,10 @@ const cashbackDetail = (0, toolkit_1.createSlice)({
32
31
  name: 'cashbackDetail',
33
32
  initialState: exports.initialState,
34
33
  reducers: {
35
- fetchCashbackDetail: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
34
+ fetchCashbackDetail(draft) {
36
35
  draft.fetchState = 'In-Progress';
37
36
  draft.error = undefined;
38
- }),
37
+ },
39
38
  updateCashbackDetail(draft, action) {
40
39
  draft.cashbackByPeriod = toCashbackByPeriod(action.payload);
41
40
  draft.cashbackSummary = toCashbackSummary(action.payload);
@@ -2,8 +2,6 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ChargeCardConfigPayload } from './chargeCardConfigPayload';
3
3
  import { ChargeCardConfigState } from './chargeCardConfigState';
4
4
  export declare const initialState: ChargeCardConfigState;
5
- export declare const fetchChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
6
- cacheOverride: boolean;
7
- }, "chargeCardConfig/fetchChargeCardConfig", never, never>, updateChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardConfigPayload, "chargeCardConfig/updateChargeCardConfig">, updateChargeCardConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardConfig/updateChargeCardConfigFailure">, clearChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/clearChargeCardConfig">;
5
+ export declare const fetchChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/fetchChargeCardConfig">, updateChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardConfigPayload, "chargeCardConfig/updateChargeCardConfig">, updateChargeCardConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardConfig/updateChargeCardConfigFailure">, clearChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/clearChargeCardConfig">;
8
6
  declare const _default: import("redux").Reducer<ChargeCardConfigState>;
9
7
  export default _default;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.clearChargeCardConfig = exports.updateChargeCardConfigFailure = exports.updateChargeCardConfig = exports.fetchChargeCardConfig = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
- const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
8
7
  const chargeCard_1 = require("../../../../entity/chargeCard/chargeCard");
9
8
  const chargeCardConfigPayload_1 = require("./chargeCardConfigPayload");
10
9
  exports.initialState = {
@@ -35,10 +34,10 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
35
34
  name: 'chargeCardConfig',
36
35
  initialState: exports.initialState,
37
36
  reducers: {
38
- fetchChargeCardConfig: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
37
+ fetchChargeCardConfig(draft) {
39
38
  draft.fetchState = 'In-Progress';
40
39
  draft.error = undefined;
41
- }),
40
+ },
42
41
  updateChargeCardConfig(draft, action) {
43
42
  const { payload } = action;
44
43
  draft.creditLimitFrequency =