@zeniai/client-epic-state 4.20.7 → 4.20.8
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/commonStateTypes/coaBalance/additionalBalances/getSummationBalance.d.ts +1 -1
- package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +2 -0
- package/lib/commonStateTypes/coaBalance/coaBalanceType.js +6 -0
- package/lib/commonStateTypes/currencyHelper.d.ts +3 -0
- package/lib/commonStateTypes/currencyHelper.js +6 -1
- package/lib/commonStateTypes/reduceFetchState.d.ts +9 -0
- package/lib/commonStateTypes/reduceFetchState.js +26 -0
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountPayload.js +2 -0
- package/lib/entity/account/accountState.d.ts +2 -0
- package/lib/entity/customer/customerState.d.ts +0 -2
- package/lib/entity/customer/customerState.js +0 -5
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +8 -1
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -0
- package/lib/entity/reimbursement/reimbursementPayload.js +7 -0
- package/lib/entity/reimbursement/reimbursementState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/task/taskPayload.d.ts +1 -0
- package/lib/entity/task/taskPayload.js +1 -0
- package/lib/entity/task/taskState.d.ts +1 -0
- package/lib/entity/userGroups/userGroupsPayload.d.ts +7 -0
- package/lib/entity/userGroups/userGroupsPayload.js +10 -0
- package/lib/entity/userGroups/userGroupsReducer.d.ts +8 -0
- package/lib/entity/userGroups/userGroupsReducer.js +29 -0
- package/lib/entity/userGroups/userGroupsSelector.d.ts +4 -0
- package/lib/entity/userGroups/userGroupsSelector.js +12 -0
- package/lib/entity/userGroups/userGroupsState.d.ts +9 -0
- package/lib/entity/userGroups/userGroupsState.js +2 -0
- package/lib/epic.d.ts +15 -1
- package/lib/epic.js +15 -1
- package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +5 -0
- package/lib/esm/commonStateTypes/currencyHelper.js +5 -0
- package/lib/esm/commonStateTypes/reduceFetchState.js +25 -0
- package/lib/esm/entity/account/accountPayload.js +2 -0
- package/lib/esm/entity/customer/customerState.js +1 -4
- package/lib/esm/entity/depositAccount/depositAccount.js +8 -1
- package/lib/esm/entity/reimbursement/reimbursementPayload.js +7 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/task/taskPayload.js +1 -0
- package/lib/esm/entity/userGroups/userGroupsPayload.js +7 -0
- package/lib/esm/entity/userGroups/userGroupsReducer.js +25 -0
- package/lib/esm/entity/userGroups/userGroupsSelector.js +8 -0
- package/lib/esm/entity/userGroups/userGroupsState.js +1 -0
- package/lib/esm/epic.js +15 -1
- package/lib/esm/index.js +19 -10
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
- package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +29 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +49 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +56 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +71 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +86 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
- package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +198 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +456 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +23 -1
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +245 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +44 -0
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/esm/view/financeStatement/financeStatementReducer.js +11 -8
- package/lib/esm/view/financeStatement/financeStatementSelector.js +24 -9
- package/lib/esm/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +17 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +331 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +9 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
- package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +262 -0
- package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +9 -7
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +3 -1
- package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +65 -0
- package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +16 -0
- package/lib/esm/view/userGroupListView/userGroupListViewState.js +1 -0
- package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +11 -0
- package/lib/esm/zeniAPI.js +0 -2
- package/lib/index.d.ts +20 -12
- package/lib/index.js +97 -34
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +33 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +37 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +61 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +75 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +25 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +92 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
- package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
- package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
- package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +123 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +211 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +86 -3
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +457 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +24 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +70 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +244 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +146 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +54 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/view/financeStatement/financeStatementReducer.js +11 -8
- package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
- package/lib/view/financeStatement/financeStatementSelector.js +24 -9
- package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.d.ts +9 -0
- package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +20 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +15 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +335 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +111 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +13 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +4 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +7 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +4 -0
- package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +6 -0
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +265 -0
- package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +8 -6
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +1 -0
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -0
- package/lib/view/taskManager/taskListView/taskListSelector.js +3 -1
- package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
- package/lib/view/userGroupListView/userGroupListViewReducer.js +69 -0
- package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +7 -0
- package/lib/view/userGroupListView/userGroupListViewSelector.js +20 -0
- package/lib/view/userGroupListView/userGroupListViewState.d.ts +8 -0
- package/lib/view/userGroupListView/userGroupListViewState.js +2 -0
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +3 -1
- package/lib/view/userListView/fetchUserListByTypeEpic.js +11 -0
- package/lib/view/userListView/userListViewPayload.d.ts +2 -0
- package/lib/zeniAPI.js +0 -2
- package/package.json +3 -3
package/lib/esm/index.js
CHANGED
|
@@ -2,9 +2,10 @@ import { isAllowedValueWithCode, isAllowedValueWithID, } from './commonStateType
|
|
|
2
2
|
import { toAmount } from './commonStateTypes/amount';
|
|
3
3
|
import { getTimeframeTickTag, isIncompleteMonthPresentInTimeframeTick, } from './commonStateTypes/bookCloseDateHelper';
|
|
4
4
|
import { toCOABalanceTimeframe, } from './commonStateTypes/coaBalance/coaBalance';
|
|
5
|
-
import { isCalculatedBalanceType, toCOABalanceType, toCOABalanceTypeStrict, } from './commonStateTypes/coaBalance/coaBalanceType';
|
|
5
|
+
import { isCalculatedBalanceType, stripCompareAdditionalBalanceTypes, toCOABalanceType, toCOABalanceTypeStrict, } from './commonStateTypes/coaBalance/coaBalanceType';
|
|
6
6
|
import { newBalancesFilter, newBalancesFilterForDateRange, toCOABalancesOrderStrict, } from './commonStateTypes/coaBalance/coaBalancesFilter';
|
|
7
7
|
import { newBalancesFilterClassesView, } from './commonStateTypes/coaBalance/coaBalancesFilterClassesView';
|
|
8
|
+
import { defaultCustomerCurrency } from './commonStateTypes/currencyHelper';
|
|
8
9
|
import { getNumberOfPeriods } from './commonStateTypes/dataAvailable';
|
|
9
10
|
import { ALL_FILE_TYPES, toFileTypeStrict, } from './commonStateTypes/fileType';
|
|
10
11
|
import { addPeriod, subtractPeriod, } from './commonStateTypes/fiscalYearHelpers/addSubtractPeriod';
|
|
@@ -14,7 +15,7 @@ import { getActualPeriodOfFY, getActualPeriodOfFYQtr, } from './commonStateTypes
|
|
|
14
15
|
import { getFYMonths } from './commonStateTypes/fiscalYearHelpers/getFYMonths';
|
|
15
16
|
import { getFYQuarterAndYear, getLastMonthOfFYQuarter, getLastMonthOfFYYear, } from './commonStateTypes/fiscalYearHelpers/getFYQuarterAndYear';
|
|
16
17
|
import { getStartOfAndEndOfTimeframeForFY } from './commonStateTypes/fiscalYearHelpers/getStartOfAndEndOfTimeframeFY';
|
|
17
|
-
import { isAllFetchCompleted, isAnyFetchInProgress, reduceAllFetchState, reduceAnyCompletedFetchState, reduceAnyFetchState, reduceFetchState, } from './commonStateTypes/reduceFetchState';
|
|
18
|
+
import { isAllFetchCompleted, isAnyFetchInProgress, reduceAllFetchState, reduceAnyCompletedFetchState, reduceAnyFetchState, reduceFetchState, reduceFetchStateParallelTimeframes, } from './commonStateTypes/reduceFetchState';
|
|
18
19
|
import { toReimbursementTypeCode } from './commonStateTypes/reimbursementTypeCode';
|
|
19
20
|
import { stringToUnion, stringToUnionStrict, } from './commonStateTypes/stringToUnion';
|
|
20
21
|
import { SCHEDULE_DAYS_OF_MONTH, convertToPeriod, toAbsoluteDay, toMonth, toMonthStrict, toMonthYearPeriodId, toQuarter, toQuarterStrict, toScheduleDaysOfMonth, } from './commonStateTypes/timePeriod';
|
|
@@ -40,7 +41,6 @@ import { getControllersName, getFirstControllerEmail, getFirstControllerId, } fr
|
|
|
40
41
|
import { getCompanyByCompanyId, getCompanyInfoForAllCockpitCompaniesInState, getControllersForCompany, } from './entity/company/companySelector';
|
|
41
42
|
import { ALL_ACCOUNTING_CONNECTION_CREATION_MODES, isCompanyEligibleForTreasury, } from './entity/company/companyStateTypes';
|
|
42
43
|
import { updateCompaniesHealth, updateCompanyHealth, } from './entity/companyHealthMetric/companyHealthMetricReducer';
|
|
43
|
-
import { defaultCustomerCurrency, } from './entity/customer/customerState';
|
|
44
44
|
import { CustomerIncomeTrend } from './entity/customerIncome/customerIncomeTrend';
|
|
45
45
|
import { getDepositAccountLimitForChargeCardByDepositAccountId } from './entity/depositAccount/depositAccountSelector';
|
|
46
46
|
import { mapAttachmentFilePayloadToFile, mapAttachmentFileToAttachmentFilePayload, mapFilePayloadToFile, removeAttachmentFiles, updateAttachmentFiles, updateFiles, } from './entity/file/fileReducer';
|
|
@@ -163,12 +163,13 @@ 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 { fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
166
|
+
import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, 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, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
168
|
+
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, } 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';
|
|
172
173
|
import { toMissingReceiptsSortKey as toExpenseAutomationMissingReceiptsSortKey, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
173
174
|
import { toReconciliationTabsType, } from './view/expenseAutomationView/types/reconciliationViewState';
|
|
174
175
|
import { toTransactionsTabKey as toExpenseAutomationTransactionsTabKey, toTransactionsSortKey, } from './view/expenseAutomationView/types/transactionsViewState';
|
|
@@ -216,7 +217,10 @@ import { changeZeniPersonRoles, deletePerson, fetchAllPeopleRequiredViews, fetch
|
|
|
216
217
|
import { getPeople, getPeopleLocalData } from './view/people/peopleSelector';
|
|
217
218
|
import { fetchProfitAndLoss, fetchProfitAndLossForTimeframe, resetProfitAndLossNodeCollapseState, updateProfitAndLossUIState, } from './view/profitAndLoss/profitAndLossReducer';
|
|
218
219
|
import { getPandLReportFetchState, getProfitAndLossReport, } from './view/profitAndLoss/profitAndLossSelector';
|
|
219
|
-
import {
|
|
220
|
+
import { getEmptyHorizontalSectionBalancesSlice } from './view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice';
|
|
221
|
+
import { getProfitAndLossClassesHorizontalView } from './view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
222
|
+
import { HORIZONTAL_CLASS_TOTAL_BALANCE_ID, isHorizontalAccountReportData, } from './view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
223
|
+
import { fetchProfitAndLossClassesView, resetProfitAndLossClassesNodeCollapseState, updateClassViewLayout, updateAccountViewMode as updateProfitAndLossAccountViewMode, updateClassesToFilterOut as updateProfitAndLossClassesToFilterOut, updateProfitAndLossClassesViewUIState, } from './view/profitAndLossClassesView/profitAndLossClassesViewReducer';
|
|
220
224
|
import { getProfitAndLossClassesView } from './view/profitAndLossClassesView/profitAndLossClassesViewSelector';
|
|
221
225
|
import { isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID, } from './view/profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
|
|
222
226
|
import { fetchEntityRecommendationsByTransactionId, fetchRecommendationByEntityId, fetchRecommendationByEntityName, } from './view/recommendation/recommendationReducer';
|
|
@@ -412,10 +416,14 @@ export { toReportID, toReportFormatStrict, isCashFlowOrBalanceSheetReport, isDas
|
|
|
412
416
|
export { toCOABalanceTimeframe, };
|
|
413
417
|
export { toCOABalancesOrderStrict, newBalancesFilter, newBalancesFilterForDateRange, };
|
|
414
418
|
export { newBalancesFilterClassesView };
|
|
415
|
-
export { toCOABalanceTypeStrict, toCOABalanceType as toCOABlanaceType, isCalculatedBalanceType, };
|
|
419
|
+
export { toCOABalanceTypeStrict, toCOABalanceType as toCOABlanaceType, isCalculatedBalanceType, stripCompareAdditionalBalanceTypes, };
|
|
416
420
|
export { stringToUnion, stringToUnionStrict };
|
|
417
421
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
|
|
418
|
-
export {
|
|
422
|
+
export {
|
|
423
|
+
// Bulk Upload Types
|
|
424
|
+
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts,
|
|
425
|
+
// Bulk Upload Actions
|
|
426
|
+
bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, 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, };
|
|
419
427
|
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
|
|
420
428
|
export { TOP_EX_TIME_PERIODS };
|
|
421
429
|
export { toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, };
|
|
@@ -446,7 +454,7 @@ export { fetchDashboard, getDashboard, updateTreasuryVideoClosed, };
|
|
|
446
454
|
export { updateDashboardLayout };
|
|
447
455
|
export { getPandLWithForecast, } from './view/profitAndLoss/pAndLWithForecast/pAndLWithForecastSelector';
|
|
448
456
|
export { fetchProfitAndLoss, resetProfitAndLossNodeCollapseState, updateProfitAndLossUIState, getProfitAndLossReport, getPandLReportFetchState, fetchProfitAndLossForTimeframe, };
|
|
449
|
-
export { fetchProfitAndLossClassesView, updateProfitAndLossClassesToFilterOut, resetProfitAndLossClassesNodeCollapseState, updateProfitAndLossClassesViewUIState, updateProfitAndLossAccountViewMode, getProfitAndLossClassesView, isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID, };
|
|
457
|
+
export { fetchProfitAndLossClassesView, updateProfitAndLossClassesToFilterOut, resetProfitAndLossClassesNodeCollapseState, updateProfitAndLossClassesViewUIState, updateProfitAndLossAccountViewMode, updateClassViewLayout, getProfitAndLossClassesView, getEmptyHorizontalSectionBalancesSlice, getProfitAndLossClassesHorizontalView, isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID, HORIZONTAL_CLASS_TOTAL_BALANCE_ID, isHorizontalAccountReportData, };
|
|
450
458
|
export { getAccountingProviderAttachment };
|
|
451
459
|
export { fetchUserListByType, getUserList };
|
|
452
460
|
export { fetchAllPeopleRequiredViews, fetchPeoplePage, fetchPeople, deletePerson, resendInvite, changeZeniPersonRoles, invitePeople, inviteZeniPeople, updatePeopleUIState, peopleSaveUpdates, resetUpdateErrorMessage, peopleSaveDataInLocalStore, peopleClearDataInLocalStore, getPeople, getPeopleLocalData, initializeEditPerson, };
|
|
@@ -538,7 +546,7 @@ export { saveRealTimeApproval, updateIsEditModeRealTimeApprovals, };
|
|
|
538
546
|
export { deleteRemi, fetchRemiDetail, cancelAndDeleteRemi, approveOrRejectRemi, clearRemiDetailView, fetchDuplicateReimbursement, clearDuplicateReimbursementDetail, removeDuplicateReimbursementByLineId, };
|
|
539
547
|
export { getEditRemiDetail, };
|
|
540
548
|
export { fetchEditRemiDetailPage, fetchRecommendationsAndUpdateMerchantRecommendations, fetchRemiAndInitializeLocalStore, initializeRemiToLocalStore, saveRemiUpdatesToLocalStore, fetchCurrencyConversionValue, discardRemiUpdatesInLocalStore, removeFileFromRemiUpdatesInLocalStore, saveRemiDetail, saveRemiSuccessOrFailure, parseReceiptsToRemi, clearEditRemiViewDetail, updateAddRemiAutoFields, updateUploadFetchState, updateTentativeMerchantNames, clearTentativeMerchantName, updateReimbursementType, updateHomeCurrencyConversion, clearAddRemiAutoFields, };
|
|
541
|
-
export { reduceFetchState, reduceAnyFetchState, reduceAllFetchState, reduceAnyCompletedFetchState, isAnyFetchInProgress, isAllFetchCompleted, ALL_FILE_TYPES, toFileTypeStrict, };
|
|
549
|
+
export { reduceFetchState, reduceFetchStateParallelTimeframes, reduceAnyFetchState, reduceAllFetchState, reduceAnyCompletedFetchState, isAnyFetchInProgress, isAllFetchCompleted, ALL_FILE_TYPES, toFileTypeStrict, };
|
|
542
550
|
export { getNextNthWorkingDay, getPreviousNthWorkingDay, isHolidayToday, filterDays, getYearsList, isHoliday, holidaysFormatted, PAYMENT_BUSINESS_DAYS, };
|
|
543
551
|
export { fetchCompanyOnboardingView, fetchQBOConnectionPool, updateQBOConnectionPoolExternalConnection, fetchOnboardingCompletedCompanies, saveOnboardingCustomerCompletedStatus, toProductType, toProductTypeStrict, getOnboardingCockpitView, getNewOnboardingCustomerView, getOnboardingEmailGroup, initializeOnboardingCustomerViewUpdateData, clearOnboardingCustomerViewUpdateData, saveOnboardingCustomerViewUpdateData, updateOnboardingCustomerListUIState, updateCustomerCreationStatus, updateStatusAfterOnboardingCompleted, saveOnboardingCustomerViewUpdates, saveOnboardingCustomerNotes, saveOnboardingCustomerDataInLocalStore, updateOnboardingCustomerDataInLocalStore, resetNewOnboardedCustomerId, sendOnboardingCustomerViewInvite, retryBankAccountConnectionForOnboarding, };
|
|
544
552
|
export { getTransactionsListByCategoryType, getTransactionListUIStateByCategoryType, };
|
|
@@ -607,5 +615,6 @@ export { fetchTreasuryStatementList } from './view/spendManagement/treasury/trea
|
|
|
607
615
|
export { getTreasuryStatements, } from './view/spendManagement/treasury/treasuryStatementList/treasuryStatementListSelector';
|
|
608
616
|
export { fetchTreasuryTaxLetterList } from './view/spendManagement/treasury/treasuryTaxLetterList/treasuryTaxLetterListReducer';
|
|
609
617
|
export { getTreasuryTaxLetters, } from './view/spendManagement/treasury/treasuryTaxLetterList/treasuryTaxLetterListSelector';
|
|
618
|
+
export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS, } from './view/expenseAutomationView/helpers/bulkUploadTiming';
|
|
610
619
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
611
620
|
export { getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
package/lib/esm/reducer.js
CHANGED
|
@@ -58,6 +58,7 @@ import toastNotification, { initialState as initialToastNotificationState, } fro
|
|
|
58
58
|
import transaction, { initialState as initialTransactionState, } from './entity/transaction/transactionReducer';
|
|
59
59
|
import transactionActivityLog, { initialState as initialTransactionActivityLogState, } from './entity/transactionActivityLog/transactionActivityLogReducer';
|
|
60
60
|
import user, { initialState as initialUserState, } from './entity/user/userReducer';
|
|
61
|
+
import userGroups, { initialState as initialUserGroupsState, } from './entity/userGroups/userGroupsReducer';
|
|
61
62
|
import userRole, { initialState as initialUserRoleState, } from './entity/userRole/userRoleReducer';
|
|
62
63
|
import vendor, { initialState as initialVendorState, } from './entity/vendor/vendorReducer';
|
|
63
64
|
import vendorExpense, { initialState as initialVendorExpenseState, } from './entity/vendorExpense/vendorExpenseReducer';
|
|
@@ -198,6 +199,7 @@ import trend, { initialTrendState } from './view/trend/trendReducer';
|
|
|
198
199
|
import trendWithTransactions, { initialTrendWithTransactionsState, } from './view/trendWithTransactions/trendWithTransactionsReducer';
|
|
199
200
|
import twoFactorAuthentication, { initialState as initialTwoFactorAuthenticationState, } from './view/twoFactorAuthentication/twoFactorAuthenticationReducer';
|
|
200
201
|
import userFinancialAccountState, { initialState as initialUserFinancialAccountState, } from './view/userFinancialAccount/userFinancialAccountReducer';
|
|
202
|
+
import userGroupListView, { initialState as initialUserGroupListViewState, } from './view/userGroupListView/userGroupListViewReducer';
|
|
201
203
|
import userListView, { initialState as initialUserListViewState, } from './view/userListView/userListViewReducer';
|
|
202
204
|
import userRoleConfig, { initialState as initialUserRoleConfigState, } from './view/userRoleConfigView/userRoleConfigReducer';
|
|
203
205
|
import vendor1099TypeList, { initialState as initialVendor1099TypeListState, } from './view/vendor1099TypeList/vendor1099TypeListReducer';
|
|
@@ -270,6 +272,7 @@ const initialEntitiesState = {
|
|
|
270
272
|
toastNotificationState: initialToastNotificationState,
|
|
271
273
|
transactionActivityLogState: initialTransactionActivityLogState,
|
|
272
274
|
transactionState: initialTransactionState,
|
|
275
|
+
userGroupsState: initialUserGroupsState,
|
|
273
276
|
userRoleState: initialUserRoleState,
|
|
274
277
|
userState: initialUserState,
|
|
275
278
|
vendorExpenseState: initialVendorExpenseState,
|
|
@@ -408,6 +411,7 @@ const initialViewsState = {
|
|
|
408
411
|
trendWithTransactionsState: initialTrendWithTransactionsState,
|
|
409
412
|
twoFactorAuthenticationState: initialTwoFactorAuthenticationState,
|
|
410
413
|
userFinancialAccountState: initialUserFinancialAccountState,
|
|
414
|
+
userGroupListViewState: initialUserGroupListViewState,
|
|
411
415
|
userListViewState: initialUserListViewState,
|
|
412
416
|
userRoleConfigState: initialUserRoleConfigState,
|
|
413
417
|
vendorFirstReviewViewState: initialVendorFirstReviewViewState,
|
|
@@ -492,6 +496,7 @@ const entityReducers = {
|
|
|
492
496
|
toastNotificationState: toastNotification,
|
|
493
497
|
transactionActivityLogState: transactionActivityLog,
|
|
494
498
|
transactionState: transaction,
|
|
499
|
+
userGroupsState: userGroups,
|
|
495
500
|
userRoleState: userRole,
|
|
496
501
|
userState: user,
|
|
497
502
|
vendorExpenseState: vendorExpense,
|
|
@@ -630,6 +635,7 @@ const viewReducers = {
|
|
|
630
635
|
trendWithTransactionsState: trendWithTransactions,
|
|
631
636
|
twoFactorAuthenticationState: twoFactorAuthentication,
|
|
632
637
|
userFinancialAccountState: userFinancialAccountState,
|
|
638
|
+
userGroupListViewState: userGroupListView,
|
|
633
639
|
userListViewState: userListView,
|
|
634
640
|
userRoleConfigState: userRoleConfig,
|
|
635
641
|
vendorFirstReviewViewState: vendorFirstReviewView,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import { mapReportPayloadV2ToReportV2 } from '../../../commonPayloadTypes/v2/viewAndReportPayloadv2';
|
|
3
3
|
import { getAgingBalancesKey, toAgingPeriod, } from '../../../commonStateTypes/agingBalance/agingBalance';
|
|
4
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
4
5
|
import { getNestedCustomerHierarchy } from '../../../commonStateTypes/customerView/getNestedCustomerHierarchy';
|
|
5
6
|
import { toCustomer } from '../../../entity/customer/customerPayload';
|
|
6
|
-
import { defaultCustomerCurrency } from '../../../entity/customer/customerState';
|
|
7
7
|
import { dateNow } from '../../../zeniDayJS';
|
|
8
8
|
import { toArAgingDataByCustomerId, toArAgingTotals, } from './arAgingPayload';
|
|
9
9
|
export const inititalUIState = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import orderBy from 'lodash/orderBy';
|
|
3
3
|
import { getAgingBalancesKey, } from '../../../commonStateTypes/agingBalance/agingBalance';
|
|
4
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
4
5
|
import { getCustomer } from '../../../entity/customer/customerSelector';
|
|
5
|
-
import { defaultCustomerCurrency, } from '../../../entity/customer/customerState';
|
|
6
6
|
export const getArAgingReport = createSelector((state) => state.arAgingState, (state) => state.customerState, (arAgingState, customerState) => {
|
|
7
7
|
const { reportId, reportTitle, fetchState, uiState, firstMonthOfFY, agingPeriods, } = arAgingState;
|
|
8
8
|
const { searchString, sortOrder, sortKey, selectedDate } = uiState;
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { merge, of } from 'rxjs';
|
|
2
|
+
import { filter, mergeMap, switchMap, take, takeUntil } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, restoreBulkUploadMatchingState, storeBatchDetails, } from '../../reducers/missingReceiptsViewReducer';
|
|
5
|
+
/**
|
|
6
|
+
* Show a success toast when batch details arrive for the current upload batch,
|
|
7
|
+
* e.g. "17 out of 20 Receipts Matched". Scoped per upload session so it fires
|
|
8
|
+
* only once: starts on `bulkUploadReceiptsSuccess` (or `restoreBulkUploadMatchingState`
|
|
9
|
+
* for a restored session), waits for the first batch-details action for that batch,
|
|
10
|
+
* emits the toast, then stops. `clearBulkUpload` cancels the in-flight wait.
|
|
11
|
+
*/
|
|
12
|
+
export const bulkUploadMatchResultToastEpic = (actions$) => actions$.pipe(filter((action) => bulkUploadReceiptsSuccess.match(action) ||
|
|
13
|
+
restoreBulkUploadMatchingState.match(action)), switchMap((uploadAction) => {
|
|
14
|
+
const { batchId } = uploadAction.payload;
|
|
15
|
+
return merge(actions$.pipe(filter(fetchBulkUploadBatchDetailsSuccess.match)), actions$.pipe(filter(storeBatchDetails.match))).pipe(filter((a) => a.payload.batchId === batchId), take(1), mergeMap((action) => {
|
|
16
|
+
const { summary } = action.payload;
|
|
17
|
+
return of(openSnackbar({
|
|
18
|
+
messageSection: 'receipts_bulk_match',
|
|
19
|
+
messageText: 'success',
|
|
20
|
+
type: 'success',
|
|
21
|
+
variables: [
|
|
22
|
+
{
|
|
23
|
+
variableName: '_matched_',
|
|
24
|
+
variableValue: String(summary.matched),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
variableName: '_total_',
|
|
28
|
+
variableValue: String(summary.total),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}));
|
|
32
|
+
}), takeUntil(actions$.pipe(filter(clearBulkUpload.match))));
|
|
33
|
+
}));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { concat, of, timer } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
4
|
+
import { BULK_UPLOAD_BAR_COMPLETE_HOLD_MS } from '../../helpers/bulkUploadTiming';
|
|
5
|
+
import { bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, updateBulkUploadProgress, } from '../../reducers/missingReceiptsViewReducer';
|
|
6
|
+
export const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(bulkUploadReceipts.match), mergeMap((action) => {
|
|
7
|
+
const { files } = action.payload;
|
|
8
|
+
const formData = new FormData();
|
|
9
|
+
for (const file of files) {
|
|
10
|
+
formData.append('files', file, file.name);
|
|
11
|
+
}
|
|
12
|
+
return zeniAPI
|
|
13
|
+
.postFormData(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`, formData)
|
|
14
|
+
.pipe(mergeMap((response) => {
|
|
15
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
16
|
+
const batchId = String(response.data.batch_id ?? '').trim();
|
|
17
|
+
if (batchId === '') {
|
|
18
|
+
return of(bulkUploadReceiptsFailure({
|
|
19
|
+
error: createZeniAPIStatus('Unexpected Error', 'Bulk upload succeeded but batch_id was missing or empty.'),
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
return concat(of(updateBulkUploadProgress(100)), timer(BULK_UPLOAD_BAR_COMPLETE_HOLD_MS).pipe(mergeMap(() => of(bulkUploadReceiptsSuccess({ batchId })))));
|
|
23
|
+
}
|
|
24
|
+
return of(bulkUploadReceiptsFailure({ error: response.status }));
|
|
25
|
+
}), catchError((error) => of(bulkUploadReceiptsFailure({
|
|
26
|
+
error: createZeniAPIStatus('Unexpected Error', 'Bulk upload receipts API call errored out: ' +
|
|
27
|
+
JSON.stringify(error)),
|
|
28
|
+
}))));
|
|
29
|
+
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, exhaustMap, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
+
import { confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
6
|
+
export const confirmBulkUploadMatchEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(confirmBulkUploadMatch.match), exhaustMap((action) => {
|
|
7
|
+
const { batchId, attachmentId, transactionId, transactionType, fileName } = action.payload;
|
|
8
|
+
return zeniAPI
|
|
9
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/manual-match`, {
|
|
10
|
+
attachment_id: attachmentId,
|
|
11
|
+
transaction_id: transactionId,
|
|
12
|
+
transaction_type: transactionType,
|
|
13
|
+
file_name: fileName,
|
|
14
|
+
})
|
|
15
|
+
.pipe(mergeMap((response) => {
|
|
16
|
+
if (isSuccessResponse(response)) {
|
|
17
|
+
return from([
|
|
18
|
+
confirmBulkUploadMatchSuccess({
|
|
19
|
+
batchId,
|
|
20
|
+
attachmentId,
|
|
21
|
+
transactionId,
|
|
22
|
+
}),
|
|
23
|
+
openSnackbar({
|
|
24
|
+
messageSection: 'receipt_match',
|
|
25
|
+
messageText: 'success',
|
|
26
|
+
type: 'success',
|
|
27
|
+
}),
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
return from([
|
|
31
|
+
confirmBulkUploadMatchFailure({ error: response.status }),
|
|
32
|
+
openSnackbar({
|
|
33
|
+
messageSection: 'receipt_match',
|
|
34
|
+
messageText: 'failed',
|
|
35
|
+
type: 'error',
|
|
36
|
+
}),
|
|
37
|
+
]);
|
|
38
|
+
}), catchError((error) => from([
|
|
39
|
+
confirmBulkUploadMatchFailure({
|
|
40
|
+
error: createZeniAPIStatus('Unexpected Error', 'Confirm bulk upload match errored out: ' +
|
|
41
|
+
JSON.stringify(error)),
|
|
42
|
+
}),
|
|
43
|
+
openSnackbar({
|
|
44
|
+
messageSection: 'receipt_match',
|
|
45
|
+
messageText: 'failed',
|
|
46
|
+
type: 'error',
|
|
47
|
+
}),
|
|
48
|
+
])));
|
|
49
|
+
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EMPTY, from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
+
import { extractTransactionPayloadsFromBatchFiles, isBatchDetailsApiStatusCompleted, shouldFetchBatchDetailsForBatchId, toBatchDetails, } from '../../payload/missingReceiptsPayload';
|
|
6
|
+
import { fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, } from '../../reducers/missingReceiptsViewReducer';
|
|
7
|
+
export const fetchBulkUploadBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatchDetails.match), mergeMap(() => {
|
|
8
|
+
const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
9
|
+
const { currentBatchId } = bulkUpload;
|
|
10
|
+
if (currentBatchId == null) {
|
|
11
|
+
return of(fetchBulkUploadBatchDetailsFailure({
|
|
12
|
+
error: createZeniAPIStatus('Unexpected Error', 'No current batch ID available'),
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
if (!shouldFetchBatchDetailsForBatchId(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentBatchId)) {
|
|
16
|
+
return EMPTY;
|
|
17
|
+
}
|
|
18
|
+
return zeniAPI
|
|
19
|
+
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${currentBatchId}`)
|
|
20
|
+
.pipe(mergeMap((response) => {
|
|
21
|
+
if (!isSuccessResponse(response) ||
|
|
22
|
+
response.data == null ||
|
|
23
|
+
!isBatchDetailsApiStatusCompleted(response.data.status)) {
|
|
24
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
25
|
+
return EMPTY;
|
|
26
|
+
}
|
|
27
|
+
return of(fetchBulkUploadBatchDetailsFailure({ error: response.status }));
|
|
28
|
+
}
|
|
29
|
+
const actions = [];
|
|
30
|
+
const transactionPayloads = extractTransactionPayloadsFromBatchFiles(response.data.files);
|
|
31
|
+
if (transactionPayloads.length > 0) {
|
|
32
|
+
actions.push(updateTransactions(transactionPayloads, (value) => value.transaction_id));
|
|
33
|
+
}
|
|
34
|
+
actions.push(fetchBulkUploadBatchDetailsSuccess(toBatchDetails(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
|
|
35
|
+
actions.push(fetchBulkUploadBatches({ cacheOverride: true }));
|
|
36
|
+
return from(actions);
|
|
37
|
+
}), catchError((error) => of(fetchBulkUploadBatchDetailsFailure({
|
|
38
|
+
error: createZeniAPIStatus('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)),
|
|
39
|
+
}))));
|
|
40
|
+
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { toMonthYearPeriodId } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
+
import { toBatchListItem, } from '../../payload/missingReceiptsPayload';
|
|
7
|
+
import { fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
+
import { BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS } from '../../helpers/bulkUploadTiming';
|
|
9
|
+
import { rollingCalendarDateRangeInclusive } from '../../helpers/rollingCalendarDateRangeInclusive';
|
|
10
|
+
export const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatches.match), switchMap((action) => {
|
|
11
|
+
const { cacheOverride } = action.payload;
|
|
12
|
+
const state = state$.value;
|
|
13
|
+
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
14
|
+
const currentTenant = getCurrentTenant(state);
|
|
15
|
+
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
16
|
+
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
17
|
+
const existingBatches = bulkUpload.batchListByPeriod[periodId] ?? [];
|
|
18
|
+
if (cacheOverride !== true && existingBatches.length > 0) {
|
|
19
|
+
return of(fetchBulkUploadBatchesSuccess({
|
|
20
|
+
batchList: existingBatches,
|
|
21
|
+
selectedPeriod,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
const { end, start } = rollingCalendarDateRangeInclusive(BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS);
|
|
25
|
+
const queryParam = {
|
|
26
|
+
start_date: start,
|
|
27
|
+
end_date: end,
|
|
28
|
+
sort_order: 'desc',
|
|
29
|
+
};
|
|
30
|
+
return zeniAPI
|
|
31
|
+
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
32
|
+
.pipe(mergeMap((response) => {
|
|
33
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
34
|
+
/** Full list (all statuses) for UI; batch-details epics filter to `completed` only. */
|
|
35
|
+
return of(fetchBulkUploadBatchesSuccess({
|
|
36
|
+
batchList: response.data.batches.map(toBatchListItem),
|
|
37
|
+
selectedPeriod,
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
return of(fetchBulkUploadBatchesFailure({
|
|
41
|
+
error: response.status,
|
|
42
|
+
selectedPeriod,
|
|
43
|
+
}));
|
|
44
|
+
}), catchError((error) => of(fetchBulkUploadBatchesFailure({
|
|
45
|
+
error: createZeniAPIStatus('Unexpected Error', 'Fetch bulk upload batches errored out: ' +
|
|
46
|
+
JSON.stringify(error)),
|
|
47
|
+
selectedPeriod,
|
|
48
|
+
}))));
|
|
49
|
+
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { convertToPeriod, toMonthYearPeriodId, } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
+
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
6
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
|
+
import { fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, getCompletedTransactionsCacheKey, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
+
export const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCompletedTransactions.match), switchMap((action) => {
|
|
9
|
+
const state = state$.value;
|
|
10
|
+
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
11
|
+
const currentTenant = getCurrentTenant(state);
|
|
12
|
+
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
13
|
+
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
14
|
+
const isInitialLoad = action.payload.pageToken == null;
|
|
15
|
+
const cacheKey = getCompletedTransactionsCacheKey(periodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab);
|
|
16
|
+
const existingData = bulkUpload.completedTransactionsByPeriod[cacheKey];
|
|
17
|
+
if (isInitialLoad &&
|
|
18
|
+
action.payload.cacheOverride !== true &&
|
|
19
|
+
existingData != null &&
|
|
20
|
+
existingData.transactionIds.length > 0) {
|
|
21
|
+
return from([]);
|
|
22
|
+
}
|
|
23
|
+
const period = convertToPeriod(selectedPeriod);
|
|
24
|
+
const queryPayload = {
|
|
25
|
+
start_date: period.start,
|
|
26
|
+
end_date: period.end,
|
|
27
|
+
sort_by: bulkUpload.sortKey,
|
|
28
|
+
sort_order: bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc',
|
|
29
|
+
page_token: action.payload.pageToken ?? null,
|
|
30
|
+
page_size: 25,
|
|
31
|
+
};
|
|
32
|
+
if (bulkUpload.completedSubTab !== 'all') {
|
|
33
|
+
queryPayload.match_type = bulkUpload.completedSubTab;
|
|
34
|
+
}
|
|
35
|
+
const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
|
|
36
|
+
return zeniAPI
|
|
37
|
+
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipt-agent/transactions/completed?query=${encodedQuery}`)
|
|
38
|
+
.pipe(mergeMap((response) => {
|
|
39
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
40
|
+
const transactionIds = response.data.transactions.map((t) => t.transaction_id);
|
|
41
|
+
const updateActions = [];
|
|
42
|
+
updateActions.push(updateTransactions(response.data.transactions, (value) => value.transaction_id));
|
|
43
|
+
updateActions.push(fetchCompletedTransactionsSuccess({
|
|
44
|
+
isInitialLoad,
|
|
45
|
+
transactionIds,
|
|
46
|
+
nextPageToken: response.data.next_page_token,
|
|
47
|
+
totalCount: response.data.total_count,
|
|
48
|
+
selectedPeriod,
|
|
49
|
+
}));
|
|
50
|
+
return from(updateActions);
|
|
51
|
+
}
|
|
52
|
+
return of(fetchCompletedTransactionsFailure({
|
|
53
|
+
error: response.status,
|
|
54
|
+
selectedPeriod,
|
|
55
|
+
}));
|
|
56
|
+
}), catchError((error) => of(fetchCompletedTransactionsFailure({
|
|
57
|
+
error: createZeniAPIStatus('Unexpected Error', 'Fetch completed transactions errored: ' +
|
|
58
|
+
JSON.stringify(error)),
|
|
59
|
+
selectedPeriod,
|
|
60
|
+
}))));
|
|
61
|
+
}));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { concat, of } from 'rxjs';
|
|
2
|
+
import { catchError, exhaustMap, filter } from 'rxjs/operators';
|
|
3
|
+
import { toMonthYearPeriodId } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
+
import { createZeniAPIStatus } from '../../../../responsePayload';
|
|
6
|
+
import { filterBatchListItemsForBatchDetailsFetch } from '../../payload/missingReceiptsPayload';
|
|
7
|
+
import { fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
+
import { fetchBatchDetailsByIds } from './fetchMultipleBatchDetailsEpic';
|
|
9
|
+
const MORE_BATCH_PAGE_SIZE = 5;
|
|
10
|
+
export const fetchMoreBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchMoreBatchDetails.match),
|
|
11
|
+
/** One page at a time — avoids duplicate loads if IO + scroll fallback both fire. */
|
|
12
|
+
exhaustMap(() => {
|
|
13
|
+
const state = state$.value;
|
|
14
|
+
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
15
|
+
const currentTenant = getCurrentTenant(state);
|
|
16
|
+
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
17
|
+
if (selectedPeriod == null) {
|
|
18
|
+
return of(fetchMoreBatchDetailsComplete());
|
|
19
|
+
}
|
|
20
|
+
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
21
|
+
const batchList = bulkUpload.batchListByPeriod[periodId] ?? [];
|
|
22
|
+
const failedIds = new Set(bulkUpload.failedBatchDetailIds);
|
|
23
|
+
const unfetchedBatches = filterBatchListItemsForBatchDetailsFetch(batchList).filter((batch) => bulkUpload.batchDetailsById[batch.batchId] == null &&
|
|
24
|
+
!failedIds.has(batch.batchId));
|
|
25
|
+
const unfetchedBatchIds = unfetchedBatches.map((batch) => batch.batchId);
|
|
26
|
+
if (unfetchedBatchIds.length === 0) {
|
|
27
|
+
return of(fetchMoreBatchDetailsComplete());
|
|
28
|
+
}
|
|
29
|
+
const nextPage = unfetchedBatchIds.slice(0, MORE_BATCH_PAGE_SIZE);
|
|
30
|
+
return concat(fetchBatchDetailsByIds(nextPage, zeniAPI), of(fetchMoreBatchDetailsComplete())).pipe(catchError((error) => of(fetchMoreBatchDetailsFailure({
|
|
31
|
+
error: createZeniAPIStatus('Unexpected Error', 'Fetch more batch details errored out: ' + JSON.stringify(error)),
|
|
32
|
+
}))));
|
|
33
|
+
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { EMPTY, concat, from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
+
import { extractTransactionPayloadsFromBatchFiles, filterBatchListItemsForBatchDetailsFetch, isBatchDetailsApiStatusCompleted, shouldFetchBatchDetailsForBatchId, toBatchDetails, } from '../../payload/missingReceiptsPayload';
|
|
6
|
+
import { batchDetailFetchFailed, fetchBulkUploadBatchDetails, fetchBulkUploadBatchesSuccess, fetchMoreBatchDetailsComplete, setInitialBatchDetailsLoading, storeBatchDetails, } from '../../reducers/missingReceiptsViewReducer';
|
|
7
|
+
const INITIAL_BATCH_PAGE_SIZE = 5;
|
|
8
|
+
export function fetchBatchDetailsByIds(batchIds, zeniAPI) {
|
|
9
|
+
if (batchIds.length === 0) {
|
|
10
|
+
return EMPTY;
|
|
11
|
+
}
|
|
12
|
+
return from(batchIds).pipe(mergeMap((batchId) => zeniAPI
|
|
13
|
+
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
|
|
14
|
+
.pipe(mergeMap((response) => {
|
|
15
|
+
if (!isSuccessResponse(response) ||
|
|
16
|
+
response.data == null ||
|
|
17
|
+
!isBatchDetailsApiStatusCompleted(response.data.status)) {
|
|
18
|
+
return EMPTY;
|
|
19
|
+
}
|
|
20
|
+
const actions = [];
|
|
21
|
+
const transactionPayloads = extractTransactionPayloadsFromBatchFiles(response.data.files);
|
|
22
|
+
if (transactionPayloads.length > 0) {
|
|
23
|
+
actions.push(updateTransactions(transactionPayloads, (value) => value.transaction_id));
|
|
24
|
+
}
|
|
25
|
+
actions.push(storeBatchDetails(toBatchDetails(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
|
|
26
|
+
return from(actions);
|
|
27
|
+
}), catchError((error) => {
|
|
28
|
+
console.error(`Failed to fetch batch details for ${batchId}:`, createZeniAPIStatus('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)));
|
|
29
|
+
return of(batchDetailFetchFailed({ batchId }));
|
|
30
|
+
})), 5));
|
|
31
|
+
}
|
|
32
|
+
export const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatchesSuccess.match), mergeMap((action) => {
|
|
33
|
+
const batchList = action.payload.batchList;
|
|
34
|
+
const { batchDetailsById } = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
35
|
+
/** Only completed list rows may trigger batch-details API; preserve platform order. */
|
|
36
|
+
const completedBatchesMissingDetails = filterBatchListItemsForBatchDetailsFetch(batchList).filter((batch) => batchDetailsById[batch.batchId] == null);
|
|
37
|
+
const completedBatchIds = completedBatchesMissingDetails.map((batch) => batch.batchId);
|
|
38
|
+
const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
|
|
39
|
+
if (batchIdsToFetch.length === 0) {
|
|
40
|
+
/**
|
|
41
|
+
* List refresh can complete while no row is `completed` yet (multi-fetch skips), or
|
|
42
|
+
* `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
|
|
43
|
+
* Fall back to the single-batch-details epic so `phase` and details can resolve.
|
|
44
|
+
*/
|
|
45
|
+
const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
46
|
+
const currentId = bulkUpload.currentBatchId;
|
|
47
|
+
if (currentId != null &&
|
|
48
|
+
bulkUpload.phase === 'matching' &&
|
|
49
|
+
bulkUpload.batchDetailsById[currentId] == null &&
|
|
50
|
+
shouldFetchBatchDetailsForBatchId(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
|
|
51
|
+
return of(fetchBulkUploadBatchDetails());
|
|
52
|
+
}
|
|
53
|
+
return EMPTY;
|
|
54
|
+
}
|
|
55
|
+
return concat(of(setInitialBatchDetailsLoading()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), of(fetchMoreBatchDetailsComplete()));
|
|
56
|
+
}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { fetchCompletedTransactions, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, } from '../../reducers/missingReceiptsViewReducer';
|
|
4
|
+
/**
|
|
5
|
+
* Completed transactions are cached per sort key/order/sub-tab. After a sort or sub-tab
|
|
6
|
+
* change, the fetch epic would otherwise skip the network when that cache entry already
|
|
7
|
+
* exists — dispatch a cache-bypassing initial fetch whenever either changes from the UI.
|
|
8
|
+
*/
|
|
9
|
+
export const refetchCompletedTransactionsOnBulkUploadSortEpic = (actions$) => {
|
|
10
|
+
return actions$.pipe(filter((action) => setBulkUploadSortConfig.match(action) ||
|
|
11
|
+
setBulkUploadCompletedSubTab.match(action)), mergeMap(() => of(fetchCompletedTransactions(undefined, true))));
|
|
12
|
+
};
|