@zeniai/client-epic-state 5.0.51-betaRD2 → 5.0.51-betaSS1
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/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantReducer.d.ts +16 -64
- package/lib/entity/tenant/tenantReducer.js +7 -86
- package/lib/entity/tenant/tenantState.d.ts +1 -3
- package/lib/epic.js +1 -2
- package/lib/esm/entity/tenant/tenantReducer.js +5 -84
- package/lib/esm/epic.js +1 -2
- package/lib/esm/index.js +6 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +6 -1
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +71 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +9 -0
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
- package/lib/index.d.ts +6 -5
- package/lib/index.js +7 -6
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +6 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +8 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +72 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +2 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.js +13 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +27 -1
- package/package.json +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.js +0 -42
- package/lib/esm/entity/tenant/epic/saveConnectorCredentialsEpic.js +0 -38
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
package/lib/index.js
CHANGED
|
@@ -38,10 +38,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.injectFeatureModules = exports.injectFeatureEpics = exports.zeniAPIClientConfig = exports.updateZeniAPIClientConfig = exports.toZeniUrlWithoutBaseURL = exports.toZeniUrl = exports.updateZeniDateLocaleID = exports.setLocalTimezone = exports.subtractPeriod = exports.addPeriod = exports.getLocalTimezone = exports.getActualPeriodOfFY = exports.getActualPeriodOfFYQtr = exports.getStartOfAndEndOfTimeframeForFY = exports.getFYQuarterAndYear = exports.getFYMonths = exports.formatZeniDate = exports.getBusinessDayOfDate = exports.dateNow = exports.dateLocal = exports.zeniDate = exports.zeniDateInLocal = exports.Dayjs = exports.disconnectPusher = exports.initializePusher = exports.saveJeAccountSettingsLocalData = exports.saveJeAccountSettings = exports.getCreditAgentMacroEntity = exports.getCreditAgentRows = exports.updateCreditAgentRows = exports.updateCreditAgentRow = exports.updateCreditAgentMacro = exports.clearAllCreditAgent = exports.getCreditReportDownloadPayload = exports.getCardProfilesData = exports.getCreditAgentMacro = exports.getCreditAgentEntity = exports.getCreditAgentView = exports.toMacro = exports.toCardTenantProfileRow = exports.clearCreditAgentView = exports.updateCreditAgentUIState = exports.updateCardProfile = exports.fetchCardProfiles = exports.resetSaveMacroState = exports.saveCreditAgentMacro = exports.fetchCreditAgentMacro = exports.scheduleTenantCreditScoreCron = exports.fetchCreditAgentAccessSuccess = exports.fetchCreditAgentAccess = void 0;
|
|
40
40
|
exports.toExpenseAutomationTransactionsTabKey = exports.toExpenseAutomationMissingReceiptsSortKey = exports.getExpenseAutomationView = exports.toExpenseAutomationJEScheduleSortKey = exports.toExpenseAutomationJEScheduleMainTab = exports.toMissingReceiptsTab = exports.toMatchSource = exports.toCompletedSubTab = exports.toBulkUploadSortKey = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchStatusValue = exports.toBatchFileStatus = exports.isUnmatchedTabFileStatus = exports.BATCH_FILE_STATUSES = exports.ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY = exports.getMonthEndCloseChecksViewByTenantId = exports.fetchMonthClosePerformanceTrend = exports.fetchMonthEndCloseChecks = exports.stringToUnionStrict = exports.stringToUnion = exports.stripCompareAdditionalBalanceTypes = exports.isCalculatedBalanceType = exports.toCOABlanaceType = exports.toCOABalanceTypeStrict = exports.newBalancesFilterClassesView = exports.newBalancesFilterForDateRange = exports.newBalancesFilter = exports.toCOABalancesOrderStrict = exports.toCOABalanceTimeframe = exports.isFluxAnalysisOpExReport = exports.isOpExByVendorReport = exports.isAgingReport = exports.isPAndLProjectViewReport = exports.isPAndLClassesViewReport = exports.isPAndLReport = exports.isDashboardClassesViewReport = exports.isDashboardReport = exports.isCashFlowOrBalanceSheetReport = exports.toReportFormatStrict = exports.toReportID = exports.toAmount = exports.getMinDate = exports.dateFromYearMonthDate = exports.getMonthIndex = exports.getLastMonthOfFYYear = exports.getLastMonthOfFYQuarter = exports.isIncompleteMonthPresentInTimeframeTick = exports.getTimeframeTickTag = exports.initializeWithNewStore = void 0;
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.getUserRoleByUserId = exports.isZeniSignedInUser = exports.hasOnlyZeniAccountsAccess = exports.hasOnlyChargeCardAccess = exports.hasOnlyReimbursementAccess = exports.hasRemiFallbackAdminLevelAccess = exports.hasBillPayFallbackAdminLevelAccess = exports.hasSuperAdminLevelAccess = exports.hasZeniRoleOrCompanyOfficerAccess = exports.hasOnlyBillPayAccess = exports.getUserRoleMap = exports.hasInvestorBankerLevelAccess = exports.isNonZeniRole = exports.hasBookKeepingUserLevelAccess = exports.hasBookKeepingAdminLevelAccess = exports.hasEmployeeLevelAccess = exports.hasReimbursementUserAccess = exports.hasFullOrAdminLevelAccess = exports.hasAdminLevelAccess = exports.isFinOpsUserRoleType = exports.toUserRoleTypeStrict = exports.toUserRoleType = exports.getAllZeniUsersFromState = exports.getUsersByUserIds = exports.getUserByUserId = exports.getUserName = exports.getForecast = exports.getClassById = exports.getAccountGroupKey = exports.toAccountGroupType = exports.toAccountType = exports.isOtherProductsEnabledForTenant = exports.isTenantBookkeepingEnabled = exports.isTenantCardsOnly = exports.isTenantBankingOnly = exports.fetchSubscriptionSummaryForTenant = exports.toExternalSupportedTool = exports.toExternalIntegrationType = exports.saveOAuthConnection = exports.
|
|
41
|
+
exports.updateExpenseAutomationMissingReceiptUploadState = exports.reviewFluxAnalysisView = exports.updateFluxAnalysisSelectedSectionIdsForReview = exports.updateFluxOperatingExpensesIdsForReview = exports.clearExpenseAutomationFluxAnalysisView = exports.fetchFluxAnalysisView = exports.fetchCompletedTransactionsFailure = exports.fetchCompletedTransactionsSuccess = exports.fetchCompletedTransactions = exports.acknowledgeBulkUploadConfirmMatchComplete = exports.clearManualSearchResults = exports.searchTransactionsForManualMatchFailure = exports.searchTransactionsForManualMatchSuccess = exports.searchTransactionsForManualMatch = exports.clearBulkUpload = exports.setBulkUploadUploadedFileCount = exports.setBulkUploadSortConfig = exports.setBulkUploadCompletedSubTab = exports.setBulkUploadResultsTab = exports.confirmBulkUploadMatchFailure = exports.confirmBulkUploadMatchSuccess = exports.confirmBulkUploadMatch = exports.fetchBulkUploadBatchesFailure = exports.fetchBulkUploadBatchesSuccess = exports.fetchBulkUploadBatches = exports.fetchMoreBatchDetailsFailure = exports.fetchMoreBatchDetailsComplete = exports.fetchMoreBatchDetails = exports.storeBatchDetails = exports.fetchBulkUploadBatchDetailsFailure = exports.fetchBulkUploadBatchDetailsSuccess = exports.fetchBulkUploadBatchDetails = exports.clearMissingReceiptsTabNavigation = exports.requestMissingReceiptsTabNavigation = exports.pusherBatchStatusUpdate = exports.updateBulkUploadProgress = exports.restoreBulkUploadMatchingState = exports.restoreBulkUploadAutomatchingOnMount = exports.bulkUploadReceiptsFailure = exports.bulkUploadReceiptsSuccess = exports.bulkUploadAutomatchingTimedOut = exports.bulkUploadReceipts = exports.fetchExpenseAutomationMissingReceipts = exports.updateTransactionCategorizationCompletedSubTab = exports.updateCurrentSelectedTransactionCategorizationTab = exports.refreshExpenseAutomationCurrentTab = exports.fetchAllExpenseAutomationTabs = exports.markExpenseAutomationMissingReceiptAsDone = exports.uploadExpenseAutomationMissingReceiptSuccess = exports.toExpenseAutomationViewType = void 0;
|
|
42
|
+
exports.updateSelectedCheckboxTransactionIds = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorizationView = exports.fetchTransactionCategorization = exports.setStatementParseInProgress = exports.isReviewTransactionCreditCardCreditType = exports.isReviewTransactionExpenseType = exports.isReviewTransactionDepositType = exports.isReviewTransactionCreditCardPaymentType = exports.isReviewTransactionBillPaymentType = exports.isReviewTransactionBankTransferType = exports.updateStatementUploadChosen = exports.updateNodeCollapseState = exports.uploadAccountStatement = exports.deleteAccountStatement = exports.toReconciliationAccountSource = exports.updateExpenseAutomationAccountReconciliationLocalData = exports.saveExpenseAutomationReconciliationReview = exports.updateExpenseAutomationSelectedDrawerAccountId = exports.updateExpenseAutomationReconReviewTabLocalData = exports.isAccountReconReport = exports.toReconciliationTabsType = exports.getAccountReconByAccountIdAndSelectedPeriod = exports.setConnectionInProgressForAccountReconciliation = exports.updateExpenseAutomationReconListScrollPosition = exports.uploadAccountStatementIntoDocumentAI = exports.fetchReconciliationView = exports.getExpenseAutomationReconciliationView = exports.updateExpenseAutomationAccountReconciliationSelectedAccountId = exports.updateExpenseAutomationAccountReconciliationSelectedTab = exports.updateExpenseAutomationReconcileTabLocalData = exports.updateExpenseAutomationReconcileTabListSortState = exports.updateExpenseAutomationReconReviewTabListSortState = exports.updateExpenseAutomationReconcileTabListScrollState = exports.saveExpenseAutomationReconciliationDetail = exports.includeAccountInReconciliation = exports.excludeAccountFromReconciliation = exports.isAnyItemWithUncategorizedExpenseAccount = exports.getLineItemsByTransactionIdsFromLocalData = exports.checkIfAllLineItemsAreCategoryClassFilled = exports.MAX_SELECTION_LIMIT = exports.updateFluxAnalysisViewPageMetaData = exports.updateFluxAnalysisViewUIState = exports.getExpenseAutomationTransactionView = exports.updateCurrentSelectedPeriod = exports.updateCurrentSelectedView = exports.getExpenseAutomationFluxAnalysisView = exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.updateExpenseAutomationMissingReceiptsUIState = void 0;
|
|
43
|
+
exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFA = exports.doMagicLinkSignIn = exports.clearAll = exports.updateCurrentTenant = exports.fetchAllTenants = exports.fetchActiveTenant = exports.isTenantUsingZeniCOA = exports.isZeniDomainTenant = exports.getTenantBaseViewForTenantId = exports.getTenantBaseViewForTenantView = exports.toTenantCoreDetailsView = exports.getTenantsCoreDetailsByCheckInDateSelector = exports.getTenantsBaseByCheckInDateSelector = exports.getTenantsByCheckInDateSelector = exports.getIsAccountingProjectsEnabled = exports.getIsAccountingClassesEnabled = exports.getCurrentTenant = exports.getTenantBaseById = exports.toQuarterStrict = exports.toQuarter = exports.toMonthStrict = exports.toMonth = exports.toScheduleDaysOfMonth = exports.SCHEDULE_DAYS_OF_MONTH = exports.getNumberOfPeriods = exports.toVendorSpendTrendFilterTabsTypeStrict = exports.convertToPeriod = exports.toMonthYearPeriodId = exports.toAbsoluteDay = exports.toTimePeriod = exports.mapTimePeriodtoTimeframeTick = exports.toTimeframeTick = exports.TOP_EX_TIME_PERIODS = exports.toTransactionsSortKey = exports.clearExpenseAutomationTransactionsView = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.initializeTransactionCategorizationViewLocalData = exports.setEntityRecommendationForLineIdsForCategorization = void 0;
|
|
44
|
+
exports.getUserRoleByUserId = exports.isZeniSignedInUser = exports.hasOnlyZeniAccountsAccess = exports.hasOnlyChargeCardAccess = exports.hasOnlyReimbursementAccess = exports.hasRemiFallbackAdminLevelAccess = exports.hasBillPayFallbackAdminLevelAccess = exports.hasSuperAdminLevelAccess = exports.hasZeniRoleOrCompanyOfficerAccess = exports.hasOnlyBillPayAccess = exports.getUserRoleMap = exports.hasInvestorBankerLevelAccess = exports.isNonZeniRole = exports.hasBookKeepingUserLevelAccess = exports.hasBookKeepingAdminLevelAccess = exports.hasEmployeeLevelAccess = exports.hasReimbursementUserAccess = exports.hasFullOrAdminLevelAccess = exports.hasAdminLevelAccess = exports.isFinOpsUserRoleType = exports.toUserRoleTypeStrict = exports.toUserRoleType = exports.getAllZeniUsersFromState = exports.getUsersByUserIds = exports.getUserByUserId = exports.getUserName = exports.getForecast = exports.getClassById = exports.getAccountGroupKey = exports.toAccountGroupType = exports.toAccountType = exports.isOtherProductsEnabledForTenant = exports.isTenantBookkeepingEnabled = exports.isTenantCardsOnly = exports.isTenantBankingOnly = exports.fetchSubscriptionSummaryForTenant = exports.toExternalSupportedTool = exports.toExternalIntegrationType = exports.saveOAuthConnection = exports.saveAPIKeyConnection = exports.deleteConnection = exports.saveExternalConnectionForTenant = exports.fetchExternalConnectionsForTenant = exports.fetchExcludedResourcesForTenant = exports.resetSignInState = exports.sendSessionHeartbeat = exports.doSignOut = exports.updateSignInState = exports.doSignIn = exports.sendEmailMagicLinkToUser = void 0;
|
|
45
45
|
exports.updateOpExByVendorDownloadState = exports.updateOpExByVendorSortOrSearchInProgress = exports.updateOpExByVendorPageFetchInProgress = exports.updateOpExByVendorSort = exports.updateOpExByVendorSearchString = exports.updateOpExByVendorAdditionalBalancesSelection = exports.getOpExByVendorUIState = exports.getOpExByVendorReport = exports.updateOpExByVendorUIState = exports.updateOpExByVendorTimeFrame = exports.fetchOpExByVendorReportForTimeframe = exports.fetchOpExByVendor = exports.fetchOpExWithForecast = exports.getOperatingExpensesForHighlightedRange = exports.getOperatingExpensesForSelectedRange = exports.getOperatingExpensesUIState = exports.getOperatingExpensesReport = exports.getOperatingExpensesReportFetchState = exports.updateOpExUIState = exports.updateOpExDownloadState = exports.updateOpExCOABalancesRange = exports.fetchOpEx = exports.fetchReimbursementCard = exports.fetchBillPayCard = exports.fetchCashBalance = exports.getCashBalance = exports.updateStatementCloseDay = exports.fetchCardBalance = exports.getCardBalance = exports.hasAICFOAccess = exports.hasTreasuryAccessible = exports.hasChargeCardAccessible = exports.hasZeniAccountsAccessible = exports.hasReimbursementAccessible = exports.hasBillPayAccessible = exports.hasAnyFinOpRole = exports.hasAnyCompanyRole = exports.hasZeniAccountsAdminLevelAccess = exports.hasSpendManagementAdminLevelAccess = exports.hasSpendManagementAccess = exports.hasChargeCardAdminLevelAccess = exports.hasBillPayAdminLevelAccess = exports.hasReimbursementAdminLevelAccess = exports.hasReimbursementAccess = exports.hasBillPayAccess = exports.hasTreasuryAdminLevelAccess = exports.hasTreasuryAccess = exports.hasZeniAccountsAccess = exports.hasChargeCardAccess = exports.getUserRoleByUserIds = void 0;
|
|
46
46
|
exports.isRevenueCalculatedSectionID = exports.updateRevenueUIState = exports.updateRevenueDownloadState = exports.updateRevenueCOABalancesRange = exports.getRevenueForHighlightedRange = exports.getRevenueForSelectedRange = exports.getRevenueUIState = exports.getRevenueReportFetchState = exports.getRevenueReport = exports.fetchRevenueWithForecast = exports.fetchRevenue = exports.toAverageMonthsCount = exports.getNetBurnOrIncomeStoryCardReport = exports.updateNetBurnOrIncomeStoryCardSettings = exports.fetchNetBurnOrIncomeStoryCard = exports.isNetBurnOrIncomeReportViewSectionID = exports.isNetBurnOrIncomeReportViewCalculatedSectionID = exports.getNetBurnOrIncomeReportFetchState = exports.getNetBurnOrIncomeUIState = exports.getNetBurnOrIncomeForHighlightedRange = exports.getNetBurnOrIncomeForSelectedRange = exports.getNetBurnOrIncomeReport = exports.updateNetBurnOrIncomeDownloadState = exports.updateNetBurnOrIncomeCOABalancesRange = exports.fetchNetBurnOrIncomeWithForecast = exports.updateNetBurnOrIncomeUIState = exports.fetchNetBurnOrIncome = exports.isNetBurnOrIncomeClassesViewCalculatedSectionID = exports.isNetBurnOrIncomeClassesViewSectionID = exports.getNetBurnOrIncomeClassesViewForSelectedRange = exports.getNetBurnOrIncomeClassesViewForHighlightedRange = exports.getNetBurnOrIncomeClassesView = exports.updateNetBurnOrIncomeClassesViewUIState = exports.updateNetBurnOrIncomeClassesToFilterOut = exports.updateNetBurnOrIncomeAccountViewMode = exports.fetchNetBurnOrIncomeClassesView = exports.isOpExClassesViewCalculatedSectionID = exports.isOpExClassesViewSectionID = exports.getOpExClassesViewForSelectedRange = exports.getOpExClassesViewForHighlightedRange = exports.getOpExClassesView = exports.updateOpExClassesViewUIState = exports.updateOpExClassesToFilterOut = exports.updateOpExAccountViewMode = exports.fetchOpExClassesView = exports.isOpexByVendorIDNotSpecifiedVendor = exports.getOpexVendorTimeframeKey = exports.toOpexByVendorSortKeyType = exports.updateOpExByVendorPageLimit = exports.clearOpExByVendorSearch = void 0;
|
|
47
47
|
exports.getProfitAndLossClassesView = exports.updateClassViewLayout = exports.updateProfitAndLossAccountViewMode = exports.updateProfitAndLossClassesViewUIState = exports.resetProfitAndLossClassesNodeCollapseState = exports.updateProfitAndLossClassesToFilterOut = exports.fetchProfitAndLossClassesView = exports.fetchProfitAndLossForTimeframe = exports.getPandLReportFetchState = exports.getProfitAndLossReport = exports.updateProfitAndLossUIState = exports.resetProfitAndLossNodeCollapseState = exports.fetchProfitAndLoss = exports.getPandLWithForecast = exports.updateDashboardLayout = exports.updateTreasuryVideoClosed = exports.getDashboard = exports.fetchDashboard = exports.getAllTopExpenses = exports.getTop6Expenses = exports.getTopExpenses = exports.updateTopExDownloadState = exports.updateTopExTimeFrame = exports.fetchTopEx = exports.updateCashInCashOutUIState = exports.updateCashInCashOutDownloadState = exports.updateCashInCashOutCOABalancesRange = exports.getCashInCashOutForHighlightedRange = exports.getCashInCashOutForSelectedRange = exports.getCashInCashOutUIState = exports.getCashInCashOut = exports.fetchCashInCashOut = exports.getCashPositionForHighlightedRange = exports.getCashPositionForSelectedRange = exports.getCashPositionUIState = exports.getCashPosition = exports.updateCashPositionUIState = exports.updateCashPositionDownloadState = exports.updateCashPositionCOABalancesRange = exports.fetchCashPosition = exports.isRevenueClassesViewCalculatedSectionID = exports.isRevenueClassesViewSectionID = exports.getRevenueClassesViewForSelectedRange = exports.getRevenueClassesViewForHighlightedRange = exports.getRevenueClassesView = exports.updateRevenueClassesViewUIState = exports.updateRevenueClassesToFilterOut = exports.updateRevenueAccountViewMode = exports.fetchRevenueClassesView = exports.isRevenueSectionID = void 0;
|
|
@@ -283,7 +283,6 @@ Object.defineProperty(exports, "resendVerifyDeviceOTP", { enumerable: true, get:
|
|
|
283
283
|
Object.defineProperty(exports, "resetSignInState", { enumerable: true, get: function () { return tenantReducer_1.resetSignInState; } });
|
|
284
284
|
Object.defineProperty(exports, "deleteConnection", { enumerable: true, get: function () { return tenantReducer_1.deleteConnection; } });
|
|
285
285
|
Object.defineProperty(exports, "saveAPIKeyConnection", { enumerable: true, get: function () { return tenantReducer_1.saveAPIKeyConnection; } });
|
|
286
|
-
Object.defineProperty(exports, "saveConnectorCredentials", { enumerable: true, get: function () { return tenantReducer_1.saveConnectorCredentials; } });
|
|
287
286
|
Object.defineProperty(exports, "saveExternalConnectionForTenant", { enumerable: true, get: function () { return tenantReducer_1.saveExternalConnection; } });
|
|
288
287
|
Object.defineProperty(exports, "saveOAuthConnection", { enumerable: true, get: function () { return tenantReducer_1.saveOAuthConnection; } });
|
|
289
288
|
Object.defineProperty(exports, "sendEmailMagicLinkToUser", { enumerable: true, get: function () { return tenantReducer_1.sendEmailMagicLinkToUser; } });
|
|
@@ -841,6 +840,7 @@ Object.defineProperty(exports, "setAllItemsToCategoryClassInLocalDataForCategori
|
|
|
841
840
|
Object.defineProperty(exports, "setEntityRecommendationForLineIdsForCategorization", { enumerable: true, get: function () { return transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization; } });
|
|
842
841
|
Object.defineProperty(exports, "syncTransactionCategorizationFromDetailSave", { enumerable: true, get: function () { return transactionsViewReducer_1.syncTransactionCategorizationFromDetailSave; } });
|
|
843
842
|
Object.defineProperty(exports, "updateCurrentSelectedTransactionCategorizationTab", { enumerable: true, get: function () { return transactionsViewReducer_1.updateCurrentSelectedTransactionCategorizationTab; } });
|
|
843
|
+
Object.defineProperty(exports, "updateTransactionCategorizationCompletedSubTab", { enumerable: true, get: function () { return transactionsViewReducer_1.updateTransactionCategorizationCompletedSubTab; } });
|
|
844
844
|
Object.defineProperty(exports, "updateSelectedCheckboxTransactionIds", { enumerable: true, get: function () { return transactionsViewReducer_1.updateSelectedCheckboxTransactionIds; } });
|
|
845
845
|
Object.defineProperty(exports, "updateSelectedCustomerForTransaction", { enumerable: true, get: function () { return transactionsViewReducer_1.updateSelectedCustomerForTransaction; } });
|
|
846
846
|
Object.defineProperty(exports, "updateSelectedTransactionId", { enumerable: true, get: function () { return transactionsViewReducer_1.updateSelectedTransactionId; } });
|
|
@@ -868,9 +868,10 @@ Object.defineProperty(exports, "toBatchStatusValue", { enumerable: true, get: fu
|
|
|
868
868
|
Object.defineProperty(exports, "toBulkUploadPhase", { enumerable: true, get: function () { return missingReceiptsViewState_1.toBulkUploadPhase; } });
|
|
869
869
|
Object.defineProperty(exports, "toBulkUploadResultsTab", { enumerable: true, get: function () { return missingReceiptsViewState_1.toBulkUploadResultsTab; } });
|
|
870
870
|
Object.defineProperty(exports, "toBulkUploadSortKey", { enumerable: true, get: function () { return missingReceiptsViewState_1.toBulkUploadSortKey; } });
|
|
871
|
-
Object.defineProperty(exports, "toCompletedSubTab", { enumerable: true, get: function () { return missingReceiptsViewState_1.toCompletedSubTab; } });
|
|
872
871
|
Object.defineProperty(exports, "toMatchSource", { enumerable: true, get: function () { return missingReceiptsViewState_1.toMatchSource; } });
|
|
873
872
|
Object.defineProperty(exports, "toMissingReceiptsTab", { enumerable: true, get: function () { return missingReceiptsViewState_1.toMissingReceiptsTab; } });
|
|
873
|
+
const completedSubTab_1 = require("./view/expenseAutomationView/types/completedSubTab");
|
|
874
|
+
Object.defineProperty(exports, "toCompletedSubTab", { enumerable: true, get: function () { return completedSubTab_1.toCompletedSubTab; } });
|
|
874
875
|
const missingReceiptsViewState_2 = require("./view/expenseAutomationView/types/missingReceiptsViewState");
|
|
875
876
|
Object.defineProperty(exports, "toExpenseAutomationMissingReceiptsSortKey", { enumerable: true, get: function () { return missingReceiptsViewState_2.toMissingReceiptsSortKey; } });
|
|
876
877
|
const reconciliationViewState_1 = require("./view/expenseAutomationView/types/reconciliationViewState");
|
package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js
CHANGED
|
@@ -49,6 +49,10 @@ const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
|
|
|
49
49
|
page_token: pageToken ?? null,
|
|
50
50
|
page_size: manualSearch.pageSize,
|
|
51
51
|
search_text: query,
|
|
52
|
+
// Manual search ignores the Completed sub-tab axis — always span 'all'
|
|
53
|
+
// so the receipt-matching UX returns results regardless of where the
|
|
54
|
+
// transaction would otherwise be bucketed on the Completed tab.
|
|
55
|
+
sub_tab: 'all',
|
|
52
56
|
};
|
|
53
57
|
return zeniAPI
|
|
54
58
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -26,9 +26,14 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
|
|
|
26
26
|
page_token: pageToken,
|
|
27
27
|
page_size: 25,
|
|
28
28
|
search_text: uiState.searchString,
|
|
29
|
+
sub_tab: selectedTab === 'autoCategorized'
|
|
30
|
+
? expenseAutomationTransactionsViewState.selectedTransactionCategorizationCompletedSubTab
|
|
31
|
+
: 'all',
|
|
29
32
|
};
|
|
30
33
|
return zeniAPI
|
|
31
|
-
.getJSON(
|
|
34
|
+
.getJSON(
|
|
35
|
+
// TODO: revert dev override before merge
|
|
36
|
+
`https://dev.api.zeni.ai/version/accounting/shubham/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
32
37
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
33
38
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
34
39
|
const updateActions = [];
|
|
@@ -2,6 +2,7 @@ import { EntityRecommendationPayload } from '../../../commonPayloadTypes/recomme
|
|
|
2
2
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
3
3
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
4
4
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
5
|
+
import { CompletedSubTab } from '../types/completedSubTab';
|
|
5
6
|
export interface TransactionCategorizationQueryPayload {
|
|
6
7
|
auto_categorized: boolean;
|
|
7
8
|
end_date: string | null;
|
|
@@ -11,6 +12,13 @@ export interface TransactionCategorizationQueryPayload {
|
|
|
11
12
|
sort_by: string;
|
|
12
13
|
sort_order: string;
|
|
13
14
|
start_date: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Required. For the Completed (`auto_categorized=true`) listing, scopes the
|
|
17
|
+
* returned page + `total_count` to one of the Completed sub-tabs. For the
|
|
18
|
+
* Review listing it is forced to `'all'` to preserve parent-tab semantics
|
|
19
|
+
* on the backend.
|
|
20
|
+
*/
|
|
21
|
+
sub_tab: CompletedSubTab;
|
|
14
22
|
}
|
|
15
23
|
export interface TransactionCategorizationPayload {
|
|
16
24
|
next_page_token: string | null;
|
|
@@ -6,7 +6,8 @@ import type { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
|
6
6
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
7
7
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
8
8
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
9
|
-
import { type
|
|
9
|
+
import { type CompletedSubTab } from '../types/completedSubTab';
|
|
10
|
+
import { type BatchDetails, type BatchListItem, type BatchStatus, type BulkUploadResultsTab, type BulkUploadSortKey, type BulkUploadState, type ManualSearchResult, type MissingReceiptsViewState, type MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
10
11
|
export declare const getCompletedTransactionsCacheKey: (periodId: MonthYearPeriodId, sortKey: BulkUploadSortKey | undefined, sortOrder: SortOrder | undefined, subTab: CompletedSubTab) => string;
|
|
11
12
|
export declare const initialBulkUploadState: BulkUploadState;
|
|
12
13
|
export declare const initialState: MissingReceiptsViewState;
|
|
@@ -65,7 +65,9 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
65
65
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
66
66
|
}, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
|
|
67
67
|
newSelectedTab: "review" | "autoCategorized";
|
|
68
|
-
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>,
|
|
68
|
+
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "manual" | "ai_accountant"], {
|
|
69
|
+
newSubTab: "all" | "manual" | "ai_accountant";
|
|
70
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
69
71
|
selectedTab: "review" | "autoCategorized";
|
|
70
72
|
fetchState: FetchState;
|
|
71
73
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorizationCompletedSubTab = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -48,12 +48,40 @@ exports.initialTransactionTabViewState = {
|
|
|
48
48
|
selectedTransactionLineId: undefined,
|
|
49
49
|
};
|
|
50
50
|
exports.initialState = {
|
|
51
|
+
autoCategorizedSubTabCache: {},
|
|
51
52
|
selectedTransactionCategorizationTab: 'review',
|
|
53
|
+
selectedTransactionCategorizationCompletedSubTab: 'all',
|
|
52
54
|
transactionCategorizationView: {
|
|
53
55
|
review: { ...exports.initialTransactionTabViewState },
|
|
54
56
|
autoCategorized: { ...exports.initialTransactionTabViewState },
|
|
55
57
|
},
|
|
56
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Capture the autoCategorized tab's current paginated dataset for a sub-tab.
|
|
61
|
+
* The mid-flight `'In-Progress'` state is normalised to `'Completed'` because
|
|
62
|
+
* the in-flight request is cancelled by `switchMap` in the fetch epic when the
|
|
63
|
+
* sub-tab changes — restoring `'In-Progress'` later would leave the UI stuck
|
|
64
|
+
* showing a phantom loading state with no fetch actually running. Length-zero
|
|
65
|
+
* datasets degrade to `'Not-Started'` so the next visit triggers a fresh
|
|
66
|
+
* fetch from page 1 instead of short-circuiting on stale empty caches.
|
|
67
|
+
*/
|
|
68
|
+
function snapshotAutoCategorizedTab(autoCat) {
|
|
69
|
+
const transactionIdsBySelectedPeriod = {
|
|
70
|
+
...autoCat.transactionIdsBySelectedPeriod,
|
|
71
|
+
};
|
|
72
|
+
const hasAnyLoadedRows = Object.values(transactionIdsBySelectedPeriod).some((ids) => ids.length > 0);
|
|
73
|
+
let normalisedFetchState = autoCat.fetchState;
|
|
74
|
+
if (normalisedFetchState === 'In-Progress') {
|
|
75
|
+
normalisedFetchState = hasAnyLoadedRows ? 'Completed' : 'Not-Started';
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
error: autoCat.error,
|
|
79
|
+
fetchState: normalisedFetchState,
|
|
80
|
+
pageToken: autoCat.uiState.pageToken,
|
|
81
|
+
totalCount: { ...autoCat.uiState.totalCount },
|
|
82
|
+
transactionIdsBySelectedPeriod,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
57
85
|
const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
58
86
|
name: 'expenseAutomationTransactionsView',
|
|
59
87
|
initialState: exports.initialState,
|
|
@@ -267,6 +295,48 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
267
295
|
return { payload: { newSelectedTab } };
|
|
268
296
|
},
|
|
269
297
|
},
|
|
298
|
+
updateTransactionCategorizationCompletedSubTab: {
|
|
299
|
+
reducer(draft, action) {
|
|
300
|
+
const { newSubTab } = action.payload;
|
|
301
|
+
const previousSubTab = draft.selectedTransactionCategorizationCompletedSubTab;
|
|
302
|
+
if (previousSubTab === newSubTab) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const autoCat = draft.transactionCategorizationView.autoCategorized;
|
|
306
|
+
// Snapshot the outgoing sub-tab so a future revisit can short-circuit
|
|
307
|
+
// the fetch epic (mirrors the parent-tab "don't refetch what's
|
|
308
|
+
// already cached" behaviour). Period-scoped data is preserved as-is
|
|
309
|
+
// because the snapshot itself is keyed only by sub-tab; the active
|
|
310
|
+
// tab's per-period maps remain the source of truth while live.
|
|
311
|
+
draft.autoCategorizedSubTabCache[previousSubTab] =
|
|
312
|
+
snapshotAutoCategorizedTab(autoCat);
|
|
313
|
+
const cached = draft.autoCategorizedSubTabCache[newSubTab];
|
|
314
|
+
if (cached != null) {
|
|
315
|
+
autoCat.uiState.pageToken = cached.pageToken;
|
|
316
|
+
autoCat.uiState.totalCount = { ...cached.totalCount };
|
|
317
|
+
autoCat.transactionIdsBySelectedPeriod = {
|
|
318
|
+
...cached.transactionIdsBySelectedPeriod,
|
|
319
|
+
};
|
|
320
|
+
autoCat.fetchState = cached.fetchState;
|
|
321
|
+
autoCat.error = cached.error;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
// Sub-tab has never been visited — clear the active slot so the
|
|
325
|
+
// view-epic's `fetchState === 'Not-Started' || transactionIds.length
|
|
326
|
+
// === 0` cache check falls through and triggers a fresh page-1
|
|
327
|
+
// fetch for the new dataset.
|
|
328
|
+
autoCat.uiState.pageToken = null;
|
|
329
|
+
autoCat.uiState.totalCount = {};
|
|
330
|
+
autoCat.transactionIdsBySelectedPeriod = {};
|
|
331
|
+
autoCat.fetchState = 'Not-Started';
|
|
332
|
+
autoCat.error = undefined;
|
|
333
|
+
}
|
|
334
|
+
draft.selectedTransactionCategorizationCompletedSubTab = newSubTab;
|
|
335
|
+
},
|
|
336
|
+
prepare(newSubTab) {
|
|
337
|
+
return { payload: { newSubTab } };
|
|
338
|
+
},
|
|
339
|
+
},
|
|
270
340
|
updateTransactionCategorization: {
|
|
271
341
|
reducer(draft, action) {
|
|
272
342
|
const selectedTab = action.payload.selectedTab;
|
|
@@ -810,5 +880,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
810
880
|
},
|
|
811
881
|
},
|
|
812
882
|
});
|
|
813
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
883
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationCompletedSubTab = _a.updateTransactionCategorizationCompletedSubTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
814
884
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -2,7 +2,8 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { SupportedTransaction } from '../../../entity/transaction/transactionState';
|
|
5
|
-
import type {
|
|
5
|
+
import type { CompletedSubTab } from '../types/completedSubTab';
|
|
6
|
+
import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
6
7
|
export interface CompletedTransactionsSelectorData {
|
|
7
8
|
fetchState: FetchStateAndError;
|
|
8
9
|
nextPageToken: string | null;
|
|
@@ -7,6 +7,7 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
7
7
|
import { SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
8
8
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
9
9
|
import { ProjectListSelectorView } from '../../projectList/projectListSelector';
|
|
10
|
+
import { CompletedSubTab } from '../types/completedSubTab';
|
|
10
11
|
import { TransactionReviewLocalData, TransactionsTab, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
11
12
|
export interface TransactionReviewLocalDataSelectorView {
|
|
12
13
|
transactionId: ID;
|
|
@@ -25,6 +26,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
25
26
|
refreshStatus: FetchStateAndError;
|
|
26
27
|
saveStatus: FetchStateAndError;
|
|
27
28
|
selectedCheckBoxTransactionIds: ID[];
|
|
29
|
+
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
28
30
|
totalCountByTab: Record<TransactionsTab, number>;
|
|
29
31
|
transactionIdsWithUnsavedData: ID[];
|
|
30
32
|
transactionLocalData: TransactionReviewLocalDataSelectorView[];
|
|
@@ -16,7 +16,7 @@ const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
|
16
16
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
17
17
|
function getExpenseAutomationTransactionView(state) {
|
|
18
18
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
19
|
-
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
19
|
+
const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
20
20
|
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
21
21
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
22
22
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
@@ -118,5 +118,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
118
118
|
uploadReceiptStatusById,
|
|
119
119
|
selectedTransactionId,
|
|
120
120
|
selectedTransactionLineId,
|
|
121
|
+
selectedTransactionCategorizationCompletedSubTab,
|
|
121
122
|
};
|
|
122
123
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCompletedSubTab = void 0;
|
|
4
|
+
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
+
/**
|
|
6
|
+
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
7
|
+
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
8
|
+
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
9
|
+
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
10
|
+
*/
|
|
11
|
+
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
12
|
+
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
13
|
+
exports.toCompletedSubTab = toCompletedSubTab;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { CompletedSubTab } from './completedSubTab';
|
|
4
5
|
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
5
6
|
export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
|
|
6
7
|
export interface MissingReceiptsViewUIState {
|
|
@@ -31,8 +32,6 @@ export declare const toBulkUploadResultsTab: (v: string) => "completed" | "unmat
|
|
|
31
32
|
export type BulkUploadResultsTab = ReturnType<typeof toBulkUploadResultsTab>;
|
|
32
33
|
export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatched" | "missing";
|
|
33
34
|
export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
|
|
34
|
-
export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
|
|
35
|
-
export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
|
|
36
35
|
export declare const toMatchSource: (v: string) => "manual" | "ai";
|
|
37
36
|
export type MatchSource = ReturnType<typeof toMatchSource>;
|
|
38
37
|
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBulkUploadSortKey = exports.toMatchSource = exports.
|
|
3
|
+
exports.toBulkUploadSortKey = exports.toMatchSource = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
|
|
4
4
|
exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
|
|
5
5
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
6
6
|
const MISSING_RECEIPTS_SORT_KEYS = [
|
|
@@ -49,9 +49,6 @@ exports.toBulkUploadResultsTab = toBulkUploadResultsTab;
|
|
|
49
49
|
const MISSING_RECEIPTS_TABS = ['missing', 'completed', 'unmatched'];
|
|
50
50
|
const toMissingReceiptsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MISSING_RECEIPTS_TABS);
|
|
51
51
|
exports.toMissingReceiptsTab = toMissingReceiptsTab;
|
|
52
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
53
|
-
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
54
|
-
exports.toCompletedSubTab = toCompletedSubTab;
|
|
55
52
|
const MATCH_SOURCES = ['ai', 'manual'];
|
|
56
53
|
const toMatchSource = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MATCH_SOURCES);
|
|
57
54
|
exports.toMatchSource = toMatchSource;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
-
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { FetchState, FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
|
|
4
4
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
@@ -13,9 +13,11 @@ import { TransactionID } from '../../../entity/transaction/stateTypes/transactio
|
|
|
13
13
|
import { BillableStatus, CategorizationStatusType, PlatformLineDetailType, ProductOrService, TransactionLineBase } from '../../../entity/transaction/stateTypes/transactionLine';
|
|
14
14
|
import { TransactionCategory, TransactionType } from '../../../entity/transaction/stateTypes/transactionType';
|
|
15
15
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
16
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
16
17
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
17
18
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
18
19
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
20
|
+
import { CompletedSubTab } from './completedSubTab';
|
|
19
21
|
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
20
22
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
21
23
|
export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
|
|
@@ -103,7 +105,31 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
103
105
|
selectedTransactionId?: ID;
|
|
104
106
|
selectedTransactionLineId?: ID;
|
|
105
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Snapshot of the autoCategorized tab's paginated dataset for a single
|
|
110
|
+
* Completed sub-tab. Stored in {@link TransactionsViewState.autoCategorizedSubTabCache}
|
|
111
|
+
* so revisiting an already-loaded sub-tab can short-circuit the fetch epic
|
|
112
|
+
* (mirrors parent-tab caching). The snapshot is period-spanning — both the
|
|
113
|
+
* `totalCount` map and `transactionIdsBySelectedPeriod` map preserve every
|
|
114
|
+
* period the user has paged through under that sub-tab.
|
|
115
|
+
*/
|
|
116
|
+
export interface AutoCategorizedSubTabSnapshot {
|
|
117
|
+
error: ZeniAPIStatus | undefined;
|
|
118
|
+
fetchState: FetchState;
|
|
119
|
+
pageToken: PageToken;
|
|
120
|
+
totalCount: Record<MonthYearPeriodId, number>;
|
|
121
|
+
transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
|
|
122
|
+
}
|
|
106
123
|
export type TransactionsViewState = {
|
|
124
|
+
/**
|
|
125
|
+
* Per-sub-tab snapshot cache for the Completed (autoCategorized) tab. Keyed
|
|
126
|
+
* by {@link CompletedSubTab}. Populated as the user navigates between
|
|
127
|
+
* sub-tabs and consulted on every switch — the active autoCategorized slot
|
|
128
|
+
* is restored from here when a snapshot exists, otherwise it is reset and
|
|
129
|
+
* the fetch epic loads page 1 fresh.
|
|
130
|
+
*/
|
|
131
|
+
autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
|
|
132
|
+
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
107
133
|
selectedTransactionCategorizationTab: TransactionsTab;
|
|
108
134
|
transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
|
|
109
135
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.51-
|
|
3
|
+
"version": "5.0.51-betaSS1",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { RootState } from '../../../reducer';
|
|
3
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { saveConnectorCredentials, saveConnectorCredentialsFailure, saveConnectorCredentialsSuccess } from '../tenantReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof saveConnectorCredentials> | ReturnType<typeof saveConnectorCredentialsSuccess> | ReturnType<typeof saveConnectorCredentialsFailure>;
|
|
6
|
-
export declare const saveConnectorCredentialsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
-
payload: {
|
|
8
|
-
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "payments";
|
|
10
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
11
|
-
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
12
|
-
};
|
|
13
|
-
type: "tenant/saveConnectorCredentialsSuccess";
|
|
14
|
-
} | {
|
|
15
|
-
payload: {
|
|
16
|
-
tenantId: string;
|
|
17
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
18
|
-
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
|
-
};
|
|
20
|
-
type: "tenant/saveConnectorCredentialsFailure";
|
|
21
|
-
}>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveConnectorCredentialsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const tenantReducer_1 = require("../tenantReducer");
|
|
8
|
-
// Backs the new POST /1.0/connectors/<slug>/credentials endpoint used by
|
|
9
|
-
// Phase 1 connectors (Stripe + Mercury api_key, PayPal client_credentials).
|
|
10
|
-
// The endpoint is slug-keyed and creates-or-updates the Connection row, so the
|
|
11
|
-
// FE doesn't need a connection_id in the URL. The credentials payload is
|
|
12
|
-
// connector-specific (api_key, or client_id+client_secret) and is forwarded
|
|
13
|
-
// verbatim to the BE — connector-side validation lives in
|
|
14
|
-
// prepare_credential_update_args on the tenant service.
|
|
15
|
-
const saveConnectorCredentialsEpic = (actions$,
|
|
16
|
-
// Underscore prefix marks the parameter as intentionally unused today but
|
|
17
|
-
// names what it will become — when we wire an in-progress guard (so a
|
|
18
|
-
// second save click can't `switchMap`-cancel an in-flight save and leave
|
|
19
|
-
// the BE in an indeterminate state), drop the underscore and read state
|
|
20
|
-
// here.
|
|
21
|
-
_state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.saveConnectorCredentials.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
22
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connectors/${action.payload.connectionName}/credentials`, action.payload.credentials, { 'zeni-tenant-id': action.payload.tenantId })
|
|
23
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
|
-
return (0, rxjs_1.from)([
|
|
26
|
-
(0, tenantReducer_1.saveConnectorCredentialsSuccess)(action.payload.tenantId, action.payload.connectionType, action.payload.connectionName, response.data),
|
|
27
|
-
]);
|
|
28
|
-
}
|
|
29
|
-
const status = response.status ??
|
|
30
|
-
(0, responsePayload_1.createZeniAPIStatus)('Failed to save connection. Please try again.');
|
|
31
|
-
return (0, rxjs_1.from)([
|
|
32
|
-
(0, tenantReducer_1.saveConnectorCredentialsFailure)(action.payload.tenantId, action.payload.connectionName, status),
|
|
33
|
-
]);
|
|
34
|
-
}), (0, operators_1.catchError)((error) => {
|
|
35
|
-
const message = error instanceof Error
|
|
36
|
-
? error.message
|
|
37
|
-
: 'Unexpected error saving connection.';
|
|
38
|
-
return (0, rxjs_1.from)([
|
|
39
|
-
(0, tenantReducer_1.saveConnectorCredentialsFailure)(action.payload.tenantId, action.payload.connectionName, (0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
40
|
-
]);
|
|
41
|
-
}))));
|
|
42
|
-
exports.saveConnectorCredentialsEpic = saveConnectorCredentialsEpic;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { from } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { saveConnectorCredentials, saveConnectorCredentialsFailure, saveConnectorCredentialsSuccess, } from '../tenantReducer';
|
|
5
|
-
// Backs the new POST /1.0/connectors/<slug>/credentials endpoint used by
|
|
6
|
-
// Phase 1 connectors (Stripe + Mercury api_key, PayPal client_credentials).
|
|
7
|
-
// The endpoint is slug-keyed and creates-or-updates the Connection row, so the
|
|
8
|
-
// FE doesn't need a connection_id in the URL. The credentials payload is
|
|
9
|
-
// connector-specific (api_key, or client_id+client_secret) and is forwarded
|
|
10
|
-
// verbatim to the BE — connector-side validation lives in
|
|
11
|
-
// prepare_credential_update_args on the tenant service.
|
|
12
|
-
export const saveConnectorCredentialsEpic = (actions$,
|
|
13
|
-
// Underscore prefix marks the parameter as intentionally unused today but
|
|
14
|
-
// names what it will become — when we wire an in-progress guard (so a
|
|
15
|
-
// second save click can't `switchMap`-cancel an in-flight save and leave
|
|
16
|
-
// the BE in an indeterminate state), drop the underscore and read state
|
|
17
|
-
// here.
|
|
18
|
-
_state$, zeniAPI) => actions$.pipe(filter(saveConnectorCredentials.match), switchMap((action) => zeniAPI
|
|
19
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connectors/${action.payload.connectionName}/credentials`, action.payload.credentials, { 'zeni-tenant-id': action.payload.tenantId })
|
|
20
|
-
.pipe(mergeMap((response) => {
|
|
21
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
22
|
-
return from([
|
|
23
|
-
saveConnectorCredentialsSuccess(action.payload.tenantId, action.payload.connectionType, action.payload.connectionName, response.data),
|
|
24
|
-
]);
|
|
25
|
-
}
|
|
26
|
-
const status = response.status ??
|
|
27
|
-
createZeniAPIStatus('Failed to save connection. Please try again.');
|
|
28
|
-
return from([
|
|
29
|
-
saveConnectorCredentialsFailure(action.payload.tenantId, action.payload.connectionName, status),
|
|
30
|
-
]);
|
|
31
|
-
}), catchError((error) => {
|
|
32
|
-
const message = error instanceof Error
|
|
33
|
-
? error.message
|
|
34
|
-
: 'Unexpected error saving connection.';
|
|
35
|
-
return from([
|
|
36
|
-
saveConnectorCredentialsFailure(action.payload.tenantId, action.payload.connectionName, createZeniAPIStatus(message)),
|
|
37
|
-
]);
|
|
38
|
-
}))));
|