@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
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchBulkUploadBatchDetailsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
9
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
10
+ const fetchBulkUploadBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails.match), (0, operators_1.mergeMap)(() => {
11
+ const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
12
+ const { currentBatchId } = bulkUpload;
13
+ if (currentBatchId == null) {
14
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsFailure)({
15
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'No current batch ID available'),
16
+ }));
17
+ }
18
+ if (!(0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentBatchId)) {
19
+ return rxjs_1.EMPTY;
20
+ }
21
+ return zeniAPI
22
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${currentBatchId}`)
23
+ .pipe((0, operators_1.mergeMap)((response) => {
24
+ if (!(0, responsePayload_1.isSuccessResponse)(response) ||
25
+ response.data == null ||
26
+ !(0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
27
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
+ return rxjs_1.EMPTY;
29
+ }
30
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsFailure)({ error: response.status }));
31
+ }
32
+ const actions = [];
33
+ const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
34
+ if (transactionPayloads.length > 0) {
35
+ actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
36
+ }
37
+ actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
38
+ actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)(true));
39
+ return (0, rxjs_1.from)(actions);
40
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsFailure)({
41
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)),
42
+ }))));
43
+ }));
44
+ exports.fetchBulkUploadBatchDetailsEpic = fetchBulkUploadBatchDetailsEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { ZeniAPI } from '../../../../zeniAPI';
5
+ import { fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess } from '../../reducers/missingReceiptsViewReducer';
6
+ export type ActionType = ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof fetchBulkUploadBatchesFailure>;
7
+ export declare const fetchBulkUploadBatchesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchBulkUploadBatchesEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const responsePayload_1 = require("../../../../responsePayload");
9
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatches.match), (0, operators_1.switchMap)((action) => {
12
+ const { cacheOverride } = action.payload;
13
+ const state = state$.value;
14
+ const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
15
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
17
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
18
+ const existingBatches = bulkUpload.batchListByPeriod[periodId] ?? [];
19
+ if (cacheOverride !== true && existingBatches.length > 0) {
20
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess)({
21
+ batchList: existingBatches,
22
+ selectedPeriod,
23
+ }));
24
+ }
25
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
26
+ const queryParam = {
27
+ start_date: period.start,
28
+ end_date: period.end,
29
+ sort_order: 'desc',
30
+ };
31
+ return zeniAPI
32
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
33
+ .pipe((0, operators_1.mergeMap)((response) => {
34
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
35
+ /** Full list (all statuses) for UI; batch-details epics filter to `completed` only. */
36
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess)({
37
+ batchList: response.data.batches.map(missingReceiptsPayload_1.toBatchListItem),
38
+ selectedPeriod,
39
+ }));
40
+ }
41
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesFailure)({
42
+ error: response.status,
43
+ selectedPeriod,
44
+ }));
45
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesFailure)({
46
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch bulk upload batches errored out: ' +
47
+ JSON.stringify(error)),
48
+ selectedPeriod,
49
+ }))));
50
+ }));
51
+ exports.fetchBulkUploadBatchesEpic = fetchBulkUploadBatchesEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess } from '../../reducers/missingReceiptsViewReducer';
7
+ export type ActionType = ReturnType<typeof fetchCompletedTransactions> | ReturnType<typeof updateTransactions> | ReturnType<typeof fetchCompletedTransactionsSuccess> | ReturnType<typeof fetchCompletedTransactionsFailure>;
8
+ export declare const fetchCompletedTransactionsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchCompletedTransactionsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
+ const responsePayload_1 = require("../../../../responsePayload");
10
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchCompletedTransactions.match), (0, operators_1.switchMap)((action) => {
12
+ const state = state$.value;
13
+ const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
14
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
15
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
16
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
17
+ const isInitialLoad = action.payload.pageToken == null;
18
+ const cacheKey = (0, missingReceiptsViewReducer_1.getCompletedTransactionsCacheKey)(periodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab);
19
+ const existingData = bulkUpload.completedTransactionsByPeriod[cacheKey];
20
+ if (isInitialLoad &&
21
+ action.payload.cacheOverride !== true &&
22
+ existingData != null &&
23
+ existingData.transactionIds.length > 0) {
24
+ return (0, rxjs_1.from)([]);
25
+ }
26
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
27
+ const queryPayload = {
28
+ start_date: period.start,
29
+ end_date: period.end,
30
+ sort_by: bulkUpload.sortKey,
31
+ sort_order: bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc',
32
+ page_token: action.payload.pageToken ?? null,
33
+ page_size: 25,
34
+ };
35
+ if (bulkUpload.completedSubTab !== 'all') {
36
+ queryPayload.match_type = bulkUpload.completedSubTab;
37
+ }
38
+ const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
39
+ return zeniAPI
40
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipt-agent/transactions/completed?query=${encodedQuery}`)
41
+ .pipe((0, operators_1.mergeMap)((response) => {
42
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
43
+ const transactionIds = response.data.transactions.map((t) => t.transaction_id);
44
+ const updateActions = [];
45
+ updateActions.push((0, transactionReducer_1.updateTransactions)(response.data.transactions, (value) => value.transaction_id));
46
+ updateActions.push((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsSuccess)({
47
+ isInitialLoad,
48
+ transactionIds,
49
+ nextPageToken: response.data.next_page_token,
50
+ totalCount: response.data.total_count,
51
+ selectedPeriod,
52
+ }));
53
+ return (0, rxjs_1.from)(updateActions);
54
+ }
55
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsFailure)({
56
+ error: response.status,
57
+ selectedPeriod,
58
+ }));
59
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsFailure)({
60
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch completed transactions errored: ' +
61
+ JSON.stringify(error)),
62
+ selectedPeriod,
63
+ }))));
64
+ }));
65
+ exports.fetchCompletedTransactionsEpic = fetchCompletedTransactionsEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { batchDetailFetchFailed, fetchBulkUploadBatchDetails, fetchBulkUploadBatchesSuccess, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, setInitialBatchDetailsLoading, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
7
+ export type ActionType = ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof fetchMoreBatchDetails> | ReturnType<typeof fetchMoreBatchDetailsComplete> | ReturnType<typeof fetchMoreBatchDetailsFailure> | ReturnType<typeof batchDetailFetchFailed> | ReturnType<typeof setInitialBatchDetailsLoading> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof updateTransactions>;
8
+ export declare const fetchMoreBatchDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchMoreBatchDetailsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const responsePayload_1 = require("../../../../responsePayload");
9
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const fetchMultipleBatchDetailsEpic_1 = require("./fetchMultipleBatchDetailsEpic");
12
+ const MORE_BATCH_PAGE_SIZE = 1;
13
+ const fetchMoreBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchMoreBatchDetails.match),
14
+ /** One page at a time — avoids duplicate loads if IO + scroll fallback both fire. */
15
+ (0, operators_1.exhaustMap)(() => {
16
+ const state = state$.value;
17
+ const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
18
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
20
+ if (selectedPeriod == null) {
21
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
22
+ }
23
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
24
+ const batchList = bulkUpload.batchListByPeriod[periodId] ?? [];
25
+ const failedIds = new Set(bulkUpload.failedBatchDetailIds);
26
+ const unfetchedBatches = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList).filter((batch) => bulkUpload.batchDetailsById[batch.batchId] == null &&
27
+ !failedIds.has(batch.batchId));
28
+ const unfetchedBatchIds = unfetchedBatches.map((batch) => batch.batchId);
29
+ if (unfetchedBatchIds.length === 0) {
30
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
31
+ }
32
+ const nextPage = unfetchedBatchIds.slice(0, MORE_BATCH_PAGE_SIZE);
33
+ return (0, rxjs_1.concat)((0, fetchMultipleBatchDetailsEpic_1.fetchBatchDetailsByIds)(nextPage, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)())).pipe((0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsFailure)({
34
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch more batch details errored out: ' +
35
+ JSON.stringify(error)),
36
+ }))));
37
+ }));
38
+ exports.fetchMoreBatchDetailsEpic = fetchMoreBatchDetailsEpic;
@@ -0,0 +1,9 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { batchDetailFetchFailed, fetchBulkUploadBatchDetails, fetchBulkUploadBatchesSuccess, fetchMoreBatchDetailsComplete, setInitialBatchDetailsLoading, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
7
+ export type ActionType = ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof updateTransactions> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof batchDetailFetchFailed> | ReturnType<typeof setInitialBatchDetailsLoading> | ReturnType<typeof fetchMoreBatchDetailsComplete>;
8
+ export declare function fetchBatchDetailsByIds(batchIds: string[], zeniAPI: ZeniAPI): Observable<ActionType>;
9
+ export declare const fetchMultipleBatchDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchMultipleBatchDetailsEpic = void 0;
4
+ exports.fetchBatchDetailsByIds = fetchBatchDetailsByIds;
5
+ const rxjs_1 = require("rxjs");
6
+ const operators_1 = require("rxjs/operators");
7
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
8
+ const responsePayload_1 = require("../../../../responsePayload");
9
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const INITIAL_BATCH_PAGE_SIZE = 1;
12
+ function fetchBatchDetailsByIds(batchIds, zeniAPI) {
13
+ if (batchIds.length === 0) {
14
+ return rxjs_1.EMPTY;
15
+ }
16
+ return (0, rxjs_1.from)(batchIds).pipe((0, operators_1.mergeMap)((batchId) => zeniAPI
17
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
18
+ .pipe((0, operators_1.mergeMap)((response) => {
19
+ if (!(0, responsePayload_1.isSuccessResponse)(response) ||
20
+ response.data == null ||
21
+ !(0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
22
+ return rxjs_1.EMPTY;
23
+ }
24
+ const actions = [];
25
+ const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
26
+ if (transactionPayloads.length > 0) {
27
+ actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
28
+ }
29
+ actions.push((0, missingReceiptsViewReducer_1.storeBatchDetails)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
30
+ return (0, rxjs_1.from)(actions);
31
+ }), (0, operators_1.catchError)((error) => {
32
+ console.error(`Failed to fetch batch details for ${batchId}:`, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch batch details errored out: ' +
33
+ JSON.stringify(error)));
34
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.batchDetailFetchFailed)({ batchId }));
35
+ })), 5));
36
+ }
37
+ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
38
+ const batchList = action.payload.batchList;
39
+ const { batchDetailsById } = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
40
+ /** Only completed list rows may trigger batch-details API; preserve platform order. */
41
+ const completedBatchesMissingDetails = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList).filter((batch) => batchDetailsById[batch.batchId] == null);
42
+ const completedBatchIds = completedBatchesMissingDetails.map((batch) => batch.batchId);
43
+ const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
44
+ if (batchIdsToFetch.length === 0) {
45
+ /**
46
+ * List refresh can complete while no row is `completed` yet (multi-fetch skips), or
47
+ * `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
48
+ * Fall back to the single-batch-details epic so `phase` and details can resolve.
49
+ */
50
+ const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
51
+ const currentId = bulkUpload.currentBatchId;
52
+ if (currentId != null &&
53
+ bulkUpload.phase === 'matching' &&
54
+ bulkUpload.batchDetailsById[currentId] == null &&
55
+ (0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
56
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails)());
57
+ }
58
+ return rxjs_1.EMPTY;
59
+ }
60
+ return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.setInitialBatchDetailsLoading)()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)()));
61
+ }));
62
+ exports.fetchMultipleBatchDetailsEpic = fetchMultipleBatchDetailsEpic;
@@ -0,0 +1,14 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess } from '../../reducers/missingReceiptsViewReducer';
7
+ /**
8
+ * `auto_categorized` for manual transaction search (Unmatched).
9
+ * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
10
+ * when the expense-automation API documents the intended filter for this flow.
11
+ */
12
+ export declare const MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
13
+ export type ActionType = ReturnType<typeof searchTransactionsForManualMatch> | ReturnType<typeof searchTransactionsForManualMatchSuccess> | ReturnType<typeof searchTransactionsForManualMatchFailure> | ReturnType<typeof updateTransactions>;
14
+ export declare const searchTransactionsForManualMatchEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.searchTransactionsForManualMatchEpic = exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
+ const responsePayload_1 = require("../../../../responsePayload");
10
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
11
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
12
+ const transactionsViewState_1 = require("../../types/transactionsViewState");
13
+ /**
14
+ * `auto_categorized` for manual transaction search (Unmatched).
15
+ * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
16
+ * when the expense-automation API documents the intended filter for this flow.
17
+ */
18
+ exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
19
+ const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
20
+ const searchActions$ = actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.searchTransactionsForManualMatch.match));
21
+ const pagination$ = searchActions$.pipe((0, operators_1.filter)((a) => a.payload.pageToken != null));
22
+ const newSearch$ = searchActions$.pipe((0, operators_1.filter)((a) => a.payload.pageToken == null), (0, operators_1.debounceTime)(300));
23
+ return (0, rxjs_1.merge)(pagination$, newSearch$).pipe((0, operators_1.switchMap)((action) => {
24
+ const { query, pageToken } = action.payload;
25
+ const state = state$.value;
26
+ const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload: { manualSearch, sortKey, sortOrder }, }, } = state;
27
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
28
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
29
+ if (selectedPeriod == null) {
30
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchFailure)({
31
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Manual search requires a selected accounting period.'),
32
+ }));
33
+ }
34
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
35
+ const queryParam = {
36
+ start_date: period.start,
37
+ end_date: period.end,
38
+ auto_categorized: exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED,
39
+ sort_by: (0, transactionsViewState_1.toTransactionsSortKey)(sortKey),
40
+ sort_order: sortOrder === 'ascending' ? 'asc' : 'desc',
41
+ page_token: pageToken ?? null,
42
+ page_size: manualSearch.pageSize,
43
+ search_text: query,
44
+ };
45
+ return zeniAPI
46
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
47
+ .pipe((0, operators_1.mergeMap)((response) => {
48
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
49
+ const { transactions, next_page_token, total_count } = response.data;
50
+ const append = pageToken != null;
51
+ const results = transactions.map(missingReceiptsPayload_1.supportedTransactionPayloadToManualSearchResult);
52
+ const actionsOut = [
53
+ (0, transactionReducer_1.updateTransactions)(transactions, (value) => value.transaction_id, 'merge'),
54
+ (0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchSuccess)({
55
+ append,
56
+ nextPageToken: next_page_token ?? null,
57
+ results,
58
+ totalCount: total_count,
59
+ }),
60
+ ];
61
+ return (0, rxjs_1.from)(actionsOut);
62
+ }
63
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchFailure)({
64
+ error: response.status,
65
+ }));
66
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchFailure)({
67
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Search transactions for manual match errored: ' +
68
+ JSON.stringify(error)),
69
+ }))));
70
+ }));
71
+ };
72
+ exports.searchTransactionsForManualMatchEpic = searchTransactionsForManualMatchEpic;
@@ -15,11 +15,13 @@ const uploadMissingReceiptSuccessEpic = (actions$, state$) => actions$.pipe((0,
15
15
  updateActions.push((0, transactionReducer_1.updateTransaction)(transactionPayload.transaction_id, transactionPayload, updateType));
16
16
  if (currentTenant != null) {
17
17
  const monthEndChecksPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
18
- updateActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
19
- tenantId: currentTenant.tenantId,
20
- period: monthEndChecksPeriod,
21
- refreshViewInBackground: true,
22
- }));
18
+ if (monthEndChecksPeriod != null) {
19
+ updateActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
20
+ tenantId: currentTenant.tenantId,
21
+ period: monthEndChecksPeriod,
22
+ refreshViewInBackground: true,
23
+ }));
24
+ }
23
25
  }
24
26
  return (0, rxjs_1.from)(updateActions);
25
27
  }));
@@ -0,0 +1,13 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation } from '../../reducers/missingReceiptsViewReducer';
7
+ export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof pusherBatchStatusUpdate> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof requestMissingReceiptsTabNavigation> | ReturnType<typeof updateTransactions> | ReturnType<typeof clearBulkUpload>;
8
+ /**
9
+ * On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs),
10
+ * and request switching to the Unmatched tab. Debounced to reduce duplicate refreshes.
11
+ */
12
+ export declare const pusherBatchStatusCompletionEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
13
+ export declare const pollBulkUploadBatchStatusEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pollBulkUploadBatchStatusEpic = exports.pusherBatchStatusCompletionEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
9
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
10
+ /** First poll after upload; then interval while batch not resolved via Pusher or API. */
11
+ const FALLBACK_FIRST_DELAY_MS = 30000;
12
+ const FALLBACK_POLL_INTERVAL_MS = 10000;
13
+ /**
14
+ * On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs),
15
+ * and request switching to the Unmatched tab. Debounced to reduce duplicate refreshes.
16
+ */
17
+ 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)([
18
+ (0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({
19
+ cacheOverride: true,
20
+ invalidateBatchDetailsCache: true,
21
+ }),
22
+ (0, missingReceiptsViewReducer_1.requestMissingReceiptsTabNavigation)({ tab: 'unmatched' }),
23
+ ])));
24
+ exports.pusherBatchStatusCompletionEpic = pusherBatchStatusCompletionEpic;
25
+ const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
26
+ const { batchId } = action.payload;
27
+ return (0, rxjs_1.timer)(FALLBACK_FIRST_DELAY_MS, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((a) => a.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((a) => a.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
28
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
29
+ .pipe((0, operators_1.mergeMap)((response) => {
30
+ /** Same batch-details URL; polls until `status` is completed (Pusher may win first). */
31
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
32
+ if ((0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
33
+ const actions = [];
34
+ const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
35
+ if (transactionPayloads.length > 0) {
36
+ actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
37
+ }
38
+ actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
39
+ actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)(true));
40
+ actions.push((0, missingReceiptsViewReducer_1.requestMissingReceiptsTabNavigation)({ tab: 'unmatched' }));
41
+ return (0, rxjs_1.from)(actions);
42
+ }
43
+ }
44
+ return rxjs_1.EMPTY;
45
+ }), (0, operators_1.catchError)(() => (0, rxjs_1.of)()))));
46
+ }));
47
+ exports.pollBulkUploadBatchStatusEpic = pollBulkUploadBatchStatusEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { updateTransaction } from '../../../../entity/transaction/transactionReducer';
3
+ import { RootState } from '../../../../reducer';
4
+ import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
5
+ import { uploadTransactionCategorizationReceiptSuccess } from '../../reducers/transactionsViewReducer';
6
+ export type ActionType = ReturnType<typeof uploadTransactionCategorizationReceiptSuccess> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateTransaction>;
7
+ export declare const uploadTransactionReceiptSuccessEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadTransactionReceiptSuccessEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
7
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
8
+ const monthEndCloseChecksViewReducer_1 = require("../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer");
9
+ const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
10
+ const uploadTransactionReceiptSuccessEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.uploadTransactionCategorizationReceiptSuccess.match), (0, operators_1.mergeMap)((action) => {
11
+ const { transactionPayload, updateType } = action.payload;
12
+ const updateActions = [];
13
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
14
+ const selectedPeriodByTenantId = state$.value.expenseAutomationViewState.selectedPeriodByTenantId;
15
+ updateActions.push((0, transactionReducer_1.updateTransaction)(transactionPayload.transaction_id, transactionPayload, updateType));
16
+ if (currentTenant != null) {
17
+ const monthEndChecksPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
18
+ if (monthEndChecksPeriod != null) {
19
+ updateActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
20
+ tenantId: currentTenant.tenantId,
21
+ period: monthEndChecksPeriod,
22
+ refreshViewInBackground: true,
23
+ }));
24
+ }
25
+ }
26
+ return (0, rxjs_1.from)(updateActions);
27
+ }));
28
+ exports.uploadTransactionReceiptSuccessEpic = uploadTransactionReceiptSuccessEpic;
@@ -37,7 +37,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
37
37
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
38
38
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
39
39
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
40
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
40
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
41
41
  messageText: "notification" | "success" | "failed";
42
42
  type: "error" | "success" | "info";
43
43
  variables: {