@zeniai/client-epic-state 4.19.82 → 4.19.84-betaVR1

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 (70) hide show
  1. package/lib/entity/account/accountPayload.d.ts +2 -0
  2. package/lib/entity/account/accountPayload.js +2 -0
  3. package/lib/entity/account/accountState.d.ts +2 -0
  4. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  5. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  6. package/lib/epic.d.ts +12 -1
  7. package/lib/epic.js +12 -1
  8. package/lib/esm/entity/account/accountPayload.js +2 -0
  9. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  10. package/lib/esm/epic.js +12 -1
  11. package/lib/esm/index.js +5 -3
  12. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +24 -0
  13. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
  14. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
  15. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
  16. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
  17. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +34 -0
  18. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +57 -0
  19. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +68 -0
  20. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  21. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +42 -0
  22. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
  23. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +147 -1
  24. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +401 -1
  25. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -1
  26. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +224 -1
  27. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  28. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  29. package/lib/esm/zeniAPI.js +0 -2
  30. package/lib/index.d.ts +6 -4
  31. package/lib/index.js +66 -31
  32. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +15 -0
  33. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +28 -0
  34. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
  35. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
  36. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
  37. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
  38. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
  39. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
  40. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
  41. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
  42. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
  43. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +38 -0
  44. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
  45. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +62 -0
  46. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
  47. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +72 -0
  48. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  49. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +13 -0
  50. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +47 -0
  51. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
  52. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
  53. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  54. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +107 -0
  55. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +158 -0
  56. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +70 -3
  57. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +403 -2
  58. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
  59. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -2
  60. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
  61. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
  62. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  63. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +223 -0
  64. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  65. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +124 -0
  66. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
  67. package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  68. package/lib/zeniAPI.js +0 -2
  69. package/package.json +2 -2
  70. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
@@ -1,10 +1,42 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.initialState = 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.fetchBulkUploadBatchDetails = exports.clearMissingReceiptsTabNavigation = exports.requestMissingReceiptsTabNavigation = exports.pusherBatchStatusUpdate = exports.bulkUploadReceiptsFailure = exports.bulkUploadReceiptsSuccess = exports.updateBulkUploadProgress = exports.bulkUploadReceipts = exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.initialState = exports.initialBulkUploadState = exports.getCompletedTransactionsCacheKey = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
+ const getCompletedTransactionsCacheKey = (periodId, sortKey, sortOrder, subTab) => `completed-${subTab}-${sortKey}-${sortOrder === 'ascending' ? 'asc' : 'desc'}-${periodId}`;
8
+ exports.getCompletedTransactionsCacheKey = getCompletedTransactionsCacheKey;
9
+ exports.initialBulkUploadState = {
10
+ batchDetailsById: {},
11
+ batchDetailsPaginationState: { fetchState: 'Not-Started', error: undefined },
12
+ batchListByPeriod: {},
13
+ batchListFetchState: { fetchState: 'Not-Started', error: undefined },
14
+ batchStatusById: {},
15
+ completedSubTab: 'all',
16
+ completedTransactionsByPeriod: {},
17
+ confirmMatchStatus: { fetchState: 'Not-Started', error: undefined },
18
+ currentBatchId: undefined,
19
+ currentResultsTab: 'unmatched',
20
+ failedBatchDetailIds: [],
21
+ manualSearchUiResetKey: 0,
22
+ manualSearch: {
23
+ fetchState: { fetchState: 'Not-Started', error: undefined },
24
+ isLoadingMore: false,
25
+ nextPageToken: null,
26
+ pageSize: 25,
27
+ results: [],
28
+ searchQuery: '',
29
+ totalCount: 0,
30
+ },
31
+ phase: 'idle',
32
+ sortKey: 'date',
33
+ sortOrder: 'descending',
34
+ uploadProgress: 0,
35
+ uploadStatus: { fetchState: 'Not-Started', error: undefined },
36
+ };
7
37
  exports.initialState = {
38
+ bulkUpload: exports.initialBulkUploadState,
39
+ pendingMissingReceiptsTabNavigation: null,
8
40
  uploadReceiptStatusById: {},
9
41
  refreshStatus: {
10
42
  fetchState: 'Not-Started',
@@ -124,7 +156,376 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
124
156
  clearExpenseAutomationMissingReceiptsView(draft) {
125
157
  Object.assign(draft, exports.initialState);
126
158
  },
159
+ // -- Bulk Upload Actions --
160
+ bulkUploadReceipts: {
161
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
162
+ reducer(draft, _action) {
163
+ draft.bulkUpload.phase = 'uploading';
164
+ draft.bulkUpload.uploadProgress = 0;
165
+ draft.bulkUpload.uploadStatus = {
166
+ fetchState: 'In-Progress',
167
+ error: undefined,
168
+ };
169
+ },
170
+ prepare(files) {
171
+ return { payload: { files } };
172
+ },
173
+ },
174
+ updateBulkUploadProgress(draft, action) {
175
+ draft.bulkUpload.uploadProgress = action.payload;
176
+ },
177
+ bulkUploadReceiptsSuccess(draft, action) {
178
+ draft.bulkUpload.currentBatchId = action.payload.batchId;
179
+ draft.bulkUpload.uploadStatus = {
180
+ fetchState: 'Completed',
181
+ error: undefined,
182
+ };
183
+ draft.bulkUpload.phase = 'matching';
184
+ },
185
+ bulkUploadReceiptsFailure(draft, action) {
186
+ draft.bulkUpload.uploadStatus = {
187
+ fetchState: 'Error',
188
+ error: action.payload.error,
189
+ };
190
+ draft.bulkUpload.phase = 'idle';
191
+ },
192
+ pusherBatchStatusUpdate(draft, action) {
193
+ const batchStatus = action.payload;
194
+ draft.bulkUpload.batchStatusById[batchStatus.batchId] = batchStatus;
195
+ /**
196
+ * Auto-matching banner (`phase === 'matching'`) must clear when the server reports this
197
+ * upload batch is done — otherwise the Missing tab keeps MatchingProgressBanner until
198
+ * batch-details APIs run; EmailUploadBanner should show again for the next upload.
199
+ */
200
+ if (batchStatus.status === 'completed' &&
201
+ draft.bulkUpload.phase === 'matching' &&
202
+ draft.bulkUpload.currentBatchId === batchStatus.batchId) {
203
+ draft.bulkUpload.phase = 'completed';
204
+ }
205
+ },
206
+ requestMissingReceiptsTabNavigation(draft, action) {
207
+ draft.pendingMissingReceiptsTabNavigation = action.payload.tab;
208
+ },
209
+ clearMissingReceiptsTabNavigation(draft) {
210
+ draft.pendingMissingReceiptsTabNavigation = null;
211
+ },
212
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
213
+ fetchBulkUploadBatchDetails(_draft) {
214
+ // trigger epic, no state change needed
215
+ },
216
+ fetchBulkUploadBatchDetailsSuccess(draft, action) {
217
+ const details = action.payload;
218
+ draft.bulkUpload.batchDetailsById[details.batchId] = details;
219
+ draft.bulkUpload.phase = 'completed';
220
+ },
221
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
222
+ fetchBulkUploadBatchDetailsFailure(draft, _action) {
223
+ draft.bulkUpload.phase = 'completed';
224
+ },
225
+ storeBatchDetails(draft, action) {
226
+ const details = action.payload;
227
+ draft.bulkUpload.batchDetailsById[details.batchId] = details;
228
+ /**
229
+ * Multi-batch fetch paths use `storeBatchDetails` (not `fetchBulkUploadBatchDetailsSuccess`).
230
+ * Without this, `phase` stays `matching` after upload forever and the Unmatched tab keeps
231
+ * showing the skeleton (`bulkUploadPhase === 'matching'` in web-components).
232
+ */
233
+ if (draft.bulkUpload.phase === 'matching' &&
234
+ draft.bulkUpload.currentBatchId === details.batchId) {
235
+ draft.bulkUpload.phase = 'completed';
236
+ }
237
+ },
238
+ batchDetailFetchFailed(draft, action) {
239
+ const { batchId } = action.payload;
240
+ if (!draft.bulkUpload.failedBatchDetailIds.includes(batchId)) {
241
+ draft.bulkUpload.failedBatchDetailIds.push(batchId);
242
+ }
243
+ if (draft.bulkUpload.phase === 'matching' &&
244
+ draft.bulkUpload.currentBatchId === batchId) {
245
+ draft.bulkUpload.phase = 'completed';
246
+ }
247
+ },
248
+ setInitialBatchDetailsLoading(draft) {
249
+ draft.bulkUpload.batchDetailsPaginationState = {
250
+ fetchState: 'In-Progress',
251
+ error: undefined,
252
+ };
253
+ },
254
+ fetchMoreBatchDetails(_draft) {
255
+ _draft.bulkUpload.batchDetailsPaginationState = {
256
+ fetchState: 'In-Progress',
257
+ error: undefined,
258
+ };
259
+ },
260
+ fetchMoreBatchDetailsComplete(draft) {
261
+ draft.bulkUpload.batchDetailsPaginationState = {
262
+ fetchState: 'Completed',
263
+ error: undefined,
264
+ };
265
+ const currentId = draft.bulkUpload.currentBatchId;
266
+ const currentDetails = currentId != null
267
+ ? draft.bulkUpload.batchDetailsById[currentId]
268
+ : undefined;
269
+ if (draft.bulkUpload.phase === 'matching' &&
270
+ currentId != null &&
271
+ currentDetails?.status === 'completed') {
272
+ draft.bulkUpload.phase = 'completed';
273
+ }
274
+ },
275
+ fetchMoreBatchDetailsFailure(draft, action) {
276
+ draft.bulkUpload.batchDetailsPaginationState = {
277
+ fetchState: 'Error',
278
+ error: action.payload.error,
279
+ };
280
+ },
281
+ fetchBulkUploadBatches: {
282
+ reducer(draft, action) {
283
+ if (action.payload.invalidateBatchDetailsCache === true) {
284
+ draft.bulkUpload.batchDetailsById = {};
285
+ draft.bulkUpload.failedBatchDetailIds = [];
286
+ }
287
+ draft.bulkUpload.batchListFetchState = {
288
+ fetchState: 'In-Progress',
289
+ error: undefined,
290
+ };
291
+ },
292
+ prepare(input) {
293
+ if (input === true || input === false) {
294
+ return {
295
+ payload: {
296
+ cacheOverride: input === true,
297
+ invalidateBatchDetailsCache: false,
298
+ },
299
+ };
300
+ }
301
+ const o = input ?? {};
302
+ return {
303
+ payload: {
304
+ cacheOverride: o.cacheOverride === true,
305
+ invalidateBatchDetailsCache: o.invalidateBatchDetailsCache === true,
306
+ },
307
+ };
308
+ },
309
+ },
310
+ fetchBulkUploadBatchesSuccess(draft, action) {
311
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
312
+ draft.bulkUpload.batchListByPeriod[periodId] = action.payload.batchList;
313
+ draft.bulkUpload.batchListFetchState = {
314
+ fetchState: 'Completed',
315
+ error: undefined,
316
+ };
317
+ /**
318
+ * When the multi-batch-details epic has nothing to fetch (e.g. list rows not `completed`
319
+ * yet, or details already present), `phase` can stay `matching` even though we already
320
+ * have completed details for `currentBatchId` (from polling / Pusher). Sync so the UI can
321
+ * dismiss the Unmatched skeleton.
322
+ */
323
+ const currentId = draft.bulkUpload.currentBatchId;
324
+ if (draft.bulkUpload.phase === 'matching' &&
325
+ currentId != null) {
326
+ const existing = draft.bulkUpload.batchDetailsById[currentId];
327
+ if (existing?.status === 'completed') {
328
+ draft.bulkUpload.phase = 'completed';
329
+ }
330
+ }
331
+ },
332
+ fetchBulkUploadBatchesFailure(draft, action) {
333
+ draft.bulkUpload.batchListFetchState = {
334
+ fetchState: 'Error',
335
+ error: action.payload.error,
336
+ };
337
+ },
338
+ confirmBulkUploadMatch: {
339
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
340
+ reducer(draft, _action) {
341
+ draft.bulkUpload.confirmMatchStatus = {
342
+ fetchState: 'In-Progress',
343
+ error: undefined,
344
+ };
345
+ },
346
+ prepare(batchId, attachmentId, transactionId, transactionType, fileName) {
347
+ return { payload: { batchId, attachmentId, transactionId, transactionType, fileName } };
348
+ },
349
+ },
350
+ confirmBulkUploadMatchSuccess(draft, action) {
351
+ const { batchId, attachmentId, transactionId } = action.payload;
352
+ draft.bulkUpload.confirmMatchStatus = {
353
+ fetchState: 'Completed',
354
+ error: undefined,
355
+ };
356
+ const details = draft.bulkUpload.batchDetailsById[batchId];
357
+ if (details != null) {
358
+ const file = details.files.find((f) => f.attachmentId === attachmentId);
359
+ if (file != null) {
360
+ const originalStatus = file.status;
361
+ file.status = 'matched';
362
+ file.matchedTransactionId = transactionId;
363
+ file.candidates = undefined;
364
+ details.summary.matched += 1;
365
+ if (originalStatus === 'no_match') {
366
+ details.summary.noMatch = Math.max(0, details.summary.noMatch - 1);
367
+ }
368
+ else {
369
+ details.summary.possibleMatches = Math.max(0, details.summary.possibleMatches - 1);
370
+ }
371
+ }
372
+ }
373
+ draft.bulkUpload.manualSearch = exports.initialBulkUploadState.manualSearch;
374
+ draft.bulkUpload.manualSearchUiResetKey += 1;
375
+ },
376
+ confirmBulkUploadMatchFailure(draft, action) {
377
+ draft.bulkUpload.confirmMatchStatus = {
378
+ fetchState: 'Error',
379
+ error: action.payload.error,
380
+ };
381
+ },
382
+ setBulkUploadResultsTab(draft, action) {
383
+ draft.bulkUpload.currentResultsTab = action.payload;
384
+ },
385
+ setBulkUploadCompletedSubTab(draft, action) {
386
+ draft.bulkUpload.completedSubTab = action.payload;
387
+ },
388
+ setBulkUploadSortConfig(draft, action) {
389
+ draft.bulkUpload.sortKey = action.payload.sortKey;
390
+ draft.bulkUpload.sortOrder = action.payload.sortOrder;
391
+ },
392
+ clearBulkUpload(draft) {
393
+ Object.assign(draft.bulkUpload, exports.initialBulkUploadState);
394
+ draft.pendingMissingReceiptsTabNavigation = null;
395
+ },
396
+ searchTransactionsForManualMatch: {
397
+ reducer(draft, action) {
398
+ const { query, pageToken } = action.payload;
399
+ const isLoadMore = pageToken != null;
400
+ draft.bulkUpload.manualSearch.searchQuery = query;
401
+ if (isLoadMore) {
402
+ draft.bulkUpload.manualSearch.isLoadingMore = true;
403
+ }
404
+ else {
405
+ draft.bulkUpload.manualSearch.isLoadingMore = false;
406
+ draft.bulkUpload.manualSearch.results = [];
407
+ draft.bulkUpload.manualSearch.nextPageToken = null;
408
+ draft.bulkUpload.manualSearch.totalCount = 0;
409
+ draft.bulkUpload.manualSearch.fetchState = {
410
+ fetchState: 'In-Progress',
411
+ error: undefined,
412
+ };
413
+ }
414
+ },
415
+ prepare(query, pageToken) {
416
+ return { payload: { query, pageToken: pageToken ?? undefined } };
417
+ },
418
+ },
419
+ searchTransactionsForManualMatchSuccess(draft, action) {
420
+ const { append, nextPageToken, results, totalCount } = action.payload;
421
+ if (append) {
422
+ const merged = [...draft.bulkUpload.manualSearch.results, ...results];
423
+ const byId = new Map(merged.map((r) => [r.transactionId, r]));
424
+ draft.bulkUpload.manualSearch.results = Array.from(byId.values());
425
+ }
426
+ else {
427
+ draft.bulkUpload.manualSearch.results = results;
428
+ }
429
+ draft.bulkUpload.manualSearch.nextPageToken = nextPageToken;
430
+ draft.bulkUpload.manualSearch.totalCount = totalCount;
431
+ draft.bulkUpload.manualSearch.isLoadingMore = false;
432
+ draft.bulkUpload.manualSearch.fetchState = {
433
+ fetchState: 'Completed',
434
+ error: undefined,
435
+ };
436
+ },
437
+ searchTransactionsForManualMatchFailure(draft, action) {
438
+ draft.bulkUpload.manualSearch.isLoadingMore = false;
439
+ draft.bulkUpload.manualSearch.fetchState = {
440
+ fetchState: 'Error',
441
+ error: action.payload.error,
442
+ };
443
+ },
444
+ clearManualSearchResults(draft) {
445
+ draft.bulkUpload.manualSearch = exports.initialBulkUploadState.manualSearch;
446
+ draft.bulkUpload.manualSearchUiResetKey += 1;
447
+ },
448
+ acknowledgeBulkUploadConfirmMatchComplete(draft) {
449
+ draft.bulkUpload.confirmMatchStatus = {
450
+ fetchState: 'Not-Started',
451
+ error: undefined,
452
+ };
453
+ },
454
+ // -- Completed Transactions Actions --
455
+ fetchCompletedTransactions: {
456
+ reducer(draft, action) {
457
+ const { pageToken } = action.payload;
458
+ if (pageToken != null) {
459
+ const periods = draft.bulkUpload.completedTransactionsByPeriod;
460
+ for (const entry of Object.values(periods)) {
461
+ if (entry.nextPageToken === pageToken) {
462
+ entry.fetchState = {
463
+ fetchState: 'In-Progress',
464
+ error: undefined,
465
+ };
466
+ break;
467
+ }
468
+ }
469
+ }
470
+ },
471
+ prepare(pageToken, cacheOverride) {
472
+ return { payload: { pageToken, cacheOverride } };
473
+ },
474
+ },
475
+ fetchCompletedTransactionsSuccess(draft, action) {
476
+ const { transactionIds, nextPageToken, totalCount, selectedPeriod, isInitialLoad } = action.payload;
477
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
478
+ const cacheKey = (0, exports.getCompletedTransactionsCacheKey)(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
479
+ if (isInitialLoad) {
480
+ draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
481
+ transactionIds,
482
+ nextPageToken,
483
+ totalCount,
484
+ fetchState: { fetchState: 'Completed', error: undefined },
485
+ };
486
+ }
487
+ else {
488
+ const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
489
+ if (existing != null) {
490
+ existing.transactionIds.push(...transactionIds);
491
+ existing.nextPageToken = nextPageToken;
492
+ existing.totalCount = totalCount;
493
+ existing.fetchState = { fetchState: 'Completed', error: undefined };
494
+ }
495
+ else {
496
+ draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
497
+ transactionIds,
498
+ nextPageToken,
499
+ totalCount,
500
+ fetchState: { fetchState: 'Completed', error: undefined },
501
+ };
502
+ }
503
+ }
504
+ },
505
+ fetchCompletedTransactionsFailure(draft, action) {
506
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
507
+ const cacheKey = (0, exports.getCompletedTransactionsCacheKey)(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
508
+ const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
509
+ if (existing != null) {
510
+ existing.fetchState = {
511
+ fetchState: 'Error',
512
+ error: action.payload.error,
513
+ };
514
+ }
515
+ else {
516
+ draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
517
+ fetchState: { fetchState: 'Error', error: action.payload.error },
518
+ nextPageToken: null,
519
+ totalCount: 0,
520
+ transactionIds: [],
521
+ };
522
+ }
523
+ },
127
524
  },
128
525
  });
129
- _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;
526
+ _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,
527
+ // Bulk Upload
528
+ exports.bulkUploadReceipts = _a.bulkUploadReceipts, exports.updateBulkUploadProgress = _a.updateBulkUploadProgress, exports.bulkUploadReceiptsSuccess = _a.bulkUploadReceiptsSuccess, exports.bulkUploadReceiptsFailure = _a.bulkUploadReceiptsFailure, exports.pusherBatchStatusUpdate = _a.pusherBatchStatusUpdate, exports.requestMissingReceiptsTabNavigation = _a.requestMissingReceiptsTabNavigation, exports.clearMissingReceiptsTabNavigation = _a.clearMissingReceiptsTabNavigation, exports.fetchBulkUploadBatchDetails = _a.fetchBulkUploadBatchDetails, 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,
529
+ // Completed Transactions
530
+ exports.fetchCompletedTransactions = _a.fetchCompletedTransactions, exports.fetchCompletedTransactionsSuccess = _a.fetchCompletedTransactionsSuccess, exports.fetchCompletedTransactionsFailure = _a.fetchCompletedTransactionsFailure;
130
531
  exports.default = expenseAutomationMissingReceiptsView.reducer;
@@ -1,4 +1,4 @@
1
- import { FetchState, ID } from '../../../commonStateTypes/common';
1
+ import { FetchState, FetchStateAndError, ID, UpdateType } from '../../../commonStateTypes/common';
2
2
  import { COTTransactionTrackingByTransactionId, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
3
3
  import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
4
4
  import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
@@ -7,7 +7,7 @@ import { ClassBase } from '../../../entity/class/classState';
7
7
  import { CustomerBase } from '../../../entity/customer/customerState';
8
8
  import { Entity } from '../../../entity/genericEntity/entity';
9
9
  import { RecommendationWithCOTByLineId, TransactionID } from '../../../entity/transaction/stateTypes/transaction';
10
- import { SupportedTransaction, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
10
+ import { SupportedTransaction, SupportedTransactionPayload, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
11
11
  import { VendorBase } from '../../../entity/vendor/vendorState';
12
12
  import { ZeniAPIStatus } from '../../../responsePayload';
13
13
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
@@ -158,6 +158,14 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
158
158
  }, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
159
159
  period: TimePeriod;
160
160
  isUncategorizedExpenseCategoryEnabled: boolean | undefined;
161
- }, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>;
161
+ }, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
162
+ selectedTab: "review" | "autoCategorized";
163
+ transactionId: string;
164
+ fetchStatus: FetchStateAndError;
165
+ }, "expenseAutomationTransactionsView/updateTransactionCategorizationUploadReceiptState", never, never>, uploadTransactionCategorizationReceiptSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionPayload: SupportedTransactionPayload, updateType?: UpdateType | undefined], {
166
+ selectedTab: "review" | "autoCategorized";
167
+ transactionPayload: SupportedTransactionPayload;
168
+ updateType: UpdateType;
169
+ }, "expenseAutomationTransactionsView/uploadTransactionCategorizationReceiptSuccess", never, never>;
162
170
  declare const _default: import("redux").Reducer<TransactionsViewState>;
163
171
  export default _default;
@@ -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.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
7
+ exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const get_1 = __importDefault(require("lodash/get"));
10
10
  const uniq_1 = __importDefault(require("lodash/uniq"));
@@ -43,6 +43,7 @@ exports.initialTransactionTabViewState = {
43
43
  transactionIdsBySelectedPeriod: {},
44
44
  selectedCheckBoxTransactionIds: [],
45
45
  transactionIdsWithUnsavedData: [],
46
+ uploadReceiptStatusById: {},
46
47
  selectedTransactionId: undefined,
47
48
  selectedTransactionLineId: undefined,
48
49
  };
@@ -706,6 +707,24 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
706
707
  clearExpenseAutomationTransactionsView(draft) {
707
708
  Object.assign(draft, exports.initialState);
708
709
  },
710
+ updateTransactionCategorizationUploadReceiptState: {
711
+ reducer(draft, action) {
712
+ const { transactionId, fetchStatus, selectedTab } = action.payload;
713
+ draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionId] = fetchStatus;
714
+ },
715
+ prepare(selectedTab, transactionId, fetchStatus) {
716
+ return { payload: { selectedTab, transactionId, fetchStatus } };
717
+ },
718
+ },
719
+ uploadTransactionCategorizationReceiptSuccess: {
720
+ reducer(draft, action) {
721
+ const { transactionPayload, selectedTab } = action.payload;
722
+ draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionPayload.transaction_id] = { fetchState: 'Completed', error: undefined };
723
+ },
724
+ prepare(selectedTab, transactionPayload, updateType = 'merge') {
725
+ return { payload: { selectedTab, transactionPayload, updateType } };
726
+ },
727
+ },
709
728
  syncTransactionCategorizationFromDetailSave: {
710
729
  prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
711
730
  return {
@@ -777,5 +796,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
777
796
  },
778
797
  },
779
798
  });
780
- _a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab;
799
+ _a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
781
800
  exports.default = expenseAutomationTransactionsView.reducer;
@@ -1,9 +1,77 @@
1
1
  import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { SupportedTransaction } from '../../../entity/transaction/transactionState';
4
- import { MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
4
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
5
+ import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, CompletedSubTab, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
6
+ export interface CompletedTransactionsSelectorData {
7
+ fetchState: FetchStateAndError;
8
+ nextPageToken: string | null;
9
+ totalCount: number;
10
+ transactions: SupportedTransaction[];
11
+ }
12
+ export interface ResolvedCandidate {
13
+ matchScore: number;
14
+ transaction: SupportedTransaction;
15
+ }
16
+ export interface ResolvedBatchFile {
17
+ attachmentId: ID;
18
+ batchId: ID;
19
+ fileDownloadUrl: string | null;
20
+ fileId: ID;
21
+ filename: string;
22
+ filePreviewUrl: string | null;
23
+ status: BatchFileStatus;
24
+ candidates?: ResolvedCandidate[];
25
+ matchedTransaction?: SupportedTransaction;
26
+ matchSource?: MatchSource;
27
+ }
28
+ export interface BulkUploadSelectorData {
29
+ batchDetails: ResolvedBatchDetails | undefined;
30
+ batchDetailsPaginationState: FetchStateAndError;
31
+ batchList: BatchListItem[];
32
+ batchListFetchState: FetchStateAndError;
33
+ batchStatus: BatchStatus | undefined;
34
+ completedSubTab: CompletedSubTab;
35
+ completedTransactions: CompletedTransactionsSelectorData;
36
+ confirmMatchStatus: FetchStateAndError;
37
+ currentResultsTab: BulkUploadResultsTab;
38
+ hasMoreBatchDetails: boolean;
39
+ manualSearch: ManualSearchState;
40
+ /** Bumps when manual search state is cleared — remount manual search inputs. */
41
+ manualSearchUiResetKey: number;
42
+ matchedFiles: ResolvedBatchFile[];
43
+ pastBatches: BatchListItem[];
44
+ pastUnmatchedFiles: ResolvedBatchFile[];
45
+ phase: BulkUploadPhase;
46
+ progress: {
47
+ percentage: number;
48
+ processed: number;
49
+ total: number;
50
+ };
51
+ sortKey: BulkUploadSortKey;
52
+ sortOrder: SortOrder;
53
+ unmatchedFiles: ResolvedBatchFile[];
54
+ uploadProgress: number;
55
+ uploadStatus: FetchStateAndError;
56
+ }
57
+ export interface ResolvedBatchDetails {
58
+ batchId: ID;
59
+ createdAt: string;
60
+ files: ResolvedBatchFile[];
61
+ status: string;
62
+ summary: {
63
+ failed: number;
64
+ matched: number;
65
+ noMatch: number;
66
+ possibleMatches: number;
67
+ total: number;
68
+ };
69
+ }
5
70
  export interface ExpenseAutomationMissingReceiptsViewSelector extends SelectorView {
71
+ bulkUpload: BulkUploadSelectorData;
6
72
  completionStatus: CompletionStatusType;
73
+ /** When set, UI should switch bulk-upload sub-tab once (e.g. Unmatched on batch completion). */
74
+ pendingMissingReceiptsTabNavigation: BulkUploadResultsTab | null;
7
75
  refreshStatus: FetchStateAndError;
8
76
  transactions: SupportedTransaction[];
9
77
  uiState: MissingReceiptsViewUIState;
@@ -28,6 +28,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
28
28
  transactions: SupportedTransactionWithCOT[];
29
29
  uiState: TransactionsViewUIState;
30
30
  uncategorizedAccounts: UncategorizedAccounts;
31
+ uploadReceiptStatusById: Record<ID, FetchStateAndError>;
31
32
  selectedTransactionId?: ID;
32
33
  selectedTransactionLineId?: ID;
33
34
  }
@@ -1,3 +1,3 @@
1
1
  import { RootState } from '../../../reducer';
2
- import { ExpenseAutomationMissingReceiptsViewSelector } from '../selectorTypes/missingReceiptsSelectorTypes';
2
+ import type { ExpenseAutomationMissingReceiptsViewSelector } from '../selectorTypes/missingReceiptsSelectorTypes';
3
3
  export declare function getExpenseAutomationMissingReceiptsView(state: RootState): ExpenseAutomationMissingReceiptsViewSelector;