@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
@@ -1,7 +1,7 @@
1
- import type { AiAccountantCustomerPayload, AiAccountantJobPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
2
- import { UserPayload } from '../../entity/user/userPayload';
3
1
  import { ZeniAPIResponse } from '../../responsePayload';
4
2
  export { AiAccountantCustomerPayload, AiAccountantEnrollmentPayload, AiAccountantJobPayload, toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
3
+ import type { AiAccountantCustomerPayload, AiAccountantJobPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
4
+ import { UserPayload } from '../../entity/user/userPayload';
5
5
  export interface AiAccountantCustomersResponseData {
6
6
  customers: AiAccountantCustomerPayload[];
7
7
  users: UserPayload[];
@@ -1,5 +1,5 @@
1
- import { ID } from '../../commonStateTypes/common';
2
1
  import { AiAccountantCustomerPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
2
+ import { ID } from '../../commonStateTypes/common';
3
3
  import { ZeniAPIStatus } from '../../responsePayload';
4
4
  import { AiAccountantUIState, AiAccountantViewState } from './aiAccountantViewState';
5
5
  export declare const initialAiAccountantViewState: AiAccountantViewState;
@@ -10,7 +10,9 @@ const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
10
10
  const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantCustomers.match), (0, operators_1.switchMap)(() => {
11
11
  const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
12
12
  const url = `${base}/ai-accountant/customers`;
13
- return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
13
+ return zeniAPI
14
+ .getJSON(url)
15
+ .pipe((0, operators_1.mergeMap)((response) => {
14
16
  if ((0, responsePayload_1.isSuccessResponse)(response)) {
15
17
  const customers = response.data?.customers ?? [];
16
18
  const users = response.data?.users ?? [];
@@ -23,6 +25,7 @@ const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((
23
25
  else {
24
26
  return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)(response.status));
25
27
  }
26
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' + JSON.stringify(error))))));
28
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' +
29
+ JSON.stringify(error))))));
27
30
  }));
28
31
  exports.fetchAiAccountantCustomersEpic = fetchAiAccountantCustomersEpic;
@@ -23,7 +23,9 @@ const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((
23
23
  }
24
24
  const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
25
25
  const url = `${base}/ai-accountant/jobs?${params.toString()}`;
26
- return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
26
+ return zeniAPI
27
+ .getJSON(url)
28
+ .pipe((0, operators_1.mergeMap)((response) => {
27
29
  if ((0, responsePayload_1.isSuccessResponse)(response)) {
28
30
  const jobs = response.data?.jobs ?? [];
29
31
  const users = response.data?.users ?? [];
@@ -42,7 +44,8 @@ const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((
42
44
  }
43
45
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
44
46
  tenantId,
45
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' + JSON.stringify(error)),
47
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' +
48
+ JSON.stringify(error)),
46
49
  }))));
47
50
  }));
48
51
  exports.fetchAiAccountantJobsEpic = fetchAiAccountantJobsEpic;
@@ -54,10 +54,7 @@ const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe(
54
54
  messageText: 'failed',
55
55
  type: 'error',
56
56
  variables: [
57
- {
58
- variableName: '__reason__',
59
- variableValue: 'Unexpected error',
60
- },
57
+ { variableName: '__reason__', variableValue: 'Unexpected error' },
61
58
  ],
62
59
  }),
63
60
  ])));
@@ -1,4 +1,3 @@
1
- import { FetchState } from '../../commonStateTypes/common';
2
1
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
3
2
  import { Company } from '../../entity/company/companyStateTypes';
4
3
  import { Tag } from '../../entity/tag/tagState';
@@ -6,6 +5,7 @@ import { Task } from '../../entity/task/taskState';
6
5
  import { User } from '../../entity/user/userState';
7
6
  import { RootState } from '../../reducer';
8
7
  import { CompanyTaskManagerViewUIState, TaskManagerMetrics } from './companyTaskManagerViewState';
8
+ import { FetchState } from '../../commonStateTypes/common';
9
9
  export interface TaskWithCompanyDetail {
10
10
  assignees: User[];
11
11
  company: Company;
@@ -7,7 +7,7 @@ const tagSelector_1 = require("../../entity/tag/tagSelector");
7
7
  const taskSelector_1 = require("../../entity/task/taskSelector");
8
8
  const userSelector_1 = require("../../entity/user/userSelector");
9
9
  exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (companyTaskManagerViewState, companyState, userState, taskState, tagState) => {
10
- const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState, } = companyTaskManagerViewState;
10
+ const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState } = companyTaskManagerViewState;
11
11
  const tasksList = [];
12
12
  taskIds.forEach((taskId) => {
13
13
  const task = (0, taskSelector_1.getTaskById)(taskState, taskId);
@@ -6,10 +6,10 @@ const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const responsePayload_1 = require("../../../../responsePayload");
9
- const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
10
- const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
9
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
12
10
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
12
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
13
13
  const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatches.match), (0, operators_1.switchMap)((action) => {
14
14
  const { cacheOverride } = action.payload;
15
15
  const state = state$.value;
@@ -8,7 +8,6 @@ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
9
  const responsePayload_1 = require("../../../../responsePayload");
10
10
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
- const completedSubTab_1 = require("../../types/completedSubTab");
12
11
  const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchCompletedTransactions.match), (0, operators_1.switchMap)((action) => {
13
12
  const state = state$.value;
14
13
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
@@ -43,7 +42,7 @@ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.p
43
42
  if (sortOrder != null) {
44
43
  queryPayload.sort_order = sortOrder === 'ascending' ? 'asc' : 'desc';
45
44
  }
46
- if (completedSubTab !== completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB) {
45
+ if (completedSubTab !== 'all') {
47
46
  queryPayload.match_type = completedSubTab;
48
47
  }
49
48
  const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
@@ -35,19 +35,10 @@ function fetchBatchDetailsByIds(batchIds, zeniAPI) {
35
35
  }
36
36
  const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
37
37
  const batchList = action.payload.batchList;
38
- const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
39
- const { batchDetailsById, batchDetailsRevalidating } = bulkUpload;
38
+ const { batchDetailsById } = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
40
39
  /** Only completed list rows may trigger batch-details API; preserve platform order. */
41
- const completedRows = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList);
42
- /**
43
- * Stale-while-revalidate: when a manual refresh has set `batchDetailsRevalidating`, refresh
44
- * every completed list row (replacing entries via `storeBatchDetails` as they arrive). On a
45
- * normal first fetch we still only request rows whose details are missing.
46
- */
47
- const candidateRows = batchDetailsRevalidating === true
48
- ? completedRows
49
- : completedRows.filter((batch) => batchDetailsById[batch.batchId] == null);
50
- const completedBatchIds = candidateRows.map((batch) => batch.batchId);
40
+ const completedBatchesMissingDetails = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList).filter((batch) => batchDetailsById[batch.batchId] == null);
41
+ const completedBatchIds = completedBatchesMissingDetails.map((batch) => batch.batchId);
51
42
  const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
52
43
  if (batchIdsToFetch.length === 0) {
53
44
  /**
@@ -55,6 +46,7 @@ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pi
55
46
  * `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
56
47
  * Fall back to the single-batch-details epic so `phase` and details can resolve.
57
48
  */
49
+ const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
58
50
  const currentId = bulkUpload.currentBatchId;
59
51
  if (currentId != null &&
60
52
  bulkUpload.phase === 'matching' &&
@@ -62,15 +54,7 @@ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pi
62
54
  (0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
63
55
  return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails)());
64
56
  }
65
- /**
66
- * Close the pagination loop so the Unmatched-tab loading heuristic can settle.
67
- * `fetchMoreBatchDetailsComplete` also clears `batchDetailsRevalidating` and flips
68
- * `initialBatchDetailsLoaded` to true. Without this, `batchDetailsPaginationState` stays
69
- * at `Not-Started` forever after a list refresh that finds zero completed rows (or all
70
- * already cached) — the direct-open-Unmatched-without-upload path used to render an
71
- * infinite skeleton.
72
- */
73
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
57
+ return rxjs_1.EMPTY;
74
58
  }
75
59
  return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.setInitialBatchDetailsLoading)()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)()));
76
60
  }));
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.restoreBulkUploadAutomatchingOnMountEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
6
  const responsePayload_1 = require("../../../../responsePayload");
9
- const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
10
- const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
7
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
12
8
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
+ const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
10
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
12
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
13
13
  /**
14
14
  * On missing-receipts entry / period switch, hydrate the automatching banner for the logged-in
15
15
  * user without relying on UI-driven list fetches (the Missing tab does not fetch the batch list
@@ -52,12 +52,10 @@ const restoreBulkUploadAutomatchingOnMountEpic = (actions$, state$, zeniAPI) =>
52
52
  bulkUpload.batchListFetchState.fetchState === 'Completed';
53
53
  const listSource = alreadyCached
54
54
  ? (0, rxjs_1.of)(null)
55
- : zeniAPI
56
- .getJSON(listUrl)
57
- .pipe((0, operators_1.catchError)(() => (0, rxjs_1.of)(null)));
55
+ : zeniAPI.getJSON(listUrl).pipe((0, operators_1.catchError)(() => (0, rxjs_1.of)(null)));
58
56
  return listSource.pipe((0, operators_1.mergeMap)((listResponse) => {
59
57
  const batchList = alreadyCached
60
- ? (bulkUpload.batchListByPeriod[periodId] ?? [])
58
+ ? bulkUpload.batchListByPeriod[periodId] ?? []
61
59
  : listResponse != null &&
62
60
  (0, responsePayload_1.isSuccessResponse)(listResponse) &&
63
61
  listResponse.data != null
@@ -5,11 +5,10 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
7
7
  const responsePayload_1 = require("../../../../responsePayload");
8
- const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
9
8
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
9
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
- const completedSubTab_1 = require("../../types/completedSubTab");
12
10
  const transactionsViewState_1 = require("../../types/transactionsViewState");
11
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
13
12
  /**
14
13
  * `auto_categorized` for manual transaction search (Unmatched).
15
14
  * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
@@ -50,11 +49,6 @@ const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
50
49
  page_token: pageToken ?? null,
51
50
  page_size: manualSearch.pageSize,
52
51
  search_text: query,
53
- // Manual search ignores the Completed sub-tab axis — always span the
54
- // default sentinel so the receipt-matching UX returns results
55
- // regardless of where the transaction would otherwise be bucketed on
56
- // the Completed tab.
57
- sub_tab: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
58
52
  };
59
53
  return zeniAPI
60
54
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -4,19 +4,13 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
4
  import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
5
5
  import { RootState } from '../../../../reducer';
6
6
  import { ZeniAPI } from '../../../../zeniAPI';
7
- import { bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, refreshBatchDetailsForBatchId, restoreBulkUploadMatchingState } from '../../reducers/missingReceiptsViewReducer';
8
- export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof pusherBatchStatusUpdate> | ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof refreshBatchDetailsForBatchId> | ReturnType<typeof updateTransactions> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUploadAutomatchingTimedOut>;
7
+ import { bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, restoreBulkUploadMatchingState } from '../../reducers/missingReceiptsViewReducer';
8
+ export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof pusherBatchStatusUpdate> | ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof updateTransactions> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUploadAutomatchingTimedOut>;
9
9
  /**
10
- * On Pusher batch completion: refresh the batch list (so summary counts update) and dispatch a
11
- * targeted single-batch details refresh for the batch that just completed. Stale-while-revalidate:
12
- * we no longer pass `invalidateBatchDetailsCache: true` existing `batchDetailsById` entries stay
13
- * on screen and the just-completed row replaces in place via `storeBatchDetails`. The post-match
14
- * tab decision (Unmatched vs Completed) is made client-side in `ExpenseAutomationPage` once fresh
10
+ * On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs).
11
+ * Debounced to reduce duplicate refreshes. The post-match tab decision
12
+ * (Unmatched vs Completed) is made client-side in `ExpenseAutomationPage` once fresh
15
13
  * batch details land -- do not dispatch `requestMissingReceiptsTabNavigation` here.
16
- *
17
- * Pusher resend storms (same batch completing twice within the dedupe window) are throttled in
18
- * `refreshBatchDetailsForBatchIdEpic` via `lastBatchDetailRefreshAtById`, so this epic stays
19
- * stateless and just forwards the event.
20
14
  */
21
15
  export declare const pusherBatchStatusCompletionEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
22
16
  /**
@@ -15,20 +15,16 @@ const FALLBACK_FIRST_DELAY_MS = 30000;
15
15
  const RESTORE_FIRST_DELAY_MS = 5000;
16
16
  const FALLBACK_POLL_INTERVAL_MS = 10000;
17
17
  /**
18
- * On Pusher batch completion: refresh the batch list (so summary counts update) and dispatch a
19
- * targeted single-batch details refresh for the batch that just completed. Stale-while-revalidate:
20
- * we no longer pass `invalidateBatchDetailsCache: true` existing `batchDetailsById` entries stay
21
- * on screen and the just-completed row replaces in place via `storeBatchDetails`. The post-match
22
- * tab decision (Unmatched vs Completed) is made client-side in `ExpenseAutomationPage` once fresh
18
+ * On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs).
19
+ * Debounced to reduce duplicate refreshes. The post-match tab decision
20
+ * (Unmatched vs Completed) is made client-side in `ExpenseAutomationPage` once fresh
23
21
  * batch details land -- do not dispatch `requestMissingReceiptsTabNavigation` here.
24
- *
25
- * Pusher resend storms (same batch completing twice within the dedupe window) are throttled in
26
- * `refreshBatchDetailsForBatchIdEpic` via `lastBatchDetailRefreshAtById`, so this epic stays
27
- * stateless and just forwards the event.
28
22
  */
29
- const pusherBatchStatusCompletionEpic = (actions$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.status === 'completed'), (0, operators_1.debounceTime)(300), (0, operators_1.mergeMap)((action) => (0, rxjs_1.from)([
30
- (0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({ cacheOverride: true }),
31
- (0, missingReceiptsViewReducer_1.refreshBatchDetailsForBatchId)({ batchId: action.payload.batchId }),
23
+ const pusherBatchStatusCompletionEpic = (actions$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.status === 'completed'), (0, operators_1.debounceTime)(300), (0, operators_1.mergeMap)(() => (0, rxjs_1.from)([
24
+ (0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({
25
+ cacheOverride: true,
26
+ invalidateBatchDetailsCache: true,
27
+ }),
32
28
  ])));
33
29
  exports.pusherBatchStatusCompletionEpic = pusherBatchStatusCompletionEpic;
34
30
  /**
@@ -3,6 +3,6 @@ import { Observable } from 'rxjs';
3
3
  import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
4
  import { RootState } from '../../../../reducer';
5
5
  import { ZeniAPI } from '../../../../zeniAPI';
6
- import { fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationSuccess, initializeTransactionCategorizationViewLocalData, resetOtherTabsFetchState, updateParentTotalCountForTab, updateTotalCountForTransactionCategorization, updateTransactionCategorizationUIState } from '../../reducers/transactionsViewReducer';
7
- export type ActionType = ReturnType<typeof fetchTransactionCategorization> | ReturnType<typeof updateTransactions> | ReturnType<typeof initializeTransactionCategorizationViewLocalData> | ReturnType<typeof fetchTransactionCategorizationFailure> | ReturnType<typeof updateTransactionCategorizationUIState> | ReturnType<typeof updateTotalCountForTransactionCategorization> | ReturnType<typeof updateParentTotalCountForTab> | ReturnType<typeof fetchTransactionCategorizationSuccess> | ReturnType<typeof resetOtherTabsFetchState>;
6
+ import { fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationSuccess, initializeTransactionCategorizationViewLocalData, resetOtherTabsFetchState, updateTotalCountForTransactionCategorization, updateTransactionCategorizationUIState } from '../../reducers/transactionsViewReducer';
7
+ export type ActionType = ReturnType<typeof fetchTransactionCategorization> | ReturnType<typeof updateTransactions> | ReturnType<typeof initializeTransactionCategorizationViewLocalData> | ReturnType<typeof fetchTransactionCategorizationFailure> | ReturnType<typeof updateTransactionCategorizationUIState> | ReturnType<typeof updateTotalCountForTransactionCategorization> | ReturnType<typeof fetchTransactionCategorizationSuccess> | ReturnType<typeof resetOtherTabsFetchState>;
8
8
  export declare const fetchTransactionCategorizationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -9,7 +9,6 @@ const transactionReducer_1 = require("../../../../entity/transaction/transaction
9
9
  const responsePayload_1 = require("../../../../responsePayload");
10
10
  const transactionCategorizationLocalDataHelper_1 = require("../../helpers/transactionCategorizationLocalDataHelper");
11
11
  const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
12
- const completedSubTab_1 = require("../../types/completedSubTab");
13
12
  const transactionsViewState_1 = require("../../types/transactionsViewState");
14
13
  const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchTransactionCategorization.match), (0, operators_1.switchMap)((action) => {
15
14
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationTransactionsViewState, } = state$.value;
@@ -27,9 +26,6 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
27
26
  page_token: pageToken,
28
27
  page_size: 25,
29
28
  search_text: uiState.searchString,
30
- sub_tab: selectedTab === 'autoCategorized'
31
- ? expenseAutomationTransactionsViewState.selectedTransactionCategorizationCompletedSubTab
32
- : completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
33
29
  };
34
30
  return zeniAPI
35
31
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -52,12 +48,6 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
52
48
  selectedTab,
53
49
  totalCount: response.data.total_count,
54
50
  }));
55
- updateActions.push((0, transactionsViewReducer_1.updateParentTotalCountForTab)({
56
- selectedPeriod,
57
- selectedTab,
58
- parentTotalCount: response.data.parent_tab_total_count ??
59
- response.data.total_count,
60
- }));
61
51
  updateActions.push((0, transactionsViewReducer_1.resetOtherTabsFetchState)({
62
52
  refreshViewInBackground,
63
53
  tabs: transactionsViewState_1.TRANSACTIONS_TABS.filter((tab) => selectedTab !== tab),
@@ -2,8 +2,8 @@ import { ID } from '../../../commonStateTypes/common';
2
2
  import { AccountBase } from '../../../entity/account/accountState';
3
3
  import { UncategorizedAccountTypes } from '../../../entity/account/accountState';
4
4
  import { ClassBase } from '../../../entity/class/classState';
5
- import { Entity } from '../../../entity/genericEntity/entity';
6
5
  import { ProjectBase } from '../../../entity/project/projectState';
6
+ import { Entity } from '../../../entity/genericEntity/entity';
7
7
  import { RecommendationWithCOTByLineId } from '../../../entity/transaction/stateTypes/transaction';
8
8
  import { SupportedTransactionPayload, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
9
9
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
@@ -2,7 +2,6 @@ import { EntityRecommendationPayload } from '../../../commonPayloadTypes/recomme
2
2
  import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
3
3
  import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
4
4
  import { ZeniAPIResponse } from '../../../responsePayload';
5
- import { CompletedSubTab } from '../types/completedSubTab';
6
5
  export interface TransactionCategorizationQueryPayload {
7
6
  auto_categorized: boolean;
8
7
  end_date: string | null;
@@ -12,32 +11,12 @@ export interface TransactionCategorizationQueryPayload {
12
11
  sort_by: string;
13
12
  sort_order: string;
14
13
  start_date: string | null;
15
- /**
16
- * Required. For the Completed (`auto_categorized=true`) listing, scopes the
17
- * returned page + `total_count` to one of the Completed sub-tabs. For the
18
- * Review listing it is forced to `'all'` to preserve parent-tab semantics
19
- * on the backend.
20
- */
21
- sub_tab: CompletedSubTab;
22
14
  }
23
15
  export interface TransactionCategorizationPayload {
24
16
  next_page_token: string | null;
25
17
  query: TransactionCategorizationQueryPayload;
26
18
  total_count: number;
27
19
  transactions: SupportedTransactionPayload[];
28
- /**
29
- * Count of transactions for the entire parent tab (Review or Completed),
30
- * regardless of which sub-tab the listing was scoped to. Used solely to
31
- * drive the parent tab badge counts on the UI; pagination, list-level
32
- * counts, and sub-tab chips continue to consume {@link total_count}.
33
- *
34
- * Optional at the wire boundary so that any version-skew scenario
35
- * (delayed BE rollout, cached SW response, hotfix without the BE change)
36
- * deserializes cleanly. Consumers are expected to fall back to
37
- * {@link total_count} when this is absent — see
38
- * `fetchTransactionCategorizationEpic` for the canonical fallback.
39
- */
40
- parent_tab_total_count?: number;
41
20
  }
42
21
  export type TransactionCategorizationResponse = ZeniAPIResponse<TransactionCategorizationPayload>;
43
22
  export interface EntityRelatedUpdatesPayload {
@@ -6,8 +6,7 @@ import type { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
6
6
  import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
7
7
  import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
8
8
  import { ZeniAPIStatus } from '../../../responsePayload';
9
- import { type CompletedSubTab } from '../types/completedSubTab';
10
- import { type BatchDetails, type BatchListItem, type BatchStatus, type BulkUploadResultsTab, type BulkUploadSortKey, type BulkUploadState, type ManualSearchResult, type MissingReceiptsViewState, type MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
9
+ import { type BatchDetails, type BatchListItem, type BatchStatus, type BulkUploadResultsTab, type BulkUploadSortKey, type BulkUploadState, type CompletedSubTab, type ManualSearchResult, type MissingReceiptsViewState, type MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
11
10
  export declare const getCompletedTransactionsCacheKey: (periodId: MonthYearPeriodId, sortKey: BulkUploadSortKey | undefined, sortOrder: SortOrder | undefined, subTab: CompletedSubTab) => string;
12
11
  export declare const initialBulkUploadState: BulkUploadState;
13
12
  export declare const initialState: MissingReceiptsViewState;
@@ -19,15 +18,6 @@ export declare const fetchBulkUploadBatchDetails: import("@reduxjs/toolkit").Act
19
18
  * after a hard refresh. The epic owns the list + details API calls end-to-end.
20
19
  */
21
20
  export declare const restoreBulkUploadAutomatchingOnMount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/restoreBulkUploadAutomatchingOnMount">;
22
- /**
23
- * Epic trigger only. Targeted stale-while-revalidate refresh for a single batch's details — used
24
- * by `pusherBatchStatusCompletionEpic` so a Pusher 'completed' event re-fetches only that one
25
- * batch instead of wiping the entire `batchDetailsById` cache. The epic dedupes via
26
- * `lastBatchDetailRefreshAtById` so resend storms don't trigger waves of API calls.
27
- */
28
- export declare const refreshBatchDetailsForBatchId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
- batchId: ID;
30
- }, string>;
31
21
  export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, minimumTransactionAmount: Amount, cacheOverride?: any, refreshViewInBackground?: any], {
32
22
  period: TimePeriod;
33
23
  minimumTransactionAmount: Amount;
@@ -82,10 +72,7 @@ export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCrea
82
72
  }, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesSuccess">, fetchBulkUploadBatchesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
83
73
  error: ZeniAPIStatus;
84
74
  selectedPeriod: MonthYearPeriod;
85
- }, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesFailure">, clearBulkUploadBatchDetailsForScopeChange: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearBulkUploadBatchDetailsForScopeChange">, markBatchDetailRefreshAttempted: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
86
- batchId: ID;
87
- timestamp: number;
88
- }, "expenseAutomationMissingReceiptsView/markBatchDetailRefreshAttempted">, confirmBulkUploadMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[batchId: string, attachmentId: string, transactionId: string, transactionType: string, fileName: string], {
75
+ }, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesFailure">, confirmBulkUploadMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[batchId: string, attachmentId: string, transactionId: string, transactionType: string, fileName: string], {
89
76
  batchId: string;
90
77
  attachmentId: string;
91
78
  transactionId: string;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.fetchCompletedTransactions = exports.acknowledgeBulkUploadConfirmMatchComplete = exports.clearManualSearchResults = exports.searchTransactionsForManualMatchFailure = exports.searchTransactionsForManualMatchSuccess = exports.searchTransactionsForManualMatch = exports.clearBulkUpload = exports.setBulkUploadSortConfig = exports.setBulkUploadCompletedSubTab = exports.setBulkUploadResultsTab = exports.confirmBulkUploadMatchFailure = exports.confirmBulkUploadMatchSuccess = exports.confirmBulkUploadMatch = exports.markBatchDetailRefreshAttempted = exports.clearBulkUploadBatchDetailsForScopeChange = exports.fetchBulkUploadBatchesFailure = exports.fetchBulkUploadBatchesSuccess = exports.fetchBulkUploadBatches = exports.fetchMoreBatchDetailsFailure = exports.fetchMoreBatchDetailsComplete = exports.fetchMoreBatchDetails = exports.setInitialBatchDetailsLoading = exports.batchDetailFetchFailed = exports.storeBatchDetails = exports.fetchBulkUploadBatchDetailsFailure = exports.fetchBulkUploadBatchDetailsSuccess = exports.clearMissingReceiptsTabNavigation = exports.requestMissingReceiptsTabNavigation = exports.pusherBatchStatusUpdate = exports.bulkUploadAutomatchingTimedOut = exports.restoreBulkUploadMatchingState = exports.bulkUploadReceiptsFailure = exports.bulkUploadReceiptsSuccess = exports.setBulkUploadUploadedFileCount = exports.updateBulkUploadProgress = exports.bulkUploadReceipts = exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.refreshBatchDetailsForBatchId = exports.restoreBulkUploadAutomatchingOnMount = exports.fetchBulkUploadBatchDetails = exports.initialState = exports.initialBulkUploadState = exports.getCompletedTransactionsCacheKey = void 0;
5
- exports.fetchCompletedTransactionsFailure = exports.fetchCompletedTransactionsSuccess = void 0;
4
+ exports.fetchCompletedTransactionsFailure = exports.fetchCompletedTransactionsSuccess = exports.fetchCompletedTransactions = exports.acknowledgeBulkUploadConfirmMatchComplete = exports.clearManualSearchResults = exports.searchTransactionsForManualMatchFailure = exports.searchTransactionsForManualMatchSuccess = exports.searchTransactionsForManualMatch = exports.clearBulkUpload = exports.setBulkUploadSortConfig = exports.setBulkUploadCompletedSubTab = exports.setBulkUploadResultsTab = exports.confirmBulkUploadMatchFailure = exports.confirmBulkUploadMatchSuccess = exports.confirmBulkUploadMatch = exports.fetchBulkUploadBatchesFailure = exports.fetchBulkUploadBatchesSuccess = exports.fetchBulkUploadBatches = exports.fetchMoreBatchDetailsFailure = exports.fetchMoreBatchDetailsComplete = exports.fetchMoreBatchDetails = exports.setInitialBatchDetailsLoading = exports.batchDetailFetchFailed = exports.storeBatchDetails = exports.fetchBulkUploadBatchDetailsFailure = exports.fetchBulkUploadBatchDetailsSuccess = exports.clearMissingReceiptsTabNavigation = exports.requestMissingReceiptsTabNavigation = exports.pusherBatchStatusUpdate = exports.bulkUploadAutomatchingTimedOut = exports.restoreBulkUploadMatchingState = exports.bulkUploadReceiptsFailure = exports.bulkUploadReceiptsSuccess = exports.setBulkUploadUploadedFileCount = exports.updateBulkUploadProgress = exports.bulkUploadReceipts = exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.restoreBulkUploadAutomatchingOnMount = exports.fetchBulkUploadBatchDetails = exports.initialState = exports.initialBulkUploadState = exports.getCompletedTransactionsCacheKey = void 0;
6
5
  const toolkit_1 = require("@reduxjs/toolkit");
7
6
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
8
- const completedSubTab_1 = require("../types/completedSubTab");
9
7
  const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
10
8
  const getCompletedTransactionsCacheKey = (periodId, sortKey, sortOrder, subTab) => {
11
9
  const sortKeyPart = sortKey ?? 'none';
@@ -16,18 +14,15 @@ exports.getCompletedTransactionsCacheKey = getCompletedTransactionsCacheKey;
16
14
  exports.initialBulkUploadState = {
17
15
  batchDetailsById: {},
18
16
  batchDetailsPaginationState: { fetchState: 'Not-Started', error: undefined },
19
- batchDetailsRevalidating: false,
20
17
  batchListByPeriod: {},
21
18
  batchListFetchState: { fetchState: 'Not-Started', error: undefined },
22
19
  batchStatusById: {},
23
- completedSubTab: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
20
+ completedSubTab: 'all',
24
21
  completedTransactionsByPeriod: {},
25
22
  confirmMatchStatus: { fetchState: 'Not-Started', error: undefined },
26
23
  currentBatchId: undefined,
27
24
  currentResultsTab: 'unmatched',
28
25
  failedBatchDetailIds: [],
29
- initialBatchDetailsLoaded: false,
30
- lastBatchDetailRefreshAtById: {},
31
26
  manualSearchUiResetKey: 0,
32
27
  manualSearch: {
33
28
  fetchState: { fetchState: 'Not-Started', error: undefined },
@@ -74,13 +69,6 @@ exports.fetchBulkUploadBatchDetails = (0, toolkit_1.createAction)('expenseAutoma
74
69
  * after a hard refresh. The epic owns the list + details API calls end-to-end.
75
70
  */
76
71
  exports.restoreBulkUploadAutomatchingOnMount = (0, toolkit_1.createAction)('expenseAutomationMissingReceiptsView/restoreBulkUploadAutomatchingOnMount');
77
- /**
78
- * Epic trigger only. Targeted stale-while-revalidate refresh for a single batch's details — used
79
- * by `pusherBatchStatusCompletionEpic` so a Pusher 'completed' event re-fetches only that one
80
- * batch instead of wiping the entire `batchDetailsById` cache. The epic dedupes via
81
- * `lastBatchDetailRefreshAtById` so resend storms don't trigger waves of API calls.
82
- */
83
- exports.refreshBatchDetailsForBatchId = (0, toolkit_1.createAction)('expenseAutomationMissingReceiptsView/refreshBatchDetailsForBatchId');
84
72
  const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
85
73
  name: 'expenseAutomationMissingReceiptsView',
86
74
  initialState: exports.initialState,
@@ -267,16 +255,6 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
267
255
  const details = action.payload;
268
256
  draft.bulkUpload.batchDetailsById[details.batchId] = details;
269
257
  draft.bulkUpload.phase = 'completed';
270
- draft.bulkUpload.initialBatchDetailsLoaded = true;
271
- /**
272
- * A successful detail load supersedes any previous failure for this batch — without this,
273
- * `getPrimaryBatchIdFromBatchListOrder` (and pagination) would keep skipping the batch
274
- * across the recovery, hiding now-valid Unmatched-tab work.
275
- */
276
- const failedIndex = draft.bulkUpload.failedBatchDetailIds.indexOf(details.batchId);
277
- if (failedIndex >= 0) {
278
- draft.bulkUpload.failedBatchDetailIds.splice(failedIndex, 1);
279
- }
280
258
  },
281
259
  fetchBulkUploadBatchDetailsFailure: {
282
260
  reducer(draft) {
@@ -298,19 +276,6 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
298
276
  draft.bulkUpload.currentBatchId === details.batchId) {
299
277
  draft.bulkUpload.phase = 'completed';
300
278
  }
301
- /** Stale-while-revalidate: any successful detail load means we have rendered data. */
302
- draft.bulkUpload.initialBatchDetailsLoaded = true;
303
- /**
304
- * Stale-while-revalidate recovery: if this batch had previously failed, a successful
305
- * targeted refresh (Pusher `completed` → `refreshBatchDetailsForBatchIdEpic`) or
306
- * multi-batch revalidation (manual refresh) supersedes the failure. Selectors that gate
307
- * on `failedBatchDetailIds` (primary-batch resolution, `hasMoreBatchDetails`) must see the
308
- * batch as recovered so it can show fresh Unmatched work.
309
- */
310
- const failedIndex = draft.bulkUpload.failedBatchDetailIds.indexOf(details.batchId);
311
- if (failedIndex >= 0) {
312
- draft.bulkUpload.failedBatchDetailIds.splice(failedIndex, 1);
313
- }
314
279
  },
315
280
  batchDetailFetchFailed(draft, action) {
316
281
  const { batchId } = action.payload;
@@ -339,14 +304,6 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
339
304
  fetchState: 'Completed',
340
305
  error: undefined,
341
306
  };
342
- /**
343
- * Stale-while-revalidate: a completed pagination round means the initial page (or a
344
- * subsequent revalidation) has fully resolved. Once `initialBatchDetailsLoaded` flips to
345
- * `true` it stays `true` for the session — only `clearBulkUpload` /
346
- * `clearBulkUploadBatchDetailsForScopeChange` can reset it.
347
- */
348
- draft.bulkUpload.initialBatchDetailsLoaded = true;
349
- draft.bulkUpload.batchDetailsRevalidating = false;
350
307
  const currentId = draft.bulkUpload.currentBatchId;
351
308
  const currentDetails = currentId != null
352
309
  ? draft.bulkUpload.batchDetailsById[currentId]
@@ -362,24 +319,12 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
362
319
  fetchState: 'Error',
363
320
  error: action.payload.error,
364
321
  };
365
- draft.bulkUpload.batchDetailsRevalidating = false;
366
322
  },
367
323
  fetchBulkUploadBatches: {
368
324
  reducer(draft, action) {
369
- /**
370
- * Manual refresh button (and any other caller passing `invalidateBatchDetailsCache: true`):
371
- * wipe the details cache, failed-id list, and pagination state so the Unmatched tab drops
372
- * its existing rows and re-renders the initial-load skeleton while the next list +
373
- * details fetches resolve. The post-success epic (`fetchMultipleBatchDetailsEpic`) then
374
- * re-runs the details chain from a clean slate.
375
- */
376
325
  if (action.payload.invalidateBatchDetailsCache === true) {
377
326
  draft.bulkUpload.batchDetailsById = {};
378
327
  draft.bulkUpload.failedBatchDetailIds = [];
379
- draft.bulkUpload.batchDetailsPaginationState = {
380
- fetchState: 'Not-Started',
381
- error: undefined,
382
- };
383
328
  }
384
329
  draft.bulkUpload.batchListFetchState = {
385
330
  fetchState: 'In-Progress',
@@ -396,31 +341,6 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
396
341
  };
397
342
  },
398
343
  },
399
- /**
400
- * Tenant/period scope change — the new scope's data is genuinely unknown so the existing
401
- * details cache and `initialBatchDetailsLoaded` flag must be reset (the Unmatched skeleton
402
- * is acceptable on scope change). Distinct from a stale-while-revalidate refresh.
403
- */
404
- clearBulkUploadBatchDetailsForScopeChange(draft) {
405
- draft.bulkUpload.batchDetailsById = {};
406
- draft.bulkUpload.failedBatchDetailIds = [];
407
- draft.bulkUpload.batchDetailsPaginationState = {
408
- fetchState: 'Not-Started',
409
- error: undefined,
410
- };
411
- draft.bulkUpload.batchDetailsRevalidating = false;
412
- draft.bulkUpload.initialBatchDetailsLoaded = false;
413
- draft.bulkUpload.lastBatchDetailRefreshAtById = {};
414
- },
415
- /**
416
- * Records the last time we issued a targeted refresh for `batchId`. Set by
417
- * `refreshBatchDetailsForBatchIdEpic` before each API call so subsequent Pusher resends in the
418
- * dedupe window are skipped.
419
- */
420
- markBatchDetailRefreshAttempted(draft, action) {
421
- draft.bulkUpload.lastBatchDetailRefreshAtById[action.payload.batchId] =
422
- action.payload.timestamp;
423
- },
424
344
  fetchBulkUploadBatchesSuccess(draft, action) {
425
345
  const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
426
346
  draft.bulkUpload.batchListByPeriod[periodId] = action.payload.batchList;
@@ -663,7 +583,7 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
663
583
  });
664
584
  _a = expenseAutomationMissingReceiptsView.actions, exports.fetchMissingReceipts = _a.fetchMissingReceipts, exports.fetchMissingReceiptsSuccess = _a.fetchMissingReceiptsSuccess, exports.fetchMissingReceiptsFailure = _a.fetchMissingReceiptsFailure, exports.uploadMissingReceiptSuccess = _a.uploadMissingReceiptSuccess, exports.updateMissingReceiptUploadState = _a.updateMissingReceiptUploadState, exports.updateMissingReceiptsUIState = _a.updateMissingReceiptsUIState, exports.markMissingReceiptAsDone = _a.markMissingReceiptAsDone, exports.clearExpenseAutomationMissingReceiptsView = _a.clearExpenseAutomationMissingReceiptsView,
665
585
  // Bulk Upload
666
- exports.bulkUploadReceipts = _a.bulkUploadReceipts, exports.updateBulkUploadProgress = _a.updateBulkUploadProgress, exports.setBulkUploadUploadedFileCount = _a.setBulkUploadUploadedFileCount, exports.bulkUploadReceiptsSuccess = _a.bulkUploadReceiptsSuccess, exports.bulkUploadReceiptsFailure = _a.bulkUploadReceiptsFailure, exports.restoreBulkUploadMatchingState = _a.restoreBulkUploadMatchingState, exports.bulkUploadAutomatchingTimedOut = _a.bulkUploadAutomatchingTimedOut, exports.pusherBatchStatusUpdate = _a.pusherBatchStatusUpdate, exports.requestMissingReceiptsTabNavigation = _a.requestMissingReceiptsTabNavigation, exports.clearMissingReceiptsTabNavigation = _a.clearMissingReceiptsTabNavigation, exports.fetchBulkUploadBatchDetailsSuccess = _a.fetchBulkUploadBatchDetailsSuccess, exports.fetchBulkUploadBatchDetailsFailure = _a.fetchBulkUploadBatchDetailsFailure, exports.storeBatchDetails = _a.storeBatchDetails, exports.batchDetailFetchFailed = _a.batchDetailFetchFailed, exports.setInitialBatchDetailsLoading = _a.setInitialBatchDetailsLoading, exports.fetchMoreBatchDetails = _a.fetchMoreBatchDetails, exports.fetchMoreBatchDetailsComplete = _a.fetchMoreBatchDetailsComplete, exports.fetchMoreBatchDetailsFailure = _a.fetchMoreBatchDetailsFailure, exports.fetchBulkUploadBatches = _a.fetchBulkUploadBatches, exports.fetchBulkUploadBatchesSuccess = _a.fetchBulkUploadBatchesSuccess, exports.fetchBulkUploadBatchesFailure = _a.fetchBulkUploadBatchesFailure, exports.clearBulkUploadBatchDetailsForScopeChange = _a.clearBulkUploadBatchDetailsForScopeChange, exports.markBatchDetailRefreshAttempted = _a.markBatchDetailRefreshAttempted, exports.confirmBulkUploadMatch = _a.confirmBulkUploadMatch, exports.confirmBulkUploadMatchSuccess = _a.confirmBulkUploadMatchSuccess, exports.confirmBulkUploadMatchFailure = _a.confirmBulkUploadMatchFailure, exports.setBulkUploadResultsTab = _a.setBulkUploadResultsTab, exports.setBulkUploadCompletedSubTab = _a.setBulkUploadCompletedSubTab, exports.setBulkUploadSortConfig = _a.setBulkUploadSortConfig, exports.clearBulkUpload = _a.clearBulkUpload, exports.searchTransactionsForManualMatch = _a.searchTransactionsForManualMatch, exports.searchTransactionsForManualMatchSuccess = _a.searchTransactionsForManualMatchSuccess, exports.searchTransactionsForManualMatchFailure = _a.searchTransactionsForManualMatchFailure, exports.clearManualSearchResults = _a.clearManualSearchResults, exports.acknowledgeBulkUploadConfirmMatchComplete = _a.acknowledgeBulkUploadConfirmMatchComplete,
586
+ exports.bulkUploadReceipts = _a.bulkUploadReceipts, exports.updateBulkUploadProgress = _a.updateBulkUploadProgress, exports.setBulkUploadUploadedFileCount = _a.setBulkUploadUploadedFileCount, exports.bulkUploadReceiptsSuccess = _a.bulkUploadReceiptsSuccess, exports.bulkUploadReceiptsFailure = _a.bulkUploadReceiptsFailure, exports.restoreBulkUploadMatchingState = _a.restoreBulkUploadMatchingState, exports.bulkUploadAutomatchingTimedOut = _a.bulkUploadAutomatchingTimedOut, exports.pusherBatchStatusUpdate = _a.pusherBatchStatusUpdate, exports.requestMissingReceiptsTabNavigation = _a.requestMissingReceiptsTabNavigation, exports.clearMissingReceiptsTabNavigation = _a.clearMissingReceiptsTabNavigation, exports.fetchBulkUploadBatchDetailsSuccess = _a.fetchBulkUploadBatchDetailsSuccess, exports.fetchBulkUploadBatchDetailsFailure = _a.fetchBulkUploadBatchDetailsFailure, exports.storeBatchDetails = _a.storeBatchDetails, exports.batchDetailFetchFailed = _a.batchDetailFetchFailed, exports.setInitialBatchDetailsLoading = _a.setInitialBatchDetailsLoading, exports.fetchMoreBatchDetails = _a.fetchMoreBatchDetails, exports.fetchMoreBatchDetailsComplete = _a.fetchMoreBatchDetailsComplete, exports.fetchMoreBatchDetailsFailure = _a.fetchMoreBatchDetailsFailure, exports.fetchBulkUploadBatches = _a.fetchBulkUploadBatches, exports.fetchBulkUploadBatchesSuccess = _a.fetchBulkUploadBatchesSuccess, exports.fetchBulkUploadBatchesFailure = _a.fetchBulkUploadBatchesFailure, exports.confirmBulkUploadMatch = _a.confirmBulkUploadMatch, exports.confirmBulkUploadMatchSuccess = _a.confirmBulkUploadMatchSuccess, exports.confirmBulkUploadMatchFailure = _a.confirmBulkUploadMatchFailure, exports.setBulkUploadResultsTab = _a.setBulkUploadResultsTab, exports.setBulkUploadCompletedSubTab = _a.setBulkUploadCompletedSubTab, exports.setBulkUploadSortConfig = _a.setBulkUploadSortConfig, exports.clearBulkUpload = _a.clearBulkUpload, exports.searchTransactionsForManualMatch = _a.searchTransactionsForManualMatch, exports.searchTransactionsForManualMatchSuccess = _a.searchTransactionsForManualMatchSuccess, exports.searchTransactionsForManualMatchFailure = _a.searchTransactionsForManualMatchFailure, exports.clearManualSearchResults = _a.clearManualSearchResults, exports.acknowledgeBulkUploadConfirmMatchComplete = _a.acknowledgeBulkUploadConfirmMatchComplete,
667
587
  // Completed Transactions
668
588
  exports.fetchCompletedTransactions = _a.fetchCompletedTransactions, exports.fetchCompletedTransactionsSuccess = _a.fetchCompletedTransactionsSuccess, exports.fetchCompletedTransactionsFailure = _a.fetchCompletedTransactionsFailure;
669
589
  exports.default = expenseAutomationMissingReceiptsView.reducer;