@zeniai/client-epic-state 5.0.75 → 5.0.76

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 (174) hide show
  1. package/lib/coreEpics.js +1 -1
  2. package/lib/entity/account/accountSelector.d.ts +1 -27
  3. package/lib/entity/account/accountSelector.js +1 -47
  4. package/lib/entity/account/accountState.d.ts +1 -6
  5. package/lib/entity/account/accountState.js +4 -11
  6. package/lib/entity/account/subAccountSelector.d.ts +1 -1
  7. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
  8. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
  9. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
  10. package/lib/entity/chargeCard/chargeCardReducer.d.ts +2 -19
  11. package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
  12. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
  13. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
  14. package/lib/entity/class/classSelector.d.ts +0 -35
  15. package/lib/entity/class/classSelector.js +0 -50
  16. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
  17. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  18. package/lib/entity/tenant/SessionManager.js +3 -6
  19. package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
  20. package/lib/entity/tenant/clearAllEpic.js +2 -2
  21. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
  22. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
  23. package/lib/entity/tenant/tenantReducer.js +1 -6
  24. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
  25. package/lib/epic.d.ts +10 -11
  26. package/lib/epic.js +11 -12
  27. package/lib/esm/coreEpics.js +1 -1
  28. package/lib/esm/entity/account/accountSelector.js +1 -46
  29. package/lib/esm/entity/account/accountState.js +1 -7
  30. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
  31. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
  32. package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
  33. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
  34. package/lib/esm/entity/class/classSelector.js +0 -48
  35. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  36. package/lib/esm/entity/tenant/SessionManager.js +1 -4
  37. package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
  38. package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
  39. package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
  40. package/lib/esm/entity/tenant/tenantReducer.js +1 -6
  41. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
  42. package/lib/esm/epic.js +11 -12
  43. package/lib/esm/index.js +20 -30
  44. package/lib/esm/reducer.js +2 -2
  45. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
  46. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
  47. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
  48. package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  49. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  50. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
  51. package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
  52. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
  53. package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  54. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  55. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
  56. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
  57. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
  58. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
  59. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -21
  60. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
  61. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -253
  62. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -147
  63. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
  64. package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
  65. package/lib/esm/view/recommendation/recommendationHelper.js +0 -29
  66. package/lib/esm/view/recommendation/recommendationReducer.js +1 -26
  67. package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
  68. package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
  69. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
  70. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
  71. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
  72. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -26
  73. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
  74. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
  75. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  76. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
  77. package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +2 -4
  78. package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
  79. package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
  80. package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
  81. package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
  82. package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
  83. package/lib/esm/view/transactionDetail/transactionDetailReducer.js +6 -121
  84. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +1 -29
  85. package/lib/index.d.ts +23 -30
  86. package/lib/index.js +58 -84
  87. package/lib/reducer.d.ts +2 -2
  88. package/lib/reducer.js +2 -2
  89. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
  90. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
  91. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
  92. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
  93. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
  94. package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  95. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
  96. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  97. package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
  98. package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
  99. package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  100. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  101. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  102. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
  103. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
  104. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
  105. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
  106. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
  107. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -2
  108. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -23
  109. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
  110. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
  111. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
  112. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -28
  113. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -253
  114. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
  115. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -16
  116. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -7
  117. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -150
  118. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
  119. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
  120. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -44
  121. package/lib/view/financeStatement/financeStatementSelector.js +1 -1
  122. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
  123. package/lib/view/recommendation/recommendationHelper.d.ts +0 -9
  124. package/lib/view/recommendation/recommendationHelper.js +1 -31
  125. package/lib/view/recommendation/recommendationReducer.d.ts +1 -20
  126. package/lib/view/recommendation/recommendationReducer.js +2 -27
  127. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  128. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
  129. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
  130. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
  131. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
  132. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
  133. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
  134. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
  135. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
  136. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -27
  137. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
  138. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
  139. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
  140. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
  141. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  142. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
  143. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
  144. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  145. package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +3 -12
  146. package/lib/view/spendManagement/spendManagementFilterHelpers.js +2 -4
  147. package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
  148. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
  149. package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
  150. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +1 -11
  151. package/lib/view/transactionDetail/transactionDetailReducer.js +7 -122
  152. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -2
  153. package/lib/view/transactionDetail/transactionDetailSelector.js +2 -31
  154. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -1
  155. package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
  156. package/package.json +4 -9
  157. package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
  158. package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
  159. package/lib/commonStateTypes/filterPrimitives.d.ts +0 -23
  160. package/lib/commonStateTypes/filterPrimitives.js +0 -21
  161. package/lib/commonStateTypes/pusherActions.d.ts +0 -11
  162. package/lib/commonStateTypes/pusherActions.js +0 -6
  163. package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
  164. package/lib/esm/commonStateTypes/filterPrimitives.js +0 -20
  165. package/lib/esm/commonStateTypes/pusherActions.js +0 -3
  166. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +0 -258
  167. package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
  168. package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -87
  169. package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +0 -66
  170. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +0 -262
  171. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
  172. package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
  173. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +0 -9
  174. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -91
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.setIsVendorUpdateAllChecked = exports.updateVendorBulkRecommendationsFetchStatus = exports.updateLatestSelectedEntity = exports.resetAllLineItemsToVendor = exports.updateVendorToAllLineItems = exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = exports.resetSelectedCustomer = exports.resetVendor = exports.updateSelectedCustomer = exports.updateSelectedVendor = exports.removeEntityRecommendationForLineIdForTransactionDetail = exports.markCategoryClassRecommendationsFailureForTransactionDetail = exports.markCategoryClassRecommendationsCompletedForTransactionDetail = exports.markCategoryClassRecommendationsInProgressForTransactionDetail = exports.setEntityRecommendationForLineIdsForTransactionDetail = exports.setAllLineItemsLocalDataIsUpdateAllChecked = exports.setAllLineItemsToCategoryClassInLocalData = exports.resetLineItemsCategoryClassInLocalData = exports.clearTransactionDetailLocalData = exports.saveTransactionDetailLocalData = exports.initializeTransactionDetailLocalData = exports.saveTransactionDetail = exports.updateTransactionStateIfUpdateActionNotAllowed = exports.updateStatusConsolidatedSaveTransactionDetail = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.deleteTransactionAttachmentSuccess = exports.deleteTransactionAttachmentFailure = exports.deleteTransactionAttachment = exports.markTransactionAsNotMiscategorized = exports.clearTransactionDetailSaveStatus = exports.updateTransactionDetailSaveStatus = exports.updateTransactionDetail = exports.uploadMissingAttachmentSuccess = exports.clearTransactionDetail = exports.removeTransactionDetail = exports.updateTransactionDetailFetchState = exports.fetchTransactionDetail = exports.downloadAccountingProviderAttachmentFailure = exports.downloadAccountingProviderAttachmentSuccess = exports.downloadAccountingProviderAttachment = exports.initialState = void 0;
7
+ exports.setIsVendorUpdateAllChecked = exports.updateVendorBulkRecommendationsFetchStatus = exports.updateLatestSelectedEntity = exports.resetAllLineItemsToVendor = exports.updateVendorToAllLineItems = exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = exports.resetSelectedCustomer = exports.resetVendor = exports.updateSelectedCustomer = exports.updateSelectedVendor = exports.removeEntityRecommendationForLineIdForTransactionDetail = exports.setEntityRecommendationForLineIdsForTransactionDetail = exports.setAllLineItemsLocalDataIsUpdateAllChecked = exports.setAllLineItemsToCategoryClassInLocalData = exports.resetLineItemsCategoryClassInLocalData = exports.clearTransactionDetailLocalData = exports.saveTransactionDetailLocalData = exports.initializeTransactionDetailLocalData = exports.saveTransactionDetail = exports.updateTransactionStateIfUpdateActionNotAllowed = exports.updateStatusConsolidatedSaveTransactionDetail = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.deleteTransactionAttachmentSuccess = exports.deleteTransactionAttachmentFailure = exports.deleteTransactionAttachment = exports.markTransactionAsNotMiscategorized = exports.clearTransactionDetailSaveStatus = exports.updateTransactionDetailSaveStatus = exports.updateTransactionDetail = exports.uploadMissingAttachmentSuccess = exports.clearTransactionDetail = exports.removeTransactionDetail = exports.updateTransactionDetailFetchState = exports.fetchTransactionDetail = exports.downloadAccountingProviderAttachmentFailure = exports.downloadAccountingProviderAttachmentSuccess = exports.downloadAccountingProviderAttachment = exports.initialState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const get_1 = __importDefault(require("lodash/get"));
10
10
  const entity_1 = require("../../entity/genericEntity/entity");
@@ -245,34 +245,12 @@ const transactionDetail = (0, toolkit_1.createSlice)({
245
245
  saveTransactionDetailLocalData(draft, action) {
246
246
  const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
247
247
  const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
248
- if (detail == null) {
249
- return;
248
+ if (detail != null) {
249
+ draft.transactionDetailById[key] = {
250
+ ...detail,
251
+ transactionDetailLocalData: action.payload.transactionLocalData,
252
+ };
250
253
  }
251
- const incoming = action.payload.transactionLocalData;
252
- const prevById = detail.transactionDetailLocalData.lineItemById;
253
- // Per-line `categoryClassRecommendationsFetchState` is owned by the
254
- // recommendation epic/reducers (markInProgress / markCompleted /
255
- // markFailure / setEntityRecommendationForLineIdsForTransactionDetail).
256
- // Callers that rebuild `transactionLocalData` from a UI snapshot will
257
- // typically have an out-of-date copy of this field (e.g. payee-change
258
- // captures the snapshot before the epic's start arm runs and would
259
- // otherwise clobber In-Progress back to undefined). Treat the field as
260
- // sticky: only let the caller override it when they explicitly set it.
261
- const mergedLineItemById = {};
262
- Object.entries(incoming.lineItemById ?? {}).forEach(([lineId, line]) => {
263
- mergedLineItemById[lineId] = {
264
- ...line,
265
- categoryClassRecommendationsFetchState: line.categoryClassRecommendationsFetchState ??
266
- prevById?.[lineId]?.categoryClassRecommendationsFetchState,
267
- };
268
- });
269
- draft.transactionDetailById[key] = {
270
- ...detail,
271
- transactionDetailLocalData: {
272
- ...incoming,
273
- lineItemById: mergedLineItemById,
274
- },
275
- };
276
254
  },
277
255
  saveTransactionDetail(draft, action) {
278
256
  const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
@@ -394,21 +372,6 @@ const transactionDetail = (0, toolkit_1.createSlice)({
394
372
  const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
395
373
  if (detail != null) {
396
374
  const newLocalData = (0, transactionDetailLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(transaction, detail.transactionDetailLocalData, action.payload.entity, lineIds, uncategorizedIncomeExpense, recommendationWithCOTByLineId);
397
- // Release the per-line fetch flag for every line this fetch
398
- // covered so the inline skeleton resolves and the page-level
399
- // Save button can re-enable.
400
- lineIds.forEach((lineId) => {
401
- const lineItem = newLocalData.lineItemById[lineId];
402
- if (lineItem != null) {
403
- newLocalData.lineItemById[lineId] = {
404
- ...lineItem,
405
- categoryClassRecommendationsFetchState: {
406
- fetchState: 'Completed',
407
- error: undefined,
408
- },
409
- };
410
- }
411
- });
412
375
  draft.transactionDetailById[key] = {
413
376
  ...detail,
414
377
  transactionDetailLocalData: newLocalData,
@@ -429,84 +392,6 @@ const transactionDetail = (0, toolkit_1.createSlice)({
429
392
  };
430
393
  },
431
394
  },
432
- // Start arm of the line-update recommendations fetch for the detail
433
- // page. Flips covered lines to In-Progress; detail page has no
434
- // checkbox, so no auto-uncheck side effect.
435
- markCategoryClassRecommendationsInProgressForTransactionDetail: {
436
- reducer(draft, action) {
437
- const { transactionId, lineIds } = action.payload;
438
- const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
439
- const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
440
- if (detail != null) {
441
- lineIds.forEach((lineId) => {
442
- const lineItem = detail.transactionDetailLocalData.lineItemById[lineId];
443
- if (lineItem != null) {
444
- detail.transactionDetailLocalData.lineItemById[lineId] = {
445
- ...lineItem,
446
- categoryClassRecommendationsFetchState: {
447
- fetchState: 'In-Progress',
448
- error: undefined,
449
- },
450
- };
451
- }
452
- });
453
- }
454
- },
455
- prepare(transactionId, lineIds) {
456
- return { payload: { transactionId, lineIds } };
457
- },
458
- },
459
- // Completed arm. Used when the HTTP call succeeded but the server
460
- // returned no per-line recommendations — still need to release the
461
- // In-Progress flag.
462
- markCategoryClassRecommendationsCompletedForTransactionDetail: {
463
- reducer(draft, action) {
464
- const { transactionId, lineIds } = action.payload;
465
- const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
466
- const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
467
- if (detail != null) {
468
- lineIds.forEach((lineId) => {
469
- const lineItem = detail.transactionDetailLocalData.lineItemById[lineId];
470
- if (lineItem != null) {
471
- detail.transactionDetailLocalData.lineItemById[lineId] = {
472
- ...lineItem,
473
- categoryClassRecommendationsFetchState: {
474
- fetchState: 'Completed',
475
- error: undefined,
476
- },
477
- };
478
- }
479
- });
480
- }
481
- },
482
- prepare(transactionId, lineIds) {
483
- return { payload: { transactionId, lineIds } };
484
- },
485
- },
486
- markCategoryClassRecommendationsFailureForTransactionDetail: {
487
- reducer(draft, action) {
488
- const { transactionId, lineIds, error } = action.payload;
489
- const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
490
- const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
491
- if (detail != null) {
492
- lineIds.forEach((lineId) => {
493
- const lineItem = detail.transactionDetailLocalData.lineItemById[lineId];
494
- if (lineItem != null) {
495
- detail.transactionDetailLocalData.lineItemById[lineId] = {
496
- ...lineItem,
497
- categoryClassRecommendationsFetchState: {
498
- fetchState: 'Error',
499
- error,
500
- },
501
- };
502
- }
503
- });
504
- }
505
- },
506
- prepare(transactionId, lineIds, error) {
507
- return { payload: { transactionId, lineIds, error } };
508
- },
509
- },
510
395
  removeEntityRecommendationForLineIdForTransactionDetail: {
511
396
  reducer(draft, action) {
512
397
  const { transaction, lineId } = action.payload;
@@ -778,7 +663,7 @@ const transactionDetail = (0, toolkit_1.createSlice)({
778
663
  },
779
664
  },
780
665
  });
781
- _a = transactionDetail.actions, exports.downloadAccountingProviderAttachment = _a.downloadAccountingProviderAttachment, exports.downloadAccountingProviderAttachmentSuccess = _a.downloadAccountingProviderAttachmentSuccess, exports.downloadAccountingProviderAttachmentFailure = _a.downloadAccountingProviderAttachmentFailure, exports.fetchTransactionDetail = _a.fetchTransactionDetail, exports.updateTransactionDetailFetchState = _a.updateTransactionDetailFetchState, exports.removeTransactionDetail = _a.removeTransactionDetail, exports.clearTransactionDetail = _a.clearTransactionDetail, exports.uploadMissingAttachmentSuccess = _a.uploadMissingAttachmentSuccess, exports.updateTransactionDetail = _a.updateTransactionDetail, exports.updateTransactionDetailSaveStatus = _a.updateTransactionDetailSaveStatus, exports.clearTransactionDetailSaveStatus = _a.clearTransactionDetailSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.deleteTransactionAttachment = _a.deleteTransactionAttachment, exports.deleteTransactionAttachmentFailure = _a.deleteTransactionAttachmentFailure, exports.deleteTransactionAttachmentSuccess = _a.deleteTransactionAttachmentSuccess, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateStatusConsolidatedSaveTransactionDetail = _a.updateStatusConsolidatedSaveTransactionDetail, exports.updateTransactionStateIfUpdateActionNotAllowed = _a.updateTransactionStateIfUpdateActionNotAllowed, exports.saveTransactionDetail = _a.saveTransactionDetail, exports.initializeTransactionDetailLocalData = _a.initializeTransactionDetailLocalData, exports.saveTransactionDetailLocalData = _a.saveTransactionDetailLocalData, exports.clearTransactionDetailLocalData = _a.clearTransactionDetailLocalData, exports.resetLineItemsCategoryClassInLocalData = _a.resetLineItemsCategoryClassInLocalData, exports.setAllLineItemsToCategoryClassInLocalData = _a.setAllLineItemsToCategoryClassInLocalData, exports.setAllLineItemsLocalDataIsUpdateAllChecked = _a.setAllLineItemsLocalDataIsUpdateAllChecked, exports.setEntityRecommendationForLineIdsForTransactionDetail = _a.setEntityRecommendationForLineIdsForTransactionDetail, exports.markCategoryClassRecommendationsInProgressForTransactionDetail = _a.markCategoryClassRecommendationsInProgressForTransactionDetail, exports.markCategoryClassRecommendationsCompletedForTransactionDetail = _a.markCategoryClassRecommendationsCompletedForTransactionDetail, exports.markCategoryClassRecommendationsFailureForTransactionDetail = _a.markCategoryClassRecommendationsFailureForTransactionDetail, exports.removeEntityRecommendationForLineIdForTransactionDetail = _a.removeEntityRecommendationForLineIdForTransactionDetail, exports.updateSelectedVendor = _a.updateSelectedVendor, exports.updateSelectedCustomer = _a.updateSelectedCustomer, exports.resetVendor = _a.resetVendor, exports.resetSelectedCustomer = _a.resetSelectedCustomer, exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = _a.updateLocalDataWithTransactionsUpdateWithVendorCheckbox, exports.updateVendorToAllLineItems = _a.updateVendorToAllLineItems, exports.resetAllLineItemsToVendor = _a.resetAllLineItemsToVendor, exports.updateLatestSelectedEntity = _a.updateLatestSelectedEntity, exports.updateVendorBulkRecommendationsFetchStatus = _a.updateVendorBulkRecommendationsFetchStatus, exports.setIsVendorUpdateAllChecked = _a.setIsVendorUpdateAllChecked;
666
+ _a = transactionDetail.actions, exports.downloadAccountingProviderAttachment = _a.downloadAccountingProviderAttachment, exports.downloadAccountingProviderAttachmentSuccess = _a.downloadAccountingProviderAttachmentSuccess, exports.downloadAccountingProviderAttachmentFailure = _a.downloadAccountingProviderAttachmentFailure, exports.fetchTransactionDetail = _a.fetchTransactionDetail, exports.updateTransactionDetailFetchState = _a.updateTransactionDetailFetchState, exports.removeTransactionDetail = _a.removeTransactionDetail, exports.clearTransactionDetail = _a.clearTransactionDetail, exports.uploadMissingAttachmentSuccess = _a.uploadMissingAttachmentSuccess, exports.updateTransactionDetail = _a.updateTransactionDetail, exports.updateTransactionDetailSaveStatus = _a.updateTransactionDetailSaveStatus, exports.clearTransactionDetailSaveStatus = _a.clearTransactionDetailSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.deleteTransactionAttachment = _a.deleteTransactionAttachment, exports.deleteTransactionAttachmentFailure = _a.deleteTransactionAttachmentFailure, exports.deleteTransactionAttachmentSuccess = _a.deleteTransactionAttachmentSuccess, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateStatusConsolidatedSaveTransactionDetail = _a.updateStatusConsolidatedSaveTransactionDetail, exports.updateTransactionStateIfUpdateActionNotAllowed = _a.updateTransactionStateIfUpdateActionNotAllowed, exports.saveTransactionDetail = _a.saveTransactionDetail, exports.initializeTransactionDetailLocalData = _a.initializeTransactionDetailLocalData, exports.saveTransactionDetailLocalData = _a.saveTransactionDetailLocalData, exports.clearTransactionDetailLocalData = _a.clearTransactionDetailLocalData, exports.resetLineItemsCategoryClassInLocalData = _a.resetLineItemsCategoryClassInLocalData, exports.setAllLineItemsToCategoryClassInLocalData = _a.setAllLineItemsToCategoryClassInLocalData, exports.setAllLineItemsLocalDataIsUpdateAllChecked = _a.setAllLineItemsLocalDataIsUpdateAllChecked, exports.setEntityRecommendationForLineIdsForTransactionDetail = _a.setEntityRecommendationForLineIdsForTransactionDetail, exports.removeEntityRecommendationForLineIdForTransactionDetail = _a.removeEntityRecommendationForLineIdForTransactionDetail, exports.updateSelectedVendor = _a.updateSelectedVendor, exports.updateSelectedCustomer = _a.updateSelectedCustomer, exports.resetVendor = _a.resetVendor, exports.resetSelectedCustomer = _a.resetSelectedCustomer, exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = _a.updateLocalDataWithTransactionsUpdateWithVendorCheckbox, exports.updateVendorToAllLineItems = _a.updateVendorToAllLineItems, exports.resetAllLineItemsToVendor = _a.resetAllLineItemsToVendor, exports.updateLatestSelectedEntity = _a.updateLatestSelectedEntity, exports.updateVendorBulkRecommendationsFetchStatus = _a.updateVendorBulkRecommendationsFetchStatus, exports.setIsVendorUpdateAllChecked = _a.setIsVendorUpdateAllChecked;
782
667
  exports.default = transactionDetail.reducer;
783
668
  function getUpdatedEntityLocalData(detail, updates, entity, resetRecommendations, type) {
784
669
  const key = type === 'customer' ? 'customerUpdates' : 'vendorUpdates';
@@ -18,7 +18,6 @@ export interface TransactionDetailReport extends SelectorView {
18
18
  classHierarchyList: NestedClassHierarchyForReport[];
19
19
  classList: ClassListSelectorView;
20
20
  deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
21
- hasInFlightCategoryClassRecommendations: boolean;
22
21
  isAccountingClassesEnabled: boolean;
23
22
  isAccountingProjectsEnabled: boolean;
24
23
  linkedTransactions: SupportedTransactionWithCOT[];
@@ -31,7 +30,6 @@ export interface TransactionDetailReport extends SelectorView {
31
30
  export interface VendorDetailsView extends SelectorView {
32
31
  vendors: Vendor[];
33
32
  }
34
- export declare const getDetailInFlightRecommendations: (state: RootState, transactionId: TransactionID) => boolean;
35
33
  export declare const getTransactionDetail: (state: RootState, transactionId: TransactionID, fetchLinkedTransactions?: boolean) => TransactionDetailReport;
36
34
  export declare function getTransactionDetailForTransaction(rootState: RootState, transactionId: TransactionID): TransactionDetailReport | undefined;
37
35
  export declare const getInitialUpdatablePeriodsForTransactionRecommendations: (companyIncorporationDate?: ZeniDate, bookCloseDate?: ZeniDate) => {
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getInitialUpdatablePeriodsForTransactionRecommendations = exports.getTransactionDetail = exports.getDetailInFlightRecommendations = void 0;
6
+ exports.getInitialUpdatablePeriodsForTransactionRecommendations = exports.getTransactionDetail = void 0;
7
7
  exports.getTransactionDetailForTransaction = getTransactionDetailForTransaction;
8
8
  const get_1 = __importDefault(require("lodash/get"));
9
9
  const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
@@ -17,27 +17,6 @@ const accountListSelector_1 = require("../accountList/accountListSelector");
17
17
  const classListSelector_1 = require("../classList/classListSelector");
18
18
  const projectListSelector_1 = require("../projectList/projectListSelector");
19
19
  const transactionDetailState_1 = require("./transactionDetailState");
20
- // "Any line on this transaction is fetching category/class recommendations?"
21
- // Inlined as a plain function because the upstream selector
22
- // `getTransactionDetail` is also un-memoized and the iteration is O(lines)
23
- // — typically <10. Exported standalone so consumers that only need the
24
- // flag (e.g. footer save-disable) can avoid materializing the whole
25
- // detail report.
26
- const getDetailInFlightRecommendations = (state, transactionId) => {
27
- const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
28
- const detail = (0, get_1.default)(state.transactionDetailState.transactionDetailById, detailKey, undefined);
29
- if (detail == null) {
30
- return false;
31
- }
32
- for (const lineItem of Object.values(detail.transactionDetailLocalData.lineItemById)) {
33
- if (lineItem.categoryClassRecommendationsFetchState?.fetchState ===
34
- 'In-Progress') {
35
- return true;
36
- }
37
- }
38
- return false;
39
- };
40
- exports.getDetailInFlightRecommendations = getDetailInFlightRecommendations;
41
20
  const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
42
21
  const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
43
22
  const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
@@ -84,13 +63,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
84
63
  const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
85
64
  const classList = isAccountingClassesEnabled
86
65
  ? (0, classListSelector_1.getClassList)(classState, classListState)
87
- : {
88
- classes: [],
89
- nestedClassHierarchy: [],
90
- fetchState: 'Completed',
91
- error: undefined,
92
- version: 0,
93
- };
66
+ : { classes: [], nestedClassHierarchy: [], fetchState: 'Completed', error: undefined, version: 0 };
94
67
  const isAccountingProjectsEnabled = (0, tenantSelector_1.getIsAccountingProjectsEnabled)(state);
95
68
  const projectList = isAccountingProjectsEnabled
96
69
  ? (0, projectListSelector_1.getProjectList)(projectState, projectListState)
@@ -106,7 +79,6 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
106
79
  : [];
107
80
  const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
108
81
  const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
109
- const hasInFlightCategoryClassRecommendations = (0, exports.getDetailInFlightRecommendations)(state, transactionId);
110
82
  return {
111
83
  reportId: 'transaction_detail',
112
84
  reportTitle: 'Transaction Detail',
@@ -122,7 +94,6 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
122
94
  classHierarchyList,
123
95
  accountsHierarchyList,
124
96
  classList: classList,
125
- hasInFlightCategoryClassRecommendations,
126
97
  isAccountingClassesEnabled,
127
98
  isAccountingProjectsEnabled,
128
99
  projectList,
@@ -14,7 +14,6 @@ export interface TransactionDetailLineItemData extends TransactionLineBase {
14
14
  isClassMiscategorized: boolean;
15
15
  account?: AccountBase;
16
16
  billable?: BillableStatus;
17
- categoryClassRecommendationsFetchState?: FetchStateAndError;
18
17
  class?: ClassBase;
19
18
  customer?: CustomerBase;
20
19
  isCategoryUpdateSelected?: boolean;
@@ -1,5 +1,5 @@
1
- import { FetchState } from '../../commonStateTypes/common';
2
1
  import { RootState } from '../../reducer';
2
+ import { FetchState } from '../../commonStateTypes/common';
3
3
  export declare const getZeniOAuthApproveFetchState: (state: RootState) => FetchState;
4
4
  export declare const getZeniOAuthApproveRedirectUrl: (state: RootState) => string | undefined;
5
5
  export declare const getZeniOAuthApproveError: (state: RootState) => string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.75",
3
+ "version": "5.0.76",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -106,17 +106,12 @@
106
106
  "scripts": {
107
107
  "clean": "rimraf lib",
108
108
  "test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
109
- "test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
110
- "test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && vitest run --typecheck",
111
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
112
- "lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
113
- "lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
114
- "tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
115
- "typecheck": "tsc --noEmit",
109
+ "test": "pnpm test:typecheck && vitest run --typecheck",
110
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
116
111
  "find-dead-code": "ts-prune | grep -v '(used in module)'",
117
112
  "find-unused-exports": "ts-unused-exports ./tsconfig.json",
118
113
  "circular-dependency": "npx madge --circular --extensions ts ./src",
119
- "build": "concurrently --kill-others-on-fail --handle-input \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck (incl. lint-modified-files)...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
114
+ "build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
120
115
  "only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
121
116
  "only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
122
117
  "format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
@@ -1,17 +0,0 @@
1
- import { Draft, PayloadAction } from '@reduxjs/toolkit';
2
- /**
3
- * Factory for `fetchXxx` reducers that support Pusher-driven silent refresh.
4
- * When `cacheOverride=true`, fetchState and error are left untouched so the
5
- * UI doesn't flash a skeleton. When `false`, `applyTo` runs the normal
6
- * 'In-Progress' transition.
7
- */
8
- export declare const createCacheOverrideFetchReducer: <TState>(applyTo: (draft: Draft<TState>) => void) => {
9
- prepare: (cacheOverride?: boolean) => {
10
- payload: {
11
- cacheOverride: boolean;
12
- };
13
- };
14
- reducer: (draft: Draft<TState>, action: PayloadAction<{
15
- cacheOverride: boolean;
16
- }>) => void;
17
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCacheOverrideFetchReducer = void 0;
4
- /**
5
- * Factory for `fetchXxx` reducers that support Pusher-driven silent refresh.
6
- * When `cacheOverride=true`, fetchState and error are left untouched so the
7
- * UI doesn't flash a skeleton. When `false`, `applyTo` runs the normal
8
- * 'In-Progress' transition.
9
- */
10
- const createCacheOverrideFetchReducer = (applyTo) => ({
11
- reducer(draft, action) {
12
- if (action.payload.cacheOverride !== true) {
13
- applyTo(draft);
14
- }
15
- },
16
- prepare(cacheOverride = false) {
17
- return { payload: { cacheOverride } };
18
- },
19
- });
20
- exports.createCacheOverrideFetchReducer = createCacheOverrideFetchReducer;
@@ -1,23 +0,0 @@
1
- /**
2
- * Shared filter primitives — used by both Transaction Categorization and
3
- * Spend Management filter pipelines.
4
- *
5
- * These types are deliberately decoupled from any specific feature group:
6
- *
7
- * - `CategoryCombinationOperator` is how a `categories[]` array combines
8
- * (`AND` ⇒ every category must match; `OR` ⇒ any category matches).
9
- * - `FilterCategoryType` is the input-type tag a filter category uses to
10
- * pick its value-picker UI (text autocomplete, user picker, date range,
11
- * number range, plain dropdown).
12
- *
13
- * They used to be redeclared locally in both `transactionFilterHelpers.ts`
14
- * and `spendManagementFilterHelpers.ts` to keep the feature groups
15
- * independent. Centralising them here is consistent with Route B (which
16
- * separated the *matching pipelines*, not the *shared primitive types*) and
17
- * removes the maintenance trap of two identical type definitions drifting
18
- * apart over time.
19
- */
20
- /** How `categories[]` combines: AND requires every category to match, OR requires any. */
21
- export type CategoryCombinationOperator = 'AND' | 'OR';
22
- /** Input-type tag a filter category uses to pick its value-picker UI. */
23
- export type FilterCategoryType = 'searchAutocomplete' | 'user' | 'dateRange' | 'numberRange' | 'dropdown';
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /**
3
- * Shared filter primitives — used by both Transaction Categorization and
4
- * Spend Management filter pipelines.
5
- *
6
- * These types are deliberately decoupled from any specific feature group:
7
- *
8
- * - `CategoryCombinationOperator` is how a `categories[]` array combines
9
- * (`AND` ⇒ every category must match; `OR` ⇒ any category matches).
10
- * - `FilterCategoryType` is the input-type tag a filter category uses to
11
- * pick its value-picker UI (text autocomplete, user picker, date range,
12
- * number range, plain dropdown).
13
- *
14
- * They used to be redeclared locally in both `transactionFilterHelpers.ts`
15
- * and `spendManagementFilterHelpers.ts` to keep the feature groups
16
- * independent. Centralising them here is consistent with Route B (which
17
- * separated the *matching pipelines*, not the *shared primitive types*) and
18
- * removes the maintenance trap of two identical type definitions drifting
19
- * apart over time.
20
- */
21
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import { ChargeCardTransactionPayload } from '../entity/chargeCardTransaction/chargeCardTransactionPayload';
2
- import { ID } from './common';
3
- export declare const addChargeCardTransactionFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
4
- cardId: ID;
5
- transaction: ChargeCardTransactionPayload;
6
- }, string>;
7
- export declare const addDeclinedChargeCardTransactionFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
- cardId: ID;
9
- transaction: ChargeCardTransactionPayload;
10
- declineReason?: string;
11
- }, string>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addDeclinedChargeCardTransactionFromPusher = exports.addChargeCardTransactionFromPusher = void 0;
4
- const toolkit_1 = require("@reduxjs/toolkit");
5
- exports.addChargeCardTransactionFromPusher = (0, toolkit_1.createAction)('chargeCardDetail/addChargeCardTransactionFromPusher');
6
- exports.addDeclinedChargeCardTransactionFromPusher = (0, toolkit_1.createAction)('chargeCardDetail/addDeclinedChargeCardTransactionFromPusher');
@@ -1,16 +0,0 @@
1
- /**
2
- * Factory for `fetchXxx` reducers that support Pusher-driven silent refresh.
3
- * When `cacheOverride=true`, fetchState and error are left untouched so the
4
- * UI doesn't flash a skeleton. When `false`, `applyTo` runs the normal
5
- * 'In-Progress' transition.
6
- */
7
- export const createCacheOverrideFetchReducer = (applyTo) => ({
8
- reducer(draft, action) {
9
- if (action.payload.cacheOverride !== true) {
10
- applyTo(draft);
11
- }
12
- },
13
- prepare(cacheOverride = false) {
14
- return { payload: { cacheOverride } };
15
- },
16
- });
@@ -1,20 +0,0 @@
1
- /**
2
- * Shared filter primitives — used by both Transaction Categorization and
3
- * Spend Management filter pipelines.
4
- *
5
- * These types are deliberately decoupled from any specific feature group:
6
- *
7
- * - `CategoryCombinationOperator` is how a `categories[]` array combines
8
- * (`AND` ⇒ every category must match; `OR` ⇒ any category matches).
9
- * - `FilterCategoryType` is the input-type tag a filter category uses to
10
- * pick its value-picker UI (text autocomplete, user picker, date range,
11
- * number range, plain dropdown).
12
- *
13
- * They used to be redeclared locally in both `transactionFilterHelpers.ts`
14
- * and `spendManagementFilterHelpers.ts` to keep the feature groups
15
- * independent. Centralising them here is consistent with Route B (which
16
- * separated the *matching pipelines*, not the *shared primitive types*) and
17
- * removes the maintenance trap of two identical type definitions drifting
18
- * apart over time.
19
- */
20
- export {};
@@ -1,3 +0,0 @@
1
- import { createAction } from '@reduxjs/toolkit';
2
- export const addChargeCardTransactionFromPusher = createAction('chargeCardDetail/addChargeCardTransactionFromPusher');
3
- export const addDeclinedChargeCardTransactionFromPusher = createAction('chargeCardDetail/addDeclinedChargeCardTransactionFromPusher');