@zeniai/client-epic-state 4.19.88 → 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/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/epic.d.ts +1 -12
- package/lib/epic.js +1 -12
- 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/epic.js +1 -12
- package/lib/esm/index.js +3 -9
- 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/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/zeniAPI.js +2 -0
- package/lib/index.d.ts +4 -7
- package/lib/index.js +32 -82
- package/lib/tsconfig.typecheck.tsbuildinfo +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/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/zeniAPI.js +2 -0
- package/package.json +1 -1
- 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/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/esm/index.js
CHANGED
|
@@ -163,13 +163,12 @@ import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType
|
|
|
163
163
|
import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
|
|
164
164
|
import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
|
|
165
165
|
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
166
|
-
import {
|
|
166
|
+
import { fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
167
167
|
import { deleteAccountStatement, fetchReconciliation as fetchReconciliationView, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateStatementUploadChosen, uploadAccountStatement, } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
|
|
168
|
-
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState,
|
|
168
|
+
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
169
169
|
import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
|
|
170
170
|
import { getExpenseAutomationReconciliationView, isAccountReconReport, } from './view/expenseAutomationView/selectors/reconciliationViewSelector';
|
|
171
171
|
import { getExpenseAutomationTransactionView } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
172
|
-
import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
173
172
|
import { toMissingReceiptsSortKey as toExpenseAutomationMissingReceiptsSortKey, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
174
173
|
import { toReconciliationTabsType, } from './view/expenseAutomationView/types/reconciliationViewState';
|
|
175
174
|
import { toTransactionsTabKey as toExpenseAutomationTransactionsTabKey, toTransactionsSortKey, } from './view/expenseAutomationView/types/transactionsViewState';
|
|
@@ -416,11 +415,7 @@ export { newBalancesFilterClassesView };
|
|
|
416
415
|
export { toCOABalanceTypeStrict, toCOABalanceType as toCOABlanaceType, isCalculatedBalanceType, };
|
|
417
416
|
export { stringToUnion, stringToUnionStrict };
|
|
418
417
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
|
|
419
|
-
export {
|
|
420
|
-
// Bulk Upload Types
|
|
421
|
-
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts,
|
|
422
|
-
// Bulk Upload Actions
|
|
423
|
-
bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
418
|
+
export { getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
424
419
|
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
|
|
425
420
|
export { TOP_EX_TIME_PERIODS };
|
|
426
421
|
export { toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, };
|
|
@@ -612,6 +607,5 @@ export { fetchTreasuryStatementList } from './view/spendManagement/treasury/trea
|
|
|
612
607
|
export { getTreasuryStatements, } from './view/spendManagement/treasury/treasuryStatementList/treasuryStatementListSelector';
|
|
613
608
|
export { fetchTreasuryTaxLetterList } from './view/spendManagement/treasury/treasuryTaxLetterList/treasuryTaxLetterListReducer';
|
|
614
609
|
export { getTreasuryTaxLetters, } from './view/spendManagement/treasury/treasuryTaxLetterList/treasuryTaxLetterListSelector';
|
|
615
|
-
export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS, } from './view/expenseAutomationView/bulkUploadTiming';
|
|
616
610
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
617
611
|
export { getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js
CHANGED
|
@@ -12,13 +12,11 @@ export const uploadMissingReceiptSuccessEpic = (actions$, state$) => actions$.pi
|
|
|
12
12
|
updateActions.push(updateTransaction(transactionPayload.transaction_id, transactionPayload, updateType));
|
|
13
13
|
if (currentTenant != null) {
|
|
14
14
|
const monthEndChecksPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
15
|
+
updateActions.push(fetchMonthEndCloseChecks({
|
|
16
|
+
tenantId: currentTenant.tenantId,
|
|
17
|
+
period: monthEndChecksPeriod,
|
|
18
|
+
refreshViewInBackground: true,
|
|
19
|
+
}));
|
|
22
20
|
}
|
|
23
21
|
return from(updateActions);
|
|
24
22
|
}));
|
|
@@ -1,189 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { toAmount } from '../../../commonStateTypes/amount';
|
|
3
|
-
import { getTransactionPayloadAmount, } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
4
|
-
import { toBatchFileStatus, toBatchStatusValue, toMatchSource, } from '../types/missingReceiptsViewState';
|
|
5
|
-
// -- Converter functions --
|
|
6
|
-
/**
|
|
7
|
-
* Maps batch-details API `files[].status` strings to canonical {@link BatchFileStatus}.
|
|
8
|
-
* Legacy aliases are supported during rollout; unknown strings map to `failed` so Redux never
|
|
9
|
-
* holds untyped status values.
|
|
10
|
-
*/
|
|
11
|
-
export function parseBatchFileStatus(raw) {
|
|
12
|
-
const normalizedStatus = raw.trim().toLowerCase().replace(/-/g, '_');
|
|
13
|
-
switch (normalizedStatus) {
|
|
14
|
-
case 'exact_match':
|
|
15
|
-
case 'matched':
|
|
16
|
-
return 'exact_match';
|
|
17
|
-
case 'possible_matches':
|
|
18
|
-
case 'possible_match':
|
|
19
|
-
case 'possiblematch':
|
|
20
|
-
case 'un_matched':
|
|
21
|
-
case 'unmatched':
|
|
22
|
-
return 'possible_matches';
|
|
23
|
-
case 'no_match':
|
|
24
|
-
case 'nomatch':
|
|
25
|
-
return 'no_match';
|
|
26
|
-
case 'failed':
|
|
27
|
-
return 'failed';
|
|
28
|
-
default:
|
|
29
|
-
return 'failed';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export function toBatchFile(payload, filesEndPoint) {
|
|
33
|
-
return {
|
|
34
|
-
attachmentId: payload.attachment_id,
|
|
35
|
-
candidates: payload.candidates?.map((candidate) => ({
|
|
36
|
-
transactionId: candidate.transaction_id,
|
|
37
|
-
matchScore: candidate.match_score,
|
|
38
|
-
})),
|
|
39
|
-
fileDownloadUrl: payload.file_id != null && filesEndPoint != null
|
|
40
|
-
? `${filesEndPoint}/1.0/files/${payload.file_id}?query=${encodeURIComponent(JSON.stringify({ download_file: true }))}`
|
|
41
|
-
: null,
|
|
42
|
-
fileId: payload.file_id,
|
|
43
|
-
filePreviewUrl: payload.file_preview_url,
|
|
44
|
-
filename: payload.filename,
|
|
45
|
-
matchSource: payload.match_source != null
|
|
46
|
-
? toMatchSource(payload.match_source)
|
|
47
|
-
: undefined,
|
|
48
|
-
matchedTransactionId: payload.matched_transaction?.transaction_id,
|
|
49
|
-
status: toBatchFileStatus(payload.status),
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export function extractTransactionPayloadsFromBatchFiles(files) {
|
|
53
|
-
const seen = new Set();
|
|
54
|
-
const payloads = [];
|
|
55
|
-
for (const file of files) {
|
|
56
|
-
if (file.matched_transaction != null) {
|
|
57
|
-
const id = file.matched_transaction.transaction_id;
|
|
58
|
-
if (!seen.has(id)) {
|
|
59
|
-
seen.add(id);
|
|
60
|
-
payloads.push(matchedTransactionPayloadToSupportedTransactionPayload(file.matched_transaction));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (file.candidates != null) {
|
|
64
|
-
for (const candidate of file.candidates) {
|
|
65
|
-
const id = candidate.transaction_id;
|
|
66
|
-
if (!seen.has(id)) {
|
|
67
|
-
seen.add(id);
|
|
68
|
-
payloads.push(matchedTransactionPayloadToSupportedTransactionPayload(candidate));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return payloads;
|
|
74
|
-
}
|
|
75
|
-
function matchedTransactionPayloadToSupportedTransactionPayload(payload) {
|
|
76
|
-
return {
|
|
77
|
-
transaction_id: payload.transaction_id,
|
|
78
|
-
transaction_type: payload.transaction_type ?? 'expense',
|
|
79
|
-
transaction_date: payload.transaction_date ?? '',
|
|
80
|
-
currency_code: payload.currency_code,
|
|
81
|
-
total_amount: payload.amount,
|
|
82
|
-
vendor_name: payload.vendor_name,
|
|
83
|
-
logo: payload.vendor_logo == null ? undefined : toURL(payload.vendor_logo),
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export function toBatchSummary(payload) {
|
|
87
|
-
return {
|
|
88
|
-
failed: payload.failed,
|
|
89
|
-
matched: payload.matched,
|
|
90
|
-
noMatch: payload.no_match,
|
|
91
|
-
possibleMatches: payload.possible_matches,
|
|
92
|
-
total: payload.total,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
export function toBatchDetails(payload, filesEndPoint) {
|
|
96
|
-
return {
|
|
97
|
-
batchId: payload.batch_id,
|
|
98
|
-
createdAt: payload.created_at,
|
|
99
|
-
files: payload.files.map((file) => toBatchFile(file, filesEndPoint)),
|
|
100
|
-
status: toBatchStatusValue(payload.status),
|
|
101
|
-
summary: toBatchSummary(payload.summary),
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/** Batch list `status` is a string from the API — compare case-insensitively. */
|
|
105
|
-
export function isBatchListStatusCompleted(status) {
|
|
106
|
-
return status.toLowerCase() === 'completed';
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Subset of the get-all-batches (`/batches?query=...`) list that is eligible for
|
|
110
|
-
* `GET /batches/:batchId` details fetches. The stored list may include pending, failed, or other
|
|
111
|
-
* statuses for UI; only `completed` rows should trigger batch-details requests.
|
|
112
|
-
*/
|
|
113
|
-
export function filterBatchListItemsForBatchDetailsFetch(batches) {
|
|
114
|
-
return batches.filter((batch) => isBatchListStatusCompleted(batch.status));
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Batch details API response `status` field — only completed payloads should be stored from
|
|
118
|
-
* multi-batch fetch paths (list can be briefly stale vs. live processing state).
|
|
119
|
-
*/
|
|
120
|
-
export function isBatchDetailsApiStatusCompleted(status) {
|
|
121
|
-
return status.toLowerCase() === 'completed';
|
|
122
|
-
}
|
|
123
|
-
export function findBatchListItemForBatchId(batchListByPeriod, batchId) {
|
|
124
|
-
for (const list of Object.values(batchListByPeriod)) {
|
|
125
|
-
const found = list.find((batch) => batch.batchId === batchId);
|
|
126
|
-
if (found != null) {
|
|
127
|
-
return found;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return undefined;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Whether it is appropriate to call `GET .../batches/:id` for details.
|
|
134
|
-
* Skips when live batch status or batch list row indicates the batch is not completed yet.
|
|
135
|
-
* When status is unknown in both sources, allows the request (e.g. dispatch before list refresh).
|
|
136
|
-
*/
|
|
137
|
-
export function shouldFetchBatchDetailsForBatchId(batchStatusById, batchListByPeriod, batchId) {
|
|
138
|
-
const live = batchStatusById[batchId]?.status;
|
|
139
|
-
if (live === 'completed') {
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
if (live === 'pending' || live === 'processing') {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
const listItem = findBatchListItemForBatchId(batchListByPeriod, batchId);
|
|
146
|
-
if (listItem != null && !isBatchListStatusCompleted(listItem.status)) {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
return true;
|
|
150
|
-
}
|
|
151
|
-
export function toBatchListItem(payload) {
|
|
152
|
-
return {
|
|
153
|
-
batchId: payload.batch_id,
|
|
154
|
-
createdAt: payload.created_at,
|
|
155
|
-
failedCount: payload.failed_count,
|
|
156
|
-
matchedCount: payload.matched_count,
|
|
157
|
-
noMatchCount: payload.no_match_count,
|
|
158
|
-
possibleMatchesCount: payload.possible_matches_count,
|
|
159
|
-
status: payload.status,
|
|
160
|
-
totalFiles: payload.total_files,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Amount shown in the Unmatched tab manual-search list: **first line only** when `lines` exist.
|
|
165
|
-
* Falls back to transaction-level totals via {@link getTransactionPayloadAmount} when there is
|
|
166
|
-
* no line or no line amount (same currency fields as the rest of the transaction payload).
|
|
167
|
-
*/
|
|
168
|
-
function getManualSearchListAmountFromPayload(payload) {
|
|
169
|
-
const lineAmount = payload.lines?.[0]?.amount;
|
|
170
|
-
if (lineAmount != null) {
|
|
171
|
-
return toAmount(lineAmount, payload.currency_code, payload.currency_symbol);
|
|
172
|
-
}
|
|
173
|
-
return getTransactionPayloadAmount(payload);
|
|
174
|
-
}
|
|
175
|
-
/** Maps expense-automation transaction rows to manual-search list rows (Unmatched tab). */
|
|
176
|
-
export function supportedTransactionPayloadToManualSearchResult(payload) {
|
|
177
|
-
const amountPayload = getManualSearchListAmountFromPayload(payload);
|
|
178
|
-
return {
|
|
179
|
-
amount: amountPayload.amount,
|
|
180
|
-
currencyCode: amountPayload.currencyCode,
|
|
181
|
-
entityId: payload.vendor_id ?? payload.customer_id ?? '',
|
|
182
|
-
memo: payload.transaction_memo ?? '',
|
|
183
|
-
transactionDate: payload.transaction_date,
|
|
184
|
-
transactionId: payload.transaction_id,
|
|
185
|
-
transactionType: payload.transaction_type,
|
|
186
|
-
vendorName: payload.vendor_name ?? '',
|
|
187
|
-
vendorLogo: toURL(payload.logo)?.href,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
1
|
+
export {};
|