@zeniai/client-epic-state 4.20.3-betaVR4 → 4.20.3

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 (38) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  3. package/lib/epic.d.ts +1 -3
  4. package/lib/epic.js +1 -3
  5. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
  6. package/lib/esm/epic.js +2 -4
  7. package/lib/esm/index.js +2 -2
  8. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +4 -7
  9. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +13 -7
  10. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +5 -40
  11. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -9
  12. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +3 -20
  13. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -1
  14. package/lib/index.d.ts +2 -2
  15. package/lib/index.js +32 -34
  16. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  17. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +3 -6
  18. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +13 -7
  19. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -9
  20. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -40
  21. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  22. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -5
  23. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -10
  24. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -6
  25. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +4 -21
  26. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +0 -1
  27. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -1
  28. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -4
  29. package/package.json +2 -2
  30. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +0 -12
  31. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreAutomatchingOnBatchListLoadEpic.js +0 -47
  32. package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +0 -13
  33. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +0 -10
  34. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +0 -16
  35. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreAutomatchingOnBatchListLoadEpic.d.ts +0 -13
  36. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreAutomatchingOnBatchListLoadEpic.js +0 -51
  37. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +0 -7
  38. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +0 -16
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.restoreAutomatchingOnBatchListLoadEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
8
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
- /**
10
- * After the batch list loads on hard refresh / revisit, confirm the in-flight batch via
11
- * `GET /batches/:id`: only restore automatching when details `user_id` matches the logged-in user
12
- * and status is still pending/processing. Tries list rows in platform order (newest first when the
13
- * list API uses desc sort) until one matches.
14
- */
15
- const restoreAutomatchingOnBatchListLoadEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
16
- const state = state$.value;
17
- const { bulkUpload } = state.expenseAutomationMissingReceiptsViewState;
18
- if (bulkUpload.phase !== 'idle') {
19
- return rxjs_1.EMPTY;
20
- }
21
- const loggedInUserId = state.tenantState.loggedInUser?.userId;
22
- if (loggedInUserId == null) {
23
- return rxjs_1.EMPTY;
24
- }
25
- const processingBatches = action.payload.batchList.filter((b) => {
26
- const status = b.status.toLowerCase();
27
- return status === 'processing' || status === 'pending';
28
- });
29
- if (processingBatches.length === 0) {
30
- return rxjs_1.EMPTY;
31
- }
32
- const baseUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/`;
33
- return (0, rxjs_1.from)(processingBatches).pipe((0, operators_1.concatMap)((batch) => zeniAPI.getJSON(`${baseUrl}${batch.batchId}`).pipe((0, operators_1.mergeMap)((response) => {
34
- if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
35
- return rxjs_1.EMPTY;
36
- }
37
- const data = response.data;
38
- const detailsUserId = data.user_id;
39
- if (detailsUserId == null || detailsUserId !== loggedInUserId) {
40
- return rxjs_1.EMPTY;
41
- }
42
- if (!(0, missingReceiptsPayload_1.isBatchDetailsStatusPendingOrProcessing)(data.status)) {
43
- return rxjs_1.EMPTY;
44
- }
45
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.restoreBulkUploadMatchingState)({
46
- batchId: batch.batchId,
47
- totalFiles: batch.totalFiles,
48
- }));
49
- }), (0, operators_1.catchError)(() => rxjs_1.EMPTY))), (0, operators_1.take)(1));
50
- }));
51
- exports.restoreAutomatchingOnBatchListLoadEpic = restoreAutomatchingOnBatchListLoadEpic;
@@ -1,7 +0,0 @@
1
- /**
2
- * Local calendar dates from (end − (days − 1)) through end, inclusive.
3
- */
4
- export declare function rollingCalendarDateRangeInclusive(days: number): {
5
- end: string;
6
- start: string;
7
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rollingCalendarDateRangeInclusive = rollingCalendarDateRangeInclusive;
4
- const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
5
- const zeniDayJS_1 = require("../../../zeniDayJS");
6
- /**
7
- * Local calendar dates from (end − (days − 1)) through end, inclusive.
8
- */
9
- function rollingCalendarDateRangeInclusive(days) {
10
- const end = (0, zeniDayJS_1.dateNow)().startOf('day');
11
- const start = end.subtract(days - 1, 'day');
12
- return {
13
- end: end.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
14
- start: start.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
15
- };
16
- }