@zeniai/client-epic-state 5.2.41-beta6MM → 5.2.41-beta8MM
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/billPay/billTransaction/billTransactionReducer.d.ts +5 -1
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +17 -2
- package/lib/entity/invoicing/coupon/couponPayload.d.ts +8 -0
- package/lib/entity/invoicing/coupon/couponPayload.js +8 -0
- package/lib/entity/invoicing/coupon/couponState.d.ts +6 -0
- package/lib/entity/invoicing/dunningCase/dunningCaseTypes.d.ts +1 -1
- package/lib/entity/invoicing/plan/planSelector.d.ts +20 -0
- package/lib/entity/invoicing/plan/planSelector.js +42 -0
- package/lib/entity/invoicing/product/productPayload.d.ts +8 -1
- package/lib/entity/invoicing/product/productPayload.js +4 -1
- package/lib/entity/invoicing/product/productState.d.ts +16 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -1
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +79 -5
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/epic.d.ts +4 -1
- package/lib/epic.js +10 -4
- package/lib/esm/entity/billPay/billTransaction/billTransactionReducer.js +16 -1
- package/lib/esm/entity/invoicing/coupon/couponPayload.js +8 -0
- package/lib/esm/entity/invoicing/plan/planSelector.js +39 -0
- package/lib/esm/entity/invoicing/product/productPayload.js +4 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +78 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/epic.js +10 -4
- package/lib/esm/index.js +8 -7
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +3 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +39 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +14 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +10 -13
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +15 -4
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +6 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +74 -1
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +80 -53
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -0
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +6 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +28 -11
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +28 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +67 -35
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +22 -11
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +23 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.js +1 -7
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +19 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +30 -7
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +16 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +22 -11
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +69 -6
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +22 -0
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.js +22 -4
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +18 -4
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +29 -6
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +28 -12
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +37 -2
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +43 -17
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +29 -6
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +30 -14
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +143 -8
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +44 -18
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +29 -8
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +12 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
- package/lib/esm/view/invoicing/invoicingFormDraft.js +78 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +57 -9
- package/lib/esm/view/recommendation/recommendationPayload.js +3 -1
- package/lib/esm/view/recommendation/recommendationReducer.js +27 -7
- package/lib/esm/view/recommendation/recommendationSelector.js +1 -0
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +20 -8
- package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +87 -1
- package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewState.js +4 -0
- package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.js +97 -0
- package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.js +85 -0
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewReducer.js +18 -1
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
- package/lib/esm/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.js +95 -0
- package/lib/index.d.ts +9 -8
- package/lib/index.js +54 -48
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +3 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +20 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +43 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +8 -11
- package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +15 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +18 -0
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +18 -7
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +6 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -3
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +76 -3
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +80 -53
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -0
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +8 -4
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +7 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +27 -10
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +16 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +8 -5
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +7 -2
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +28 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +46 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +69 -36
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +22 -11
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +17 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +22 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.js +1 -7
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +17 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.d.ts +10 -6
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +29 -6
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.d.ts +5 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +16 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +22 -11
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +46 -0
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +68 -5
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts +21 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +24 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.d.ts +9 -5
- package/lib/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.js +22 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +18 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.d.ts +10 -6
- package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +28 -5
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +5 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +29 -13
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +16 -7
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +37 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +8 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.d.ts +15 -10
- package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +42 -16
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.d.ts +10 -6
- package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +28 -5
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.d.ts +5 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +31 -15
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +79 -12
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +145 -9
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +8 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.d.ts +15 -11
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +42 -16
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.d.ts +10 -6
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +28 -7
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +10 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +12 -0
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
- package/lib/view/invoicing/invoicingFormDraft.d.ts +63 -0
- package/lib/view/invoicing/invoicingFormDraft.js +86 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +49 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +59 -10
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
- package/lib/view/recommendation/recommendationPayload.d.ts +1 -0
- package/lib/view/recommendation/recommendationPayload.js +5 -0
- package/lib/view/recommendation/recommendationReducer.d.ts +7 -1
- package/lib/view/recommendation/recommendationReducer.js +28 -8
- package/lib/view/recommendation/recommendationSelector.d.ts +2 -0
- package/lib/view/recommendation/recommendationSelector.js +3 -1
- package/lib/view/recommendation/recommendationState.d.ts +2 -1
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +2 -2
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +18 -6
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +19 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.d.ts +10 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +88 -2
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +1 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.d.ts +7 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.js +4 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.d.ts +37 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.js +104 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.d.ts +24 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.js +92 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +4 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +19 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.d.ts +18 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.js +102 -0
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = void 0;
|
|
4
|
+
exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchFailedJePostingsSuccess = exports.fetchFailedJePostingsFailure = exports.fetchFailedJePostings = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
|
|
5
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJEFailedGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = void 0;
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
8
8
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -68,6 +68,11 @@ exports.initialState = {
|
|
|
68
68
|
jeScheduleAccruedKeysByPeriodAndTab: {},
|
|
69
69
|
jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
|
|
70
70
|
failedJeScheduleTransactionKeysByPeriodAndTab: {},
|
|
71
|
+
failedJePostings: {
|
|
72
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
73
|
+
jeScheduleTransactionKeys: [],
|
|
74
|
+
scheduledJournalEntryIDs: [],
|
|
75
|
+
},
|
|
71
76
|
postStatusById: {},
|
|
72
77
|
ignoreStatusById: {},
|
|
73
78
|
revertStatusById: {},
|
|
@@ -77,6 +82,9 @@ exports.initialState = {
|
|
|
77
82
|
oneTimeAccrualFetchStatusById: {},
|
|
78
83
|
uiState: {
|
|
79
84
|
createdGroupCollapsed: false,
|
|
85
|
+
// Expanded, like the other two. A failed posting is the only thing on this page that is
|
|
86
|
+
// actively wrong, so folding it away by default would hide the reason to open the tab.
|
|
87
|
+
failedGroupCollapsed: false,
|
|
80
88
|
pendingGroupCollapsed: false,
|
|
81
89
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
82
90
|
searchString: '',
|
|
@@ -148,6 +156,59 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
148
156
|
};
|
|
149
157
|
},
|
|
150
158
|
},
|
|
159
|
+
/**
|
|
160
|
+
* The Failed Postings list, fetched separately from the schedules it belongs to.
|
|
161
|
+
*
|
|
162
|
+
* No period and no tab in any of these three: the endpoint applies no date window, so there is
|
|
163
|
+
* one list per tenant and one slot to hold it. `refreshInBackground` keeps a silent refetch
|
|
164
|
+
* from dropping a skeleton over rows already on screen, the same way refreshStatus does for
|
|
165
|
+
* the schedules list.
|
|
166
|
+
*/
|
|
167
|
+
fetchFailedJePostings: {
|
|
168
|
+
reducer(draft, action) {
|
|
169
|
+
if (!action.payload.refreshInBackground) {
|
|
170
|
+
draft.failedJePostings.fetchState = {
|
|
171
|
+
fetchState: 'In-Progress',
|
|
172
|
+
error: undefined,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
prepare(refreshInBackground = false) {
|
|
177
|
+
return { payload: { refreshInBackground } };
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
fetchFailedJePostingsSuccess: {
|
|
181
|
+
reducer(draft, action) {
|
|
182
|
+
// Both lists are replaced, never merged: this response is the whole current answer to
|
|
183
|
+
// "what is failing right now", so an entry it no longer names has stopped failing --
|
|
184
|
+
// resolved by someone else, or posted since -- and must drop out of the group.
|
|
185
|
+
draft.failedJePostings = {
|
|
186
|
+
fetchState: { fetchState: 'Completed', error: undefined },
|
|
187
|
+
jeScheduleTransactionKeys: action.payload.failedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedule.base_transaction)),
|
|
188
|
+
// `?? ''` mirrors toScheduledJournalEntryState, so an entry the server sent without an
|
|
189
|
+
// id lands on the same value on both sides and still matches itself.
|
|
190
|
+
scheduledJournalEntryIDs: action.payload.failedScheduledJournalEntries.map((journalEntry) => journalEntry.scheduled_journal_entry_id ?? ''),
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
prepare(failedJeSchedules, failedScheduledJournalEntries) {
|
|
194
|
+
return { payload: { failedJeSchedules, failedScheduledJournalEntries } };
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
fetchFailedJePostingsFailure: {
|
|
198
|
+
reducer(draft, action) {
|
|
199
|
+
// Keys are deliberately left alone. The schedules list clears its buckets on failure so an
|
|
200
|
+
// errored tab cannot read as "these are all the schedules there are", but this list is a
|
|
201
|
+
// set of outstanding problems -- showing the last known ones beside an error beats
|
|
202
|
+
// implying there are none.
|
|
203
|
+
draft.failedJePostings.fetchState = {
|
|
204
|
+
fetchState: 'Error',
|
|
205
|
+
error: action.payload.status,
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
prepare(status) {
|
|
209
|
+
return { payload: { status } };
|
|
210
|
+
},
|
|
211
|
+
},
|
|
151
212
|
fetchJeSchedulesSuccess(draft, action) {
|
|
152
213
|
const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
|
|
153
214
|
const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
@@ -210,6 +271,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
210
271
|
error: undefined,
|
|
211
272
|
},
|
|
212
273
|
};
|
|
274
|
+
// This posting has just succeeded, so it is no longer part of the failing set. Removing the
|
|
275
|
+
// entry from the schedule entity is not enough on its own: a later detail or Quick View
|
|
276
|
+
// fetch re-adds that month from the server, and because is_posting_failed is never cleared
|
|
277
|
+
// it can still arrive carrying its old error array. With the id left in place the selector
|
|
278
|
+
// would match it again and put a Retry button back on a posting that already went through.
|
|
279
|
+
draft.failedJePostings.scheduledJournalEntryIDs =
|
|
280
|
+
draft.failedJePostings.scheduledJournalEntryIDs.filter((failedEntryID) => failedEntryID !== scheduledJournalEntryID);
|
|
213
281
|
},
|
|
214
282
|
retryJeScheduleFailure(draft, action) {
|
|
215
283
|
const { status, scheduledJournalEntryID } = action.payload;
|
|
@@ -364,6 +432,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
364
432
|
reducer(draft, action) {
|
|
365
433
|
const { failedJeScheduleKey } = action.payload;
|
|
366
434
|
removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
|
|
435
|
+
draft.failedJePostings.jeScheduleTransactionKeys =
|
|
436
|
+
draft.failedJePostings.jeScheduleTransactionKeys.filter((jeScheduleKey) => jeScheduleKey !== failedJeScheduleKey);
|
|
367
437
|
},
|
|
368
438
|
},
|
|
369
439
|
initializeJeScheduleLocalData: {
|
|
@@ -706,6 +776,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
706
776
|
draft.uiState.createdGroupCollapsed =
|
|
707
777
|
!draft.uiState.createdGroupCollapsed;
|
|
708
778
|
},
|
|
779
|
+
toggleJEFailedGroupCollapsed(draft) {
|
|
780
|
+
draft.uiState.failedGroupCollapsed = !draft.uiState.failedGroupCollapsed;
|
|
781
|
+
},
|
|
709
782
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
710
783
|
Object.assign(draft, exports.initialState);
|
|
711
784
|
},
|
|
@@ -716,7 +789,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
716
789
|
});
|
|
717
790
|
},
|
|
718
791
|
});
|
|
719
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
792
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchFailedJePostings = _a.fetchFailedJePostings, exports.fetchFailedJePostingsFailure = _a.fetchFailedJePostingsFailure, exports.fetchFailedJePostingsSuccess = _a.fetchFailedJePostingsSuccess, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEFailedGroupCollapsed = _a.toggleJEFailedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
720
793
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
721
794
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
722
795
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -107,32 +107,27 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
107
107
|
draft.selectedTab = 'review';
|
|
108
108
|
draft.selectedAccountId = action.payload.accountId;
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod)]?.reconciliationByAccountID[action.payload.accountId];
|
|
111
|
+
if (accountRecon == null) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (accountRecon.transactionFetchState.fetchState !== 'Completed' ||
|
|
113
115
|
action.payload.cacheOverride === true) {
|
|
114
|
-
const data = accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId];
|
|
115
116
|
if (action.payload.refreshViewInBackground === true) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
fetchState: 'In-Progress',
|
|
120
|
-
error: undefined,
|
|
121
|
-
},
|
|
122
|
-
accountId: action.payload.accountId,
|
|
123
|
-
reconciliationId: undefined,
|
|
117
|
+
accountRecon.refreshStatus = {
|
|
118
|
+
fetchState: 'In-Progress',
|
|
119
|
+
error: undefined,
|
|
124
120
|
};
|
|
121
|
+
accountRecon.accountId = action.payload.accountId;
|
|
122
|
+
accountRecon.reconciliationId = undefined;
|
|
125
123
|
}
|
|
126
124
|
else {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
fetchState: 'In-Progress',
|
|
131
|
-
error: undefined,
|
|
132
|
-
},
|
|
133
|
-
accountId: action.payload.accountId,
|
|
134
|
-
reconciliationId: undefined,
|
|
125
|
+
accountRecon.transactionFetchState = {
|
|
126
|
+
fetchState: 'In-Progress',
|
|
127
|
+
error: undefined,
|
|
135
128
|
};
|
|
129
|
+
accountRecon.accountId = action.payload.accountId;
|
|
130
|
+
accountRecon.reconciliationId = undefined;
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
}
|
|
@@ -184,14 +179,17 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
184
179
|
}
|
|
185
180
|
}
|
|
186
181
|
else {
|
|
187
|
-
const
|
|
182
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod)]?.reconciliationByAccountID[action.payload.accountId];
|
|
183
|
+
if (accountRecon == null) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
188
186
|
if (action.payload.refreshViewInBackground === true) {
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
accountRecon.refreshStatus.error = action.payload.error;
|
|
188
|
+
accountRecon.refreshStatus.fetchState = 'Error';
|
|
191
189
|
}
|
|
192
190
|
else {
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
accountRecon.transactionFetchState.error = action.payload.error;
|
|
192
|
+
accountRecon.transactionFetchState.fetchState = 'Error';
|
|
195
193
|
}
|
|
196
194
|
}
|
|
197
195
|
},
|
|
@@ -396,8 +394,11 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
396
394
|
},
|
|
397
395
|
setStatementParseInProgress: (draft, action) => {
|
|
398
396
|
const { accountId, selectedPeriod, statementParseInProgress } = action.payload;
|
|
399
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
400
|
-
|
|
397
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
398
|
+
if (accountRecon == null) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
accountRecon.statementParseInProgress = statementParseInProgress;
|
|
401
402
|
},
|
|
402
403
|
setStatementProcessingDismissedToBackground: (draft, action) => {
|
|
403
404
|
const { accountId, selectedPeriod, dismissedToBackground } = action.payload;
|
|
@@ -481,15 +482,23 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
481
482
|
},
|
|
482
483
|
uploadAccountStatementSuccess: (draft, action) => {
|
|
483
484
|
const { accountId, selectedPeriod } = action.payload;
|
|
484
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
485
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
486
|
+
if (accountRecon == null) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
accountRecon.statementUploadStatus = {
|
|
485
490
|
fetchState: 'Completed',
|
|
486
491
|
error: undefined,
|
|
487
492
|
};
|
|
488
|
-
|
|
493
|
+
accountRecon.statementParseInProgress = true;
|
|
489
494
|
},
|
|
490
495
|
uploadAccountStatementFailure: (draft, action) => {
|
|
491
496
|
const { accountId, selectedPeriod } = action.payload;
|
|
492
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
497
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
498
|
+
if (accountRecon == null) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
accountRecon.statementUploadStatus = {
|
|
493
502
|
fetchState: 'Error',
|
|
494
503
|
error: action.payload.error,
|
|
495
504
|
};
|
|
@@ -682,23 +691,34 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
682
691
|
},
|
|
683
692
|
reparseStatementFailure: (draft, action) => {
|
|
684
693
|
const { accountId, selectedPeriod } = action.payload;
|
|
685
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
694
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
695
|
+
if (accountRecon == null) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
accountRecon.reparseStatementStatus = {
|
|
686
699
|
fetchState: 'Error',
|
|
687
700
|
error: action.payload.error,
|
|
688
701
|
};
|
|
689
|
-
|
|
702
|
+
accountRecon.statementProcessingFailed = true;
|
|
690
703
|
},
|
|
691
704
|
resetReparseStatementStatus: (draft, action) => {
|
|
692
705
|
const { accountId, selectedPeriod } = action.payload;
|
|
693
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
706
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
707
|
+
if (accountRecon == null) {
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
accountRecon.reparseStatementStatus = {
|
|
694
711
|
fetchState: 'Not-Started',
|
|
695
712
|
error: undefined,
|
|
696
713
|
};
|
|
697
714
|
},
|
|
698
715
|
updateParsedStatementData: (draft, action) => {
|
|
699
716
|
const { accountId, selectedPeriod, parsedStatementData } = action.payload;
|
|
700
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
701
|
-
|
|
717
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
718
|
+
if (accountRecon == null) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
accountRecon.parsedStatementData = parsedStatementData;
|
|
702
722
|
},
|
|
703
723
|
updateStatementUpdateLocalData: (draft, action) => {
|
|
704
724
|
const { accountId, selectedPeriod, statementUpdateLocalData, statementUploadId, } = action.payload;
|
|
@@ -824,17 +844,21 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
824
844
|
},
|
|
825
845
|
updateAccountReconciliationLocalData: (draft, action) => {
|
|
826
846
|
const { accountId, selectedPeriod, localData } = action.payload;
|
|
827
|
-
const
|
|
847
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
848
|
+
if (accountRecon == null) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const oldLocalData = accountRecon.localData;
|
|
828
852
|
if (oldLocalData == null) {
|
|
829
|
-
|
|
853
|
+
accountRecon.localData = localData;
|
|
830
854
|
}
|
|
831
855
|
else {
|
|
832
|
-
|
|
856
|
+
accountRecon.localData = {
|
|
833
857
|
...oldLocalData,
|
|
834
858
|
...localData,
|
|
835
859
|
};
|
|
836
860
|
}
|
|
837
|
-
|
|
861
|
+
accountRecon.localData = {
|
|
838
862
|
...oldLocalData,
|
|
839
863
|
...localData,
|
|
840
864
|
};
|
|
@@ -1124,7 +1148,10 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
1124
1148
|
}
|
|
1125
1149
|
}
|
|
1126
1150
|
function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accountId, reconciliationData, refreshViewInBackground) {
|
|
1127
|
-
const
|
|
1151
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
1152
|
+
if (accountRecon == null) {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1128
1155
|
const oldConnectionStatus = draft.accountConnectionStatusByAccountID[accountId];
|
|
1129
1156
|
draft.accountConnectionStatusByAccountID[accountId] = {
|
|
1130
1157
|
status: (0, accountReconState_1.toBankStatusCodeType)(reconciliationData.bank_status.code),
|
|
@@ -1134,21 +1161,17 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
|
|
|
1134
1161
|
: false,
|
|
1135
1162
|
paymentAccountId: accounts.payment_account_id ?? undefined,
|
|
1136
1163
|
};
|
|
1137
|
-
const statementParseInProgress = resolveStatementParseInProgressAfterFetch(
|
|
1164
|
+
const statementParseInProgress = resolveStatementParseInProgressAfterFetch(accountRecon, reconciliationData);
|
|
1165
|
+
accountRecon.reconciliationId =
|
|
1166
|
+
reconciliationData.reconciliation_id ?? undefined;
|
|
1167
|
+
accountRecon.statementParseInProgress = statementParseInProgress;
|
|
1138
1168
|
if (refreshViewInBackground === true) {
|
|
1139
|
-
|
|
1140
|
-
...oldRecord,
|
|
1141
|
-
reconciliationId: reconciliationData.reconciliation_id ?? undefined,
|
|
1142
|
-
refreshStatus: { fetchState: 'Completed', error: undefined },
|
|
1143
|
-
statementParseInProgress,
|
|
1144
|
-
};
|
|
1169
|
+
accountRecon.refreshStatus = { fetchState: 'Completed', error: undefined };
|
|
1145
1170
|
}
|
|
1146
1171
|
else {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
reconciliationId: reconciliationData.reconciliation_id ?? undefined,
|
|
1151
|
-
transactionFetchState: { fetchState: 'Completed', error: undefined },
|
|
1172
|
+
accountRecon.transactionFetchState = {
|
|
1173
|
+
fetchState: 'Completed',
|
|
1174
|
+
error: undefined,
|
|
1152
1175
|
};
|
|
1153
1176
|
}
|
|
1154
1177
|
}
|
|
@@ -1178,7 +1201,11 @@ const updateExcludedAccountExclusionInfo = (draft, account) => {
|
|
|
1178
1201
|
};
|
|
1179
1202
|
};
|
|
1180
1203
|
const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, reconciliation, monthYearPeriodId) => {
|
|
1181
|
-
draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId]
|
|
1204
|
+
const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId];
|
|
1205
|
+
if (accountReconciliationRecords == null) {
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
accountReconciliationRecords.reconciliationByAccountID[accountId] = {
|
|
1182
1209
|
accountId,
|
|
1183
1210
|
reconciliationId: reconciliation.reconciliation_id ?? undefined,
|
|
1184
1211
|
transactionFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
@@ -380,6 +380,16 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
380
380
|
if (cached != null) {
|
|
381
381
|
autoCat.uiState.pageToken = cached.pageToken;
|
|
382
382
|
autoCat.uiState.totalCount = { ...cached.totalCount };
|
|
383
|
+
// Keep the stored badge in step with the restored sub-tab: the selector
|
|
384
|
+
// falls back to it for any period this sub-tab has not loaded. Merged,
|
|
385
|
+
// not replaced -- the snapshot only holds periods this sub-tab actually
|
|
386
|
+
// loaded, while the badge map also carries periods filled from a Review
|
|
387
|
+
// response's `other_tab_total_count`. Overwriting would drop those and
|
|
388
|
+
// leave the badge at 0 for any period this sub-tab never visited.
|
|
389
|
+
draft.parentTotalCountByTab.autoCategorized = {
|
|
390
|
+
...draft.parentTotalCountByTab.autoCategorized,
|
|
391
|
+
...cached.totalCount,
|
|
392
|
+
};
|
|
383
393
|
autoCat.uiState.scrollPosition = cached.scrollPosition;
|
|
384
394
|
autoCat.transactionIdsBySelectedPeriod = {
|
|
385
395
|
...cached.transactionIdsBySelectedPeriod,
|
|
@@ -47,6 +47,8 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
47
47
|
completionStatus: CompletionStatusType;
|
|
48
48
|
createdSchedules: JEScheduleRow[];
|
|
49
49
|
createdTotal: number;
|
|
50
|
+
failedPostings: JEScheduledTransactionWithFailedEntries[];
|
|
51
|
+
failedPostingsFetchState: FetchStateAndError;
|
|
50
52
|
hasLoadedForSelectedTab: boolean;
|
|
51
53
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
52
54
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
@@ -61,6 +63,7 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
61
63
|
pendingReviewTotal: number;
|
|
62
64
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
63
65
|
refreshStatus: FetchStateAndError;
|
|
66
|
+
/** @deprecated Alias of `failedPostings`. Remove once webc and app-ui are repointed. */
|
|
64
67
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
65
68
|
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
66
69
|
scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
|
|
@@ -28,10 +28,14 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
28
28
|
isAccountingProjectsEnabled: boolean;
|
|
29
29
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* Tab badge counts under the filters currently applied to the list
|
|
32
|
+
* (transaction group + Completed sub-tab + search), so each badge matches
|
|
33
|
+
* the rows its tab renders. The active tab's entry is {@link totalCountByTab}
|
|
34
|
+
* itself, so it cannot drift when a cache hit skips the fetch; the inactive
|
|
35
|
+
* tab's comes from the listing response's `other_tab_total_count`. Used
|
|
36
|
+
* exclusively to drive the navbar / tab strip badge labels — every other
|
|
37
|
+
* count consumer (pagination, in-list "showing X of Y", save flows) keeps
|
|
38
|
+
* reading {@link totalCountByTab}.
|
|
35
39
|
*/
|
|
36
40
|
parentTabTotalCountByTab: Record<TransactionsTab, number>;
|
|
37
41
|
projectList: ProjectListSelectorView;
|
|
@@ -36,4 +36,5 @@ export interface ExpenseAutomationActualMatchingMatchView {
|
|
|
36
36
|
export declare function getExpenseAutomationActualMatchingMatchView(state: RootState, matchId: ActualMatchingMatchId): ExpenseAutomationActualMatchingMatchView;
|
|
37
37
|
export declare function getCloseMatchAfterUndo(state: RootState): boolean;
|
|
38
38
|
export declare function getCloseMatchAfterIgnoreMatchId(state: RootState): ActualMatchingMatchId | undefined;
|
|
39
|
+
export declare function getActualMatchingMatchModalConfirmStatus(state: RootState): FetchStateAndError;
|
|
39
40
|
export declare function getExpenseAutomationActualMatchingView(state: RootState): ExpenseAutomationActualMatchingViewSelector;
|
|
@@ -17,6 +17,7 @@ exports.buildActualMatchingKpiSummary = buildActualMatchingKpiSummary;
|
|
|
17
17
|
exports.getExpenseAutomationActualMatchingMatchView = getExpenseAutomationActualMatchingMatchView;
|
|
18
18
|
exports.getCloseMatchAfterUndo = getCloseMatchAfterUndo;
|
|
19
19
|
exports.getCloseMatchAfterIgnoreMatchId = getCloseMatchAfterIgnoreMatchId;
|
|
20
|
+
exports.getActualMatchingMatchModalConfirmStatus = getActualMatchingMatchModalConfirmStatus;
|
|
20
21
|
exports.getExpenseAutomationActualMatchingView = getExpenseAutomationActualMatchingView;
|
|
21
22
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
22
23
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -353,6 +354,7 @@ function toActualMatchingMatchView(match) {
|
|
|
353
354
|
: match.leftovers.map(toMatchModalAccrual),
|
|
354
355
|
};
|
|
355
356
|
}
|
|
357
|
+
const EMPTY_ACTUAL_MATCHING_ROWS = [];
|
|
356
358
|
function getExpenseAutomationActualMatchingMatchView(state, matchId) {
|
|
357
359
|
const view = state.expenseAutomationActualMatchingViewState;
|
|
358
360
|
const match = (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId);
|
|
@@ -373,6 +375,9 @@ function getCloseMatchAfterIgnoreMatchId(state) {
|
|
|
373
375
|
return state.expenseAutomationActualMatchingViewState
|
|
374
376
|
.closeMatchAfterIgnoreMatchId;
|
|
375
377
|
}
|
|
378
|
+
function getActualMatchingMatchModalConfirmStatus(state) {
|
|
379
|
+
return state.expenseAutomationActualMatchingViewState.matchModal.confirmStatus;
|
|
380
|
+
}
|
|
376
381
|
function getExpenseAutomationActualMatchingView(state) {
|
|
377
382
|
const { expenseAutomationActualMatchingViewState } = state;
|
|
378
383
|
const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, ignoreStatusByMatchId, undoReversalStatusByMatchId, } = expenseAutomationActualMatchingViewState;
|
|
@@ -389,10 +394,10 @@ function getExpenseAutomationActualMatchingView(state) {
|
|
|
389
394
|
const includeReversed = uiState.statusFilter !== 'pending_review';
|
|
390
395
|
const reversed = includeReversed
|
|
391
396
|
? sortActualMatchingRows(rows.filter((row) => isReversedMatchKind(row.kind)), uiState)
|
|
392
|
-
:
|
|
397
|
+
: EMPTY_ACTUAL_MATCHING_ROWS;
|
|
393
398
|
const pendingReview = includePendingReview
|
|
394
399
|
? sortActualMatchingRows(rows.filter((row) => row.kind === 'pending_review'), uiState)
|
|
395
|
-
:
|
|
400
|
+
: EMPTY_ACTUAL_MATCHING_ROWS;
|
|
396
401
|
const kpiSummary = buildActualMatchingKpiSummary(allRows, getTenantDisplayCurrency(state)?.currencyCode);
|
|
397
402
|
const searchedAccruals = matchModal.accrualSearch.results
|
|
398
403
|
.map((key) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(key, state.jeSchedulesState))
|
|
@@ -225,7 +225,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
225
225
|
const accruedSchedules = [];
|
|
226
226
|
const oneTimeAccruals = [];
|
|
227
227
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
|
|
228
|
-
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab,
|
|
228
|
+
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJePostings, jeScheduleLocalDataById, postStatusById, ignoreStatusById, revertStatusById, oneTimeAccrualActionStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
229
229
|
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
230
230
|
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
231
231
|
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
@@ -264,15 +264,11 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
264
264
|
const jeScheduleTransactionKeysForSelectedTab = selectedPeriodTabKey != null
|
|
265
265
|
? jeScheduleTransactionKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
266
266
|
: undefined;
|
|
267
|
-
const failedJeScheduleTransactionKeysForSelectedTab = selectedPeriodTabKey != null
|
|
268
|
-
? failedJeScheduleTransactionKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
269
|
-
: undefined;
|
|
270
267
|
// Distinguishes "this tab has never been fetched for this period" from "fetched and genuinely
|
|
271
268
|
// empty". Without it the page cannot tell a first visit from a real empty state, and renders an
|
|
272
269
|
// empty table where it should render a skeleton.
|
|
273
270
|
const hasLoadedForSelectedTab = jeScheduleTransactionKeysForSelectedTab != null;
|
|
274
271
|
const jeScheduleTransactionKeys = jeScheduleTransactionKeysForSelectedTab ?? [];
|
|
275
|
-
const failedJeScheduleTransactionKeys = failedJeScheduleTransactionKeysForSelectedTab ?? [];
|
|
276
272
|
const jeScheduleAccruedKeys = (selectedPeriodTabKey != null
|
|
277
273
|
? jeScheduleAccruedKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
278
274
|
: undefined) ?? [];
|
|
@@ -295,24 +291,57 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
295
291
|
accruedSchedules.push(accruedScheduleDetails);
|
|
296
292
|
}
|
|
297
293
|
});
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
294
|
+
// Sourced from the tenant-wide bucket, not the per-period one: a failed posting belongs to no
|
|
295
|
+
// close month, and windowing it is what kept older failures off the only tab that can resolve
|
|
296
|
+
// them.
|
|
297
|
+
failedJePostings.jeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
298
|
+
// getJEScheduledTransactionByJEScheduleTransactionKey throws three different ways: it
|
|
299
|
+
// destructures the result of recordGet without a null check, and it raises explicitly for a
|
|
300
|
+
// missing vendor and for a missing base transaction. Catching rather than pre-checking each
|
|
301
|
+
// one keeps this correct if a fourth is added, and none of the three is recoverable here --
|
|
302
|
+
// the row cannot be drawn either way.
|
|
303
|
+
//
|
|
304
|
+
// This matters more for this bucket than anywhere else on the page. It is tenant-wide, so it
|
|
305
|
+
// names schedules the close-month list never loaded, and the group is defined by deleted
|
|
306
|
+
// vendors and deleted categories -- precisely the rows whose entities are most likely to be
|
|
307
|
+
// missing. Unguarded, one such key takes down the whole JE tab instead of dropping one row.
|
|
308
|
+
try {
|
|
309
|
+
failedJeScheduledTransaction.push((0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state));
|
|
310
|
+
}
|
|
311
|
+
catch {
|
|
312
|
+
// Intentionally swallowed: a failed posting we cannot resolve is one missing row, and the
|
|
313
|
+
// alternative is a blank page for every other row too.
|
|
314
|
+
}
|
|
301
315
|
});
|
|
316
|
+
// What the endpoint last reported as failing. The entity store keeps every month a schedule
|
|
317
|
+
// has and an entry resolved by someone else keeps its old `error` array, so `error` alone would
|
|
318
|
+
// leave a Retry button on a posting that is no longer failing.
|
|
319
|
+
const failedScheduledJournalEntryIDs = new Set(failedJePostings.scheduledJournalEntryIDs);
|
|
302
320
|
const { sortKey, sortOrder, selectedJETypeFilter } = uiState;
|
|
321
|
+
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
322
|
+
getJEScheduleRowType(schedule) === selectedJETypeFilter;
|
|
303
323
|
const unsortedResolveSchedules = [];
|
|
304
324
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
305
|
-
|
|
325
|
+
// Only the entries that actually carry an error. The schedule's entry array is shared state:
|
|
326
|
+
// opening a schedule's detail page or Quick View replaces it with every month the schedule
|
|
327
|
+
// has, posted ones included, so fanning out over all of them turned one failed posting into a
|
|
328
|
+
// row per month -- and a month that never failed has nothing to resolve, so it rendered with
|
|
329
|
+
// an empty action column.
|
|
330
|
+
//
|
|
331
|
+
// Intersected with the ids the endpoint actually returned, not just `error`: the entry array
|
|
332
|
+
// is a cache of every month, and an entry whose failure someone else resolved keeps its stale
|
|
333
|
+
// error array until something overwrites it. Only what the last fetch named is still failing.
|
|
334
|
+
schedule.scheduledJournalEntry
|
|
335
|
+
.filter((journalEntry) => journalEntry.error.length > 0 &&
|
|
336
|
+
failedScheduledJournalEntryIDs.has(journalEntry.scheduledJournalEntryID))
|
|
337
|
+
.forEach((journalEntry) => {
|
|
306
338
|
unsortedResolveSchedules.push({
|
|
307
339
|
...schedule,
|
|
308
340
|
scheduledJournalEntry: journalEntry,
|
|
309
341
|
});
|
|
310
342
|
});
|
|
311
343
|
});
|
|
312
|
-
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
313
|
-
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
314
|
-
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
315
|
-
getJEScheduleRowType(schedule) === selectedJETypeFilter;
|
|
344
|
+
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules.filter(matchesTypeFilter), sortKey, sortOrder);
|
|
316
345
|
const isCreatedStatus = (schedule) => {
|
|
317
346
|
// An accrual is "created" once it is not review work: posted, reversing, reversed, or in a
|
|
318
347
|
// transient posting claim.
|
|
@@ -330,7 +359,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
330
359
|
];
|
|
331
360
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
332
361
|
...allScheduleRows.filter((schedule) => isPendingReviewRow(schedule) && matchesTypeFilter(schedule)),
|
|
333
|
-
...validResolveForPending,
|
|
334
362
|
], sortKey, sortOrder);
|
|
335
363
|
const createdSchedules = sortJEScheduledTransactions(allScheduleRows.filter((schedule) => isCreatedStatus(schedule) && matchesTypeFilter(schedule)), sortKey, sortOrder);
|
|
336
364
|
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
@@ -449,6 +477,13 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
449
477
|
kpiSummary,
|
|
450
478
|
pendingReviewSchedules,
|
|
451
479
|
pendingReviewTotal,
|
|
480
|
+
failedPostings: resolveSchedules,
|
|
481
|
+
// Exposed so a consumer can tell "still loading" and "the lookup failed" from "nothing has
|
|
482
|
+
// failed". The bucket keeps its rows on failure precisely so an error can be shown beside
|
|
483
|
+
// them, which is only possible if the state travels with them.
|
|
484
|
+
failedPostingsFetchState: failedJePostings.fetchState,
|
|
485
|
+
// Deprecated alias of failedPostings. Still read by the section's footer-form effect and by
|
|
486
|
+
// app-ui analytics; remove once both are repointed.
|
|
452
487
|
resolveSchedules: resolveSchedules,
|
|
453
488
|
accountSettingsView,
|
|
454
489
|
newScheduleView,
|