@zeniai/client-epic-state 4.19.88-betaVR3 → 4.19.89
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.
- package/lib/entity/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountPayload.js +0 -2
- package/lib/entity/account/accountState.d.ts +0 -2
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +1 -8
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -11
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -3
- package/lib/epic.d.ts +1 -13
- package/lib/epic.js +1 -13
- package/lib/esm/entity/account/accountPayload.js +0 -2
- package/lib/esm/entity/depositAccount/depositAccount.js +1 -8
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -11
- package/lib/esm/epic.js +1 -13
- package/lib/esm/index.js +5 -11
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +1 -189
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -433
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -23
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -244
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -44
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
- package/lib/esm/zeniAPI.js +2 -0
- package/lib/index.d.ts +7 -12
- package/lib/index.js +32 -88
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
- package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -18
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -118
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -201
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -76
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -434
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -11
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -24
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -69
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -243
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -142
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -54
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
- package/lib/zeniAPI.js +2 -0
- package/package.json +1 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +0 -10
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -29
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -40
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -47
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -33
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -56
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -77
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -79
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -24
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
- package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +0 -10
- package/lib/view/expenseAutomationView/bulkUploadTiming.js +0 -13
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -18
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -33
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -44
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -51
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -65
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -37
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -61
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -14
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -81
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -25
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -85
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -28
package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pollBulkUploadBatchStatusEpic = exports.bulkUploadAutomatchingTimeoutEpic = exports.pusherBatchStatusCompletionEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const bulkUploadTiming_1 = require("../../bulkUploadTiming");
|
|
10
|
-
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
11
|
-
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
12
|
-
/** First poll after upload; then interval while batch not resolved via Pusher or API. */
|
|
13
|
-
const FALLBACK_FIRST_DELAY_MS = 30000;
|
|
14
|
-
const FALLBACK_POLL_INTERVAL_MS = 10000;
|
|
15
|
-
/**
|
|
16
|
-
* On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs),
|
|
17
|
-
* and request switching to the Unmatched tab. Debounced to reduce duplicate refreshes.
|
|
18
|
-
*/
|
|
19
|
-
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)([
|
|
20
|
-
(0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({
|
|
21
|
-
cacheOverride: true,
|
|
22
|
-
invalidateBatchDetailsCache: true,
|
|
23
|
-
}),
|
|
24
|
-
(0, missingReceiptsViewReducer_1.requestMissingReceiptsTabNavigation)({ tab: 'unmatched' }),
|
|
25
|
-
])));
|
|
26
|
-
exports.pusherBatchStatusCompletionEpic = pusherBatchStatusCompletionEpic;
|
|
27
|
-
/**
|
|
28
|
-
* If Pusher and batch-details are delayed beyond {@link BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS},
|
|
29
|
-
* force `phase` to `completed` (dismiss automatching banner) and refresh the batch list.
|
|
30
|
-
* Cancels when the batch completes normally, bulk state is cleared, or another upload supersedes.
|
|
31
|
-
*/
|
|
32
|
-
const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
33
|
-
const { batchId } = action.payload;
|
|
34
|
-
return (0, rxjs_1.timer)(bulkUploadTiming_1.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS).pipe((0, operators_1.mergeMap)(() => {
|
|
35
|
-
const bulk = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
36
|
-
if (bulk.phase !== 'matching' || bulk.currentBatchId !== batchId) {
|
|
37
|
-
return rxjs_1.EMPTY;
|
|
38
|
-
}
|
|
39
|
-
return (0, rxjs_1.from)([
|
|
40
|
-
(0, missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut)(batchId),
|
|
41
|
-
(0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({ cacheOverride: true }),
|
|
42
|
-
]);
|
|
43
|
-
}), (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 &&
|
|
44
|
-
a.payload.status === 'completed')), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((a) => a.payload.batchId === batchId)))));
|
|
45
|
-
}));
|
|
46
|
-
exports.bulkUploadAutomatchingTimeoutEpic = bulkUploadAutomatchingTimeoutEpic;
|
|
47
|
-
/**
|
|
48
|
-
* Fallback polling when Pusher is slow or unavailable. Network errors on a poll tick show one
|
|
49
|
-
* error snackbar per upload session (first failure only) so the user is not spammed every
|
|
50
|
-
* interval; Pusher or a later successful poll still completes the flow.
|
|
51
|
-
*/
|
|
52
|
-
const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
53
|
-
const { batchId } = action.payload;
|
|
54
|
-
let pollErrorNotified = false;
|
|
55
|
-
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)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
|
|
56
|
-
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
|
|
57
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
58
|
-
/** Same batch-details URL; polls until `status` is completed (Pusher may win first). */
|
|
59
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
60
|
-
if ((0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
|
|
61
|
-
const actions = [];
|
|
62
|
-
const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
|
|
63
|
-
if (transactionPayloads.length > 0) {
|
|
64
|
-
actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
|
|
65
|
-
}
|
|
66
|
-
actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
|
|
67
|
-
actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({ cacheOverride: true }));
|
|
68
|
-
actions.push((0, missingReceiptsViewReducer_1.requestMissingReceiptsTabNavigation)({ tab: 'unmatched' }));
|
|
69
|
-
return (0, rxjs_1.from)(actions);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return rxjs_1.EMPTY;
|
|
73
|
-
}), (0, operators_1.catchError)(() => {
|
|
74
|
-
if (!pollErrorNotified) {
|
|
75
|
-
pollErrorNotified = true;
|
|
76
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
77
|
-
messageSection: 'receipts_upload',
|
|
78
|
-
messageText: 'failed',
|
|
79
|
-
type: 'error',
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
return rxjs_1.EMPTY;
|
|
83
|
-
}))));
|
|
84
|
-
}));
|
|
85
|
-
exports.pollBulkUploadBatchStatusEpic = pollBulkUploadBatchStatusEpic;
|
|
@@ -1,7 +0,0 @@
|
|
|
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>;
|
|
@@ -1,28 +0,0 @@
|
|
|
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;
|