@zeniai/client-epic-state 5.0.76 → 5.0.77-betaAK1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/amount.d.ts +1 -0
- package/lib/commonStateTypes/amount.js +3 -1
- package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +17 -0
- package/lib/commonStateTypes/cacheOverrideFetchReducer.js +20 -0
- package/lib/commonStateTypes/filterPrimitives.d.ts +23 -0
- package/lib/commonStateTypes/filterPrimitives.js +21 -0
- package/lib/commonStateTypes/pusherActions.d.ts +11 -0
- package/lib/commonStateTypes/pusherActions.js +6 -0
- package/lib/coreEpics.js +1 -1
- package/lib/entity/account/accountSelector.d.ts +27 -1
- package/lib/entity/account/accountSelector.js +47 -1
- package/lib/entity/account/accountState.d.ts +6 -1
- package/lib/entity/account/accountState.js +11 -4
- package/lib/entity/account/subAccountSelector.d.ts +1 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCardReducer.d.ts +19 -2
- package/lib/entity/chargeCard/chargeCardReducer.js +35 -2
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +14 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +36 -2
- package/lib/entity/class/classSelector.d.ts +35 -0
- package/lib/entity/class/classSelector.js +50 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/entity/tenant/SessionManager.js +6 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.js +2 -2
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
- package/lib/entity/tenant/tenantReducer.js +6 -1
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventPayload.d.ts +11 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventPayload.js +23 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventReducer.d.ts +6 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventReducer.js +31 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventSelector.d.ts +4 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventSelector.js +16 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventState.d.ts +13 -0
- package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventState.js +2 -0
- package/lib/epic.d.ts +16 -10
- package/lib/epic.js +17 -11
- package/lib/esm/commonStateTypes/amount.js +1 -0
- package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +16 -0
- package/lib/esm/commonStateTypes/filterPrimitives.js +20 -0
- package/lib/esm/commonStateTypes/pusherActions.js +3 -0
- package/lib/esm/coreEpics.js +1 -1
- package/lib/esm/entity/account/accountSelector.js +46 -1
- package/lib/esm/entity/account/accountState.js +7 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
- package/lib/esm/entity/chargeCard/chargeCardReducer.js +34 -1
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +35 -1
- package/lib/esm/entity/class/classSelector.js +48 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/esm/entity/tenant/SessionManager.js +4 -1
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
- package/lib/esm/entity/tenant/tenantReducer.js +6 -1
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
- package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventPayload.js +19 -0
- package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventReducer.js +27 -0
- package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventSelector.js +11 -0
- package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventState.js +1 -0
- package/lib/esm/epic.js +17 -11
- package/lib/esm/index.js +34 -22
- package/lib/esm/reducer.js +8 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
- package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
- package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
- package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +21 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +52 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +56 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +13 -9
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +11 -1
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +21 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +81 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +253 -14
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +2 -0
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +147 -13
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +258 -0
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +17 -0
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
- package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +87 -0
- package/lib/esm/view/recommendation/recommendationHelper.js +29 -0
- package/lib/esm/view/recommendation/recommendationReducer.js +26 -1
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +1 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +82 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +93 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +14 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +6 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +42 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchUpcomingPaymentEventsEpic.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +26 -9
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +4 -2
- package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +121 -6
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +29 -1
- package/lib/index.d.ts +34 -24
- package/lib/index.js +92 -58
- package/lib/reducer.d.ts +8 -2
- package/lib/reducer.js +8 -2
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
- package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +21 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +56 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.d.ts +28 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +60 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +11 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +12 -8
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +10 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +23 -2
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +21 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +15 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +83 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +28 -5
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +253 -14
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +14 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +16 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +2 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +7 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +150 -13
- package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +66 -0
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +262 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +10 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.js +21 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +20 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +44 -2
- package/lib/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +9 -0
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +91 -0
- package/lib/view/recommendation/recommendationHelper.d.ts +9 -0
- package/lib/view/recommendation/recommendationHelper.js +31 -1
- package/lib/view/recommendation/recommendationReducer.d.ts +20 -1
- package/lib/view/recommendation/recommendationReducer.js +27 -2
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +10 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +2 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +20 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +86 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +20 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +98 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +21 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +17 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +5 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +10 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +9 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +46 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchUpcomingPaymentEventsEpic.d.ts +8 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchUpcomingPaymentEventsEpic.js +26 -0
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +18 -3
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +27 -10
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +12 -3
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +4 -2
- package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +11 -1
- package/lib/view/transactionDetail/transactionDetailReducer.js +122 -7
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +2 -0
- package/lib/view/transactionDetail/transactionDetailSelector.js +31 -2
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -0
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
- package/package.json +9 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.revokeChargeCardsInviteSuccessOrFailure = exports.revokeChargeCardsInvite = exports.closeChargeCardsSuccessOrFailure = exports.closeChargeCards = exports.unlockChargeCardsSuccessOrFailure = exports.unlockChargeCards = exports.lockChargeCardsSuccessOrFailure = exports.lockChargeCards = exports.updateChargeCardsSpendLimitSuccessOrFailure = exports.updateChargeCardsSpendLimit = exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateBulkActionCardIds = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateRowActionCardId = exports.updateCreditAccountRepaymentAmountAndDate = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
4
|
+
exports.revokeChargeCardsInviteSuccessOrFailure = exports.revokeChargeCardsInvite = exports.closeChargeCardsSuccessOrFailure = exports.closeChargeCards = exports.unlockChargeCardsSuccessOrFailure = exports.unlockChargeCards = exports.lockChargeCardsSuccessOrFailure = exports.lockChargeCards = exports.updateChargeCardsSpendLimitSuccessOrFailure = exports.updateChargeCardsSpendLimit = exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateCreditAccountBalanceFromPusher = exports.updateChargeCardListUIState = exports.updateBulkActionCardIds = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateRowActionCardId = exports.updateCreditAccountRepaymentAmountAndDate = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
|
+
const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
|
|
7
8
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
8
9
|
const chargeCardList_1 = require("./chargeCardList");
|
|
9
10
|
exports.initialState = {
|
|
@@ -47,6 +48,10 @@ exports.initialState = {
|
|
|
47
48
|
revokeCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
|
|
48
49
|
creditAccountRepayment: chargeCardList_1.initialCreditAccountRepayment,
|
|
49
50
|
};
|
|
51
|
+
// Silent-Pusher-refresh contract: when cacheOverride=true, fetch reducers
|
|
52
|
+
// leave fetchState and error unchanged so the list page's reduceFetchState
|
|
53
|
+
// selector stays 'Completed' and doesn't flash ChargeCardListLoading.
|
|
54
|
+
// See createCacheOverrideFetchReducer for details.
|
|
50
55
|
const chargeCardList = (0, toolkit_1.createSlice)({
|
|
51
56
|
name: 'chargeCardList',
|
|
52
57
|
initialState: exports.initialState,
|
|
@@ -66,10 +71,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
66
71
|
};
|
|
67
72
|
},
|
|
68
73
|
},
|
|
69
|
-
fetchCreditAccountRepayment(draft) {
|
|
74
|
+
fetchCreditAccountRepayment: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
|
|
70
75
|
draft.creditAccountRepayment.fetchState = 'In-Progress';
|
|
71
76
|
draft.creditAccountRepayment.error = undefined;
|
|
72
|
-
},
|
|
77
|
+
}),
|
|
73
78
|
updateCreditAccountRepaymentAmountAndDate(draft, action) {
|
|
74
79
|
draft.creditAccountRepayment.initiatedRepayments = action.payload.amount;
|
|
75
80
|
draft.creditAccountRepayment.initiatedRepaymentDate = action.payload.date;
|
|
@@ -87,10 +92,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
87
92
|
updateRowActionCardId(draft, action) {
|
|
88
93
|
draft.rowActionCardId = action.payload;
|
|
89
94
|
},
|
|
90
|
-
fetchCreditAccount(draft) {
|
|
95
|
+
fetchCreditAccount: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
|
|
91
96
|
draft.creditAccount.fetchState = 'In-Progress';
|
|
92
97
|
draft.creditAccount.error = undefined;
|
|
93
|
-
},
|
|
98
|
+
}),
|
|
94
99
|
updateCreditAccount(draft, action) {
|
|
95
100
|
if (action.payload.length > 0) {
|
|
96
101
|
draft.creditAccount = toCreditAccount(action.payload[0]);
|
|
@@ -103,10 +108,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
103
108
|
error: action.payload,
|
|
104
109
|
};
|
|
105
110
|
},
|
|
106
|
-
fetchDebitCardSummary(draft) {
|
|
111
|
+
fetchDebitCardSummary: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
|
|
107
112
|
draft.debitCardSummaries.fetchState = 'In-Progress';
|
|
108
113
|
draft.debitCardSummaries.error = undefined;
|
|
109
|
-
},
|
|
114
|
+
}),
|
|
110
115
|
updateDebitCardSummary(draft, action) {
|
|
111
116
|
draft.debitCardSummaries = toDebitCardSummaries(action.payload);
|
|
112
117
|
},
|
|
@@ -117,10 +122,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
117
122
|
error: action.payload,
|
|
118
123
|
};
|
|
119
124
|
},
|
|
120
|
-
fetchChargeCardList(draft) {
|
|
125
|
+
fetchChargeCardList: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
|
|
121
126
|
draft.fetchState = 'In-Progress';
|
|
122
127
|
draft.error = undefined;
|
|
123
|
-
},
|
|
128
|
+
}),
|
|
124
129
|
updateChargeCardList(draft, action) {
|
|
125
130
|
const { cards, unassigned_credit } = action.payload.chargeCardListPayload;
|
|
126
131
|
const newCard = cards.map((card) => card.card_id);
|
|
@@ -156,6 +161,18 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
156
161
|
draft.uiState.scrollYOffset = action.payload.uiState.scrollYOffset;
|
|
157
162
|
}
|
|
158
163
|
},
|
|
164
|
+
updateCreditAccountBalanceFromPusher(draft, action) {
|
|
165
|
+
const { currencyCode, currencySymbol } = action.payload;
|
|
166
|
+
const amt = (v) => v !== undefined ? (0, amount_1.toAmount)(v, currencyCode, currencySymbol) : undefined;
|
|
167
|
+
draft.creditAccount.available =
|
|
168
|
+
amt(action.payload.available) ?? draft.creditAccount.available;
|
|
169
|
+
draft.creditAccount.balance =
|
|
170
|
+
amt(action.payload.balance) ?? draft.creditAccount.balance;
|
|
171
|
+
draft.creditAccount.hold =
|
|
172
|
+
amt(action.payload.hold) ?? draft.creditAccount.hold;
|
|
173
|
+
draft.creditAccount.cashback =
|
|
174
|
+
amt(action.payload.cashback) ?? draft.creditAccount.cashback;
|
|
175
|
+
},
|
|
159
176
|
clearChargeCardList(draft) {
|
|
160
177
|
Object.assign(draft, exports.initialState);
|
|
161
178
|
},
|
|
@@ -311,7 +328,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
311
328
|
},
|
|
312
329
|
},
|
|
313
330
|
});
|
|
314
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.updateRowActionCardId = _a.updateRowActionCardId, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateBulkActionCardIds = _a.updateBulkActionCardIds, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure, exports.updateChargeCardsSpendLimit = _a.updateChargeCardsSpendLimit, exports.updateChargeCardsSpendLimitSuccessOrFailure = _a.updateChargeCardsSpendLimitSuccessOrFailure, exports.lockChargeCards = _a.lockChargeCards, exports.lockChargeCardsSuccessOrFailure = _a.lockChargeCardsSuccessOrFailure, exports.unlockChargeCards = _a.unlockChargeCards, exports.unlockChargeCardsSuccessOrFailure = _a.unlockChargeCardsSuccessOrFailure, exports.closeChargeCards = _a.closeChargeCards, exports.closeChargeCardsSuccessOrFailure = _a.closeChargeCardsSuccessOrFailure, exports.revokeChargeCardsInvite = _a.revokeChargeCardsInvite, exports.revokeChargeCardsInviteSuccessOrFailure = _a.revokeChargeCardsInviteSuccessOrFailure;
|
|
331
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.updateRowActionCardId = _a.updateRowActionCardId, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateBulkActionCardIds = _a.updateBulkActionCardIds, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.updateCreditAccountBalanceFromPusher = _a.updateCreditAccountBalanceFromPusher, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure, exports.updateChargeCardsSpendLimit = _a.updateChargeCardsSpendLimit, exports.updateChargeCardsSpendLimitSuccessOrFailure = _a.updateChargeCardsSpendLimitSuccessOrFailure, exports.lockChargeCards = _a.lockChargeCards, exports.lockChargeCardsSuccessOrFailure = _a.lockChargeCardsSuccessOrFailure, exports.unlockChargeCards = _a.unlockChargeCards, exports.unlockChargeCardsSuccessOrFailure = _a.unlockChargeCardsSuccessOrFailure, exports.closeChargeCards = _a.closeChargeCards, exports.closeChargeCardsSuccessOrFailure = _a.closeChargeCardsSuccessOrFailure, exports.revokeChargeCardsInvite = _a.revokeChargeCardsInvite, exports.revokeChargeCardsInviteSuccessOrFailure = _a.revokeChargeCardsInviteSuccessOrFailure;
|
|
315
332
|
exports.default = chargeCardList.reducer;
|
|
316
333
|
// helper
|
|
317
334
|
const toCreditAccount = (payload) => ({
|
|
@@ -17,18 +17,21 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
17
17
|
const state = state$.value;
|
|
18
18
|
const cashbackDetailState = state.cashbackDetailState;
|
|
19
19
|
if (cacheOverride === true) {
|
|
20
|
+
// Forward cacheOverride to all sub-fetches to prevent skeleton flash.
|
|
20
21
|
if (doFetchCreditAccountsDebitSummaryAndCashback === true) {
|
|
21
22
|
if (isCreditCardEnabled) {
|
|
22
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
23
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
|
|
23
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)(true));
|
|
24
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)(true));
|
|
24
25
|
}
|
|
25
26
|
if (isDebitCardEnabled) {
|
|
26
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)());
|
|
27
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)(true));
|
|
27
28
|
}
|
|
28
|
-
chargeCardListPageAction.push((0, cashbackDetailReducer_1.fetchCashbackDetail)());
|
|
29
|
+
chargeCardListPageAction.push((0, cashbackDetailReducer_1.fetchCashbackDetail)(true));
|
|
29
30
|
}
|
|
30
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)());
|
|
31
|
-
|
|
31
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)(true));
|
|
32
|
+
// Config participates in the list page's reduceFetchState — needs cacheOverride.
|
|
33
|
+
chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)(true));
|
|
34
|
+
// These don't participate in the list page's reduceFetchState.
|
|
32
35
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardHolderCandidate', true));
|
|
33
36
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardAdmin', true));
|
|
34
37
|
chargeCardListPageAction.push((0, classListReducer_1.fetchClassList)());
|
package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface PaymentHistoryFilters {
|
|
|
36
36
|
}
|
|
37
37
|
export interface PaymentHistoryFilterCategory {
|
|
38
38
|
field: PaymentHistoryFilterCategoryField;
|
|
39
|
-
matchingOperator: 'equal' | '
|
|
39
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
40
40
|
values: (string | ZeniDate)[];
|
|
41
41
|
valuesCombinationOperator: 'ANY';
|
|
42
42
|
}
|
|
@@ -8,7 +8,9 @@ export declare const addRepaymentToChargeCardPaymentHistory: import("@reduxjs/to
|
|
|
8
8
|
zeniCreditAccountId: ID;
|
|
9
9
|
}, "chargeCardPaymentHistory/addRepaymentToChargeCardPaymentHistory">, fetchChargeCardPaymentPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
10
10
|
cacheOverride: any;
|
|
11
|
-
}, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").
|
|
11
|
+
}, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
12
|
+
cacheOverride: boolean;
|
|
13
|
+
}, "chargeCardPaymentHistory/fetchChargeCardPaymentHistory", never, never>, updateChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPaymentHistoryPayload, "chargeCardPaymentHistory/updateChargeCardPaymentHistory">, updateChargeCardPaymentHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardPaymentHistory/updateChargeCardPaymentHistoryFailure">, clearChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/clearChargeCardPaymentHistory">, updatePaymentHistoryFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
14
|
filters: PaymentHistoryFilters;
|
|
13
15
|
}, "chargeCardPaymentHistory/updatePaymentHistoryFilters">, updatePaymentHistorySearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardPaymentHistory/updatePaymentHistorySearchText">, updatePaymentHistoryDownloadUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
16
|
uiState: Partial<ChargeCardPaymentHistoryDownloadUIState>;
|
|
@@ -3,6 +3,7 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.updatePaymentHistoryUIState = exports.updatePaymentHistoryDownloadUIState = exports.updatePaymentHistorySearchText = exports.updatePaymentHistoryFilters = exports.clearChargeCardPaymentHistory = exports.updateChargeCardPaymentHistoryFailure = exports.updateChargeCardPaymentHistory = exports.fetchChargeCardPaymentHistory = exports.fetchChargeCardPaymentPage = exports.addRepaymentToChargeCardPaymentHistory = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
|
|
6
7
|
const chargeCardPaymentHistory_1 = require("./chargeCardPaymentHistory");
|
|
7
8
|
exports.initialState = chargeCardPaymentHistory_1.initialChargeCardPaymentHistoryState;
|
|
8
9
|
const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
@@ -21,10 +22,10 @@ const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
|
21
22
|
};
|
|
22
23
|
},
|
|
23
24
|
},
|
|
24
|
-
fetchChargeCardPaymentHistory(draft) {
|
|
25
|
+
fetchChargeCardPaymentHistory: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
|
|
25
26
|
draft.fetchState = 'In-Progress';
|
|
26
27
|
draft.error = undefined;
|
|
27
|
-
},
|
|
28
|
+
}),
|
|
28
29
|
updateChargeCardPaymentHistory(draft, action) {
|
|
29
30
|
const payload = action.payload;
|
|
30
31
|
draft.creditAccountId = payload.credit_account_id;
|
|
@@ -11,7 +11,7 @@ const fetchChargeCardPaymentPageEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const chargeCardPaymentHistoryState = state.chargeCardPaymentHistoryState;
|
|
13
13
|
if (cacheOverride === true) {
|
|
14
|
-
chargeCardPaymentPageActions.push((0, chargeCardPaymentHistoryReducer_1.fetchChargeCardPaymentHistory)());
|
|
14
|
+
chargeCardPaymentPageActions.push((0, chargeCardPaymentHistoryReducer_1.fetchChargeCardPaymentHistory)(true));
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
17
|
if (chargeCardPaymentHistoryState.fetchState !== 'Completed' &&
|
|
@@ -3,7 +3,9 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
3
3
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
4
4
|
import { ChargeCardRepaymentDetailLocalData, ChargeCardRepaymentDetailState } from './chargeCardRepaymentDetailState';
|
|
5
5
|
export declare const initialState: ChargeCardRepaymentDetailState;
|
|
6
|
-
export declare const fetchChargeCardRepaymentDetail: import("@reduxjs/toolkit").
|
|
6
|
+
export declare const fetchChargeCardRepaymentDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
7
|
+
cacheOverride: boolean;
|
|
8
|
+
}, "chargeCardRepaymentDetail/fetchChargeCardRepaymentDetail", never, never>, initiateChargeCardRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
9
|
companyId: ID;
|
|
8
10
|
}, "chargeCardRepaymentDetail/initiateChargeCardRepayment">, updateNewAddedChargeCardPaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundingAccount, "chargeCardRepaymentDetail/updateNewAddedChargeCardPaymentAccount">, updateChargeCardRepaymentLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardRepaymentDetailLocalData, "chargeCardRepaymentDetail/updateChargeCardRepaymentLocalStore">, updateChargeCardRepaymentStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
11
|
fetchState: FetchState;
|
|
@@ -3,6 +3,7 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.clearChargeCardRepaymentDetail = exports.updateChargeCardRepaymentStatus = exports.updateChargeCardRepaymentLocalStore = exports.updateNewAddedChargeCardPaymentAccount = exports.initiateChargeCardRepayment = exports.fetchChargeCardRepaymentDetail = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
|
|
6
7
|
exports.initialState = {
|
|
7
8
|
localData: {
|
|
8
9
|
amount: {
|
|
@@ -21,9 +22,12 @@ const chargeCardRepaymentDetail = (0, toolkit_1.createSlice)({
|
|
|
21
22
|
name: 'chargeCardRepaymentDetail',
|
|
22
23
|
initialState: exports.initialState,
|
|
23
24
|
reducers: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// No-op reducer — fetchState is managed by the Pay flow reducers.
|
|
26
|
+
// Uses createCacheOverrideFetchReducer for API consistency with the
|
|
27
|
+
// silent-refresh family (cacheOverride flag at dispatch site).
|
|
28
|
+
fetchChargeCardRepaymentDetail: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)(() => {
|
|
29
|
+
// do nothing
|
|
30
|
+
}),
|
|
27
31
|
updateChargeCardRepaymentLocalStore(draft, action) {
|
|
28
32
|
draft.localData = action.payload;
|
|
29
33
|
},
|
|
@@ -46,7 +46,7 @@ export interface ReimbursementFilters {
|
|
|
46
46
|
}
|
|
47
47
|
export interface ReimbursementFilterCategory {
|
|
48
48
|
field: RemiListViewFilterCategoryField;
|
|
49
|
-
matchingOperator: 'equal' | '
|
|
49
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
50
50
|
values: (string | ZeniDate)[];
|
|
51
51
|
valuesCombinationOperator: 'ANY';
|
|
52
52
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CategoryCombinationOperator, FilterCategoryType } from '../../commonStateTypes/filterPrimitives';
|
|
1
2
|
import { TimePeriod } from '../../commonStateTypes/timePeriod';
|
|
2
3
|
import { UserRoleType } from '../../entity/userRole/userRoleType';
|
|
3
4
|
import { RootState } from '../../reducer';
|
|
@@ -12,12 +13,20 @@ import { ReimbursementView } from './reimbursement/remiListView/remiListSelector
|
|
|
12
13
|
import { ReimbursementFilters, RemiListViewFilterCategoryField } from './reimbursement/remiListView/remiListState';
|
|
13
14
|
export type SpendManagementFiltersType = BillPayFilters | ReimbursementFilters | TaskListFilters | PaymentHistoryFilters;
|
|
14
15
|
export type SpendManagementFilterEntityType = 'bill_pay' | 'reimbursement' | 'task_management' | 'charge_card_payment_history';
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Re-exported here so consumers of `spendManagementFilterHelpers` keep
|
|
18
|
+
* their existing import path stable after the primitives moved to
|
|
19
|
+
* `commonStateTypes/filterPrimitives`. Downstream files (`taskList`,
|
|
20
|
+
* `remiListState`, `chargeCardPaymentHistory`, `billListState`) and the
|
|
21
|
+
* CES barrel still pull `CategoryCombinationOperator` / `FilterCategoryType`
|
|
22
|
+
* from this module — the source of truth is upstream but the surface is
|
|
23
|
+
* unchanged.
|
|
24
|
+
*/
|
|
25
|
+
export type { CategoryCombinationOperator, FilterCategoryType };
|
|
16
26
|
export interface MatchingOperatorDropdownOption {
|
|
17
27
|
label: 'is' | 'is not';
|
|
18
|
-
value: 'equal' | '
|
|
28
|
+
value: 'equal' | 'not_equal';
|
|
19
29
|
}
|
|
20
|
-
export type CategoryCombinationOperator = 'AND' | 'OR';
|
|
21
30
|
export interface BillPayFilterCategoryDropdownOption {
|
|
22
31
|
value: BillListViewFilterCategoryField;
|
|
23
32
|
multiple?: boolean;
|
|
@@ -14,6 +14,8 @@ const helpers_1 = require("./helpers");
|
|
|
14
14
|
const remiListSelector_1 = require("./reimbursement/remiListView/remiListSelector");
|
|
15
15
|
const remiListState_1 = require("./reimbursement/remiListView/remiListState");
|
|
16
16
|
//filters items against filter values representing a range. ex: date (from-to), amount(1k<-->5k)
|
|
17
|
+
// Spend Management uses only equal/not_equal — TC amount operators
|
|
18
|
+
// (inBetween, lessThan, greaterThan) live in the TC filter pipeline.
|
|
17
19
|
const filterItemOnRangeCategoryType = (valueForItem, currentFilter) => {
|
|
18
20
|
let doesItemFallInValueRange = false;
|
|
19
21
|
const filterField = currentFilter.field;
|
|
@@ -47,7 +49,7 @@ const filterItemOnCategoriesWithSingleValue = (categoryValue, currentFilter, ran
|
|
|
47
49
|
return filterItemOnRangeCategoryType(categoryValue, currentFilter);
|
|
48
50
|
}
|
|
49
51
|
// if filter category is not rangeType
|
|
50
|
-
if (currentFilter.matchingOperator === '
|
|
52
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
51
53
|
return currentFilter.values.indexOf(categoryValue.toString()) === -1;
|
|
52
54
|
}
|
|
53
55
|
return currentFilter.values.indexOf(categoryValue.toString()) > -1;
|
|
@@ -121,7 +123,7 @@ const applyAdvancedFiltersOnList = (entity, allItems, filters, filteredItems = [
|
|
|
121
123
|
? getCategoryValueForTaskList(key, item)
|
|
122
124
|
: getCategoryValueForPaymentHistory(key, item);
|
|
123
125
|
if (categoryValue == null) {
|
|
124
|
-
if (currentFilter.matchingOperator === '
|
|
126
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
125
127
|
return true;
|
|
126
128
|
}
|
|
127
129
|
return false;
|
|
@@ -217,7 +217,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
217
217
|
const key = currentFilter.field;
|
|
218
218
|
const categoryValue = getCategoryValueForCompany(key, company);
|
|
219
219
|
if (categoryValue == null) {
|
|
220
|
-
if (currentFilter.matchingOperator === '
|
|
220
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
221
221
|
return true;
|
|
222
222
|
}
|
|
223
223
|
return false;
|
|
@@ -44,7 +44,7 @@ export interface TaskListFilters {
|
|
|
44
44
|
}
|
|
45
45
|
export interface TaskFilterCategory {
|
|
46
46
|
field: TaskListFilterCategoryField;
|
|
47
|
-
matchingOperator: 'equal' | '
|
|
47
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
48
48
|
values: (string | ZeniDate)[];
|
|
49
49
|
valuesCombinationOperator: 'ANY';
|
|
50
50
|
}
|
|
@@ -115,7 +115,17 @@ export declare const downloadAccountingProviderAttachment: import("@reduxjs/tool
|
|
|
115
115
|
amount: number;
|
|
116
116
|
recommendationWithCOTByLineId: RecommendationWithCOTByLineId;
|
|
117
117
|
uncategorizedIncomeExpense: UncategorizedAccounts;
|
|
118
|
-
}, "transactionDetail/setEntityRecommendationForLineIdsForTransactionDetail", never, never>,
|
|
118
|
+
}, "transactionDetail/setEntityRecommendationForLineIdsForTransactionDetail", never, never>, markCategoryClassRecommendationsInProgressForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, lineIds: string[]], {
|
|
119
|
+
transactionId: TransactionID;
|
|
120
|
+
lineIds: string[];
|
|
121
|
+
}, "transactionDetail/markCategoryClassRecommendationsInProgressForTransactionDetail", never, never>, markCategoryClassRecommendationsCompletedForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, lineIds: string[]], {
|
|
122
|
+
transactionId: TransactionID;
|
|
123
|
+
lineIds: string[];
|
|
124
|
+
}, "transactionDetail/markCategoryClassRecommendationsCompletedForTransactionDetail", never, never>, markCategoryClassRecommendationsFailureForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, lineIds: string[], error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
125
|
+
transactionId: TransactionID;
|
|
126
|
+
lineIds: string[];
|
|
127
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
128
|
+
}, "transactionDetail/markCategoryClassRecommendationsFailureForTransactionDetail", never, never>, removeEntityRecommendationForLineIdForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineId: string], {
|
|
119
129
|
transactionId: TransactionID;
|
|
120
130
|
transaction: SupportedTransaction;
|
|
121
131
|
lineId: string;
|
|
@@ -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.setIsVendorUpdateAllChecked = exports.updateVendorBulkRecommendationsFetchStatus = exports.updateLatestSelectedEntity = exports.resetAllLineItemsToVendor = exports.updateVendorToAllLineItems = exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = exports.resetSelectedCustomer = exports.resetVendor = exports.updateSelectedCustomer = exports.updateSelectedVendor = exports.removeEntityRecommendationForLineIdForTransactionDetail = exports.setEntityRecommendationForLineIdsForTransactionDetail = exports.setAllLineItemsLocalDataIsUpdateAllChecked = exports.setAllLineItemsToCategoryClassInLocalData = exports.resetLineItemsCategoryClassInLocalData = exports.clearTransactionDetailLocalData = exports.saveTransactionDetailLocalData = exports.initializeTransactionDetailLocalData = exports.saveTransactionDetail = exports.updateTransactionStateIfUpdateActionNotAllowed = exports.updateStatusConsolidatedSaveTransactionDetail = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.deleteTransactionAttachmentSuccess = exports.deleteTransactionAttachmentFailure = exports.deleteTransactionAttachment = exports.markTransactionAsNotMiscategorized = exports.clearTransactionDetailSaveStatus = exports.updateTransactionDetailSaveStatus = exports.updateTransactionDetail = exports.uploadMissingAttachmentSuccess = exports.clearTransactionDetail = exports.removeTransactionDetail = exports.updateTransactionDetailFetchState = exports.fetchTransactionDetail = exports.downloadAccountingProviderAttachmentFailure = exports.downloadAccountingProviderAttachmentSuccess = exports.downloadAccountingProviderAttachment = exports.initialState = void 0;
|
|
7
|
+
exports.setIsVendorUpdateAllChecked = exports.updateVendorBulkRecommendationsFetchStatus = exports.updateLatestSelectedEntity = exports.resetAllLineItemsToVendor = exports.updateVendorToAllLineItems = exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = exports.resetSelectedCustomer = exports.resetVendor = exports.updateSelectedCustomer = exports.updateSelectedVendor = exports.removeEntityRecommendationForLineIdForTransactionDetail = exports.markCategoryClassRecommendationsFailureForTransactionDetail = exports.markCategoryClassRecommendationsCompletedForTransactionDetail = exports.markCategoryClassRecommendationsInProgressForTransactionDetail = exports.setEntityRecommendationForLineIdsForTransactionDetail = exports.setAllLineItemsLocalDataIsUpdateAllChecked = exports.setAllLineItemsToCategoryClassInLocalData = exports.resetLineItemsCategoryClassInLocalData = exports.clearTransactionDetailLocalData = exports.saveTransactionDetailLocalData = exports.initializeTransactionDetailLocalData = exports.saveTransactionDetail = exports.updateTransactionStateIfUpdateActionNotAllowed = exports.updateStatusConsolidatedSaveTransactionDetail = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.deleteTransactionAttachmentSuccess = exports.deleteTransactionAttachmentFailure = exports.deleteTransactionAttachment = exports.markTransactionAsNotMiscategorized = exports.clearTransactionDetailSaveStatus = exports.updateTransactionDetailSaveStatus = exports.updateTransactionDetail = exports.uploadMissingAttachmentSuccess = exports.clearTransactionDetail = exports.removeTransactionDetail = exports.updateTransactionDetailFetchState = exports.fetchTransactionDetail = exports.downloadAccountingProviderAttachmentFailure = exports.downloadAccountingProviderAttachmentSuccess = exports.downloadAccountingProviderAttachment = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const entity_1 = require("../../entity/genericEntity/entity");
|
|
@@ -245,12 +245,34 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
245
245
|
saveTransactionDetailLocalData(draft, action) {
|
|
246
246
|
const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
247
247
|
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
248
|
-
if (detail
|
|
249
|
-
|
|
250
|
-
...detail,
|
|
251
|
-
transactionDetailLocalData: action.payload.transactionLocalData,
|
|
252
|
-
};
|
|
248
|
+
if (detail == null) {
|
|
249
|
+
return;
|
|
253
250
|
}
|
|
251
|
+
const incoming = action.payload.transactionLocalData;
|
|
252
|
+
const prevById = detail.transactionDetailLocalData.lineItemById;
|
|
253
|
+
// Per-line `categoryClassRecommendationsFetchState` is owned by the
|
|
254
|
+
// recommendation epic/reducers (markInProgress / markCompleted /
|
|
255
|
+
// markFailure / setEntityRecommendationForLineIdsForTransactionDetail).
|
|
256
|
+
// Callers that rebuild `transactionLocalData` from a UI snapshot will
|
|
257
|
+
// typically have an out-of-date copy of this field (e.g. payee-change
|
|
258
|
+
// captures the snapshot before the epic's start arm runs and would
|
|
259
|
+
// otherwise clobber In-Progress back to undefined). Treat the field as
|
|
260
|
+
// sticky: only let the caller override it when they explicitly set it.
|
|
261
|
+
const mergedLineItemById = {};
|
|
262
|
+
Object.entries(incoming.lineItemById ?? {}).forEach(([lineId, line]) => {
|
|
263
|
+
mergedLineItemById[lineId] = {
|
|
264
|
+
...line,
|
|
265
|
+
categoryClassRecommendationsFetchState: line.categoryClassRecommendationsFetchState ??
|
|
266
|
+
prevById?.[lineId]?.categoryClassRecommendationsFetchState,
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
draft.transactionDetailById[key] = {
|
|
270
|
+
...detail,
|
|
271
|
+
transactionDetailLocalData: {
|
|
272
|
+
...incoming,
|
|
273
|
+
lineItemById: mergedLineItemById,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
254
276
|
},
|
|
255
277
|
saveTransactionDetail(draft, action) {
|
|
256
278
|
const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
@@ -372,6 +394,21 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
372
394
|
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
373
395
|
if (detail != null) {
|
|
374
396
|
const newLocalData = (0, transactionDetailLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(transaction, detail.transactionDetailLocalData, action.payload.entity, lineIds, uncategorizedIncomeExpense, recommendationWithCOTByLineId);
|
|
397
|
+
// Release the per-line fetch flag for every line this fetch
|
|
398
|
+
// covered so the inline skeleton resolves and the page-level
|
|
399
|
+
// Save button can re-enable.
|
|
400
|
+
lineIds.forEach((lineId) => {
|
|
401
|
+
const lineItem = newLocalData.lineItemById[lineId];
|
|
402
|
+
if (lineItem != null) {
|
|
403
|
+
newLocalData.lineItemById[lineId] = {
|
|
404
|
+
...lineItem,
|
|
405
|
+
categoryClassRecommendationsFetchState: {
|
|
406
|
+
fetchState: 'Completed',
|
|
407
|
+
error: undefined,
|
|
408
|
+
},
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
});
|
|
375
412
|
draft.transactionDetailById[key] = {
|
|
376
413
|
...detail,
|
|
377
414
|
transactionDetailLocalData: newLocalData,
|
|
@@ -392,6 +429,84 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
392
429
|
};
|
|
393
430
|
},
|
|
394
431
|
},
|
|
432
|
+
// Start arm of the line-update recommendations fetch for the detail
|
|
433
|
+
// page. Flips covered lines to In-Progress; detail page has no
|
|
434
|
+
// checkbox, so no auto-uncheck side effect.
|
|
435
|
+
markCategoryClassRecommendationsInProgressForTransactionDetail: {
|
|
436
|
+
reducer(draft, action) {
|
|
437
|
+
const { transactionId, lineIds } = action.payload;
|
|
438
|
+
const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
439
|
+
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
440
|
+
if (detail != null) {
|
|
441
|
+
lineIds.forEach((lineId) => {
|
|
442
|
+
const lineItem = detail.transactionDetailLocalData.lineItemById[lineId];
|
|
443
|
+
if (lineItem != null) {
|
|
444
|
+
detail.transactionDetailLocalData.lineItemById[lineId] = {
|
|
445
|
+
...lineItem,
|
|
446
|
+
categoryClassRecommendationsFetchState: {
|
|
447
|
+
fetchState: 'In-Progress',
|
|
448
|
+
error: undefined,
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
prepare(transactionId, lineIds) {
|
|
456
|
+
return { payload: { transactionId, lineIds } };
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
// Completed arm. Used when the HTTP call succeeded but the server
|
|
460
|
+
// returned no per-line recommendations — still need to release the
|
|
461
|
+
// In-Progress flag.
|
|
462
|
+
markCategoryClassRecommendationsCompletedForTransactionDetail: {
|
|
463
|
+
reducer(draft, action) {
|
|
464
|
+
const { transactionId, lineIds } = action.payload;
|
|
465
|
+
const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
466
|
+
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
467
|
+
if (detail != null) {
|
|
468
|
+
lineIds.forEach((lineId) => {
|
|
469
|
+
const lineItem = detail.transactionDetailLocalData.lineItemById[lineId];
|
|
470
|
+
if (lineItem != null) {
|
|
471
|
+
detail.transactionDetailLocalData.lineItemById[lineId] = {
|
|
472
|
+
...lineItem,
|
|
473
|
+
categoryClassRecommendationsFetchState: {
|
|
474
|
+
fetchState: 'Completed',
|
|
475
|
+
error: undefined,
|
|
476
|
+
},
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
prepare(transactionId, lineIds) {
|
|
483
|
+
return { payload: { transactionId, lineIds } };
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
markCategoryClassRecommendationsFailureForTransactionDetail: {
|
|
487
|
+
reducer(draft, action) {
|
|
488
|
+
const { transactionId, lineIds, error } = action.payload;
|
|
489
|
+
const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
490
|
+
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
491
|
+
if (detail != null) {
|
|
492
|
+
lineIds.forEach((lineId) => {
|
|
493
|
+
const lineItem = detail.transactionDetailLocalData.lineItemById[lineId];
|
|
494
|
+
if (lineItem != null) {
|
|
495
|
+
detail.transactionDetailLocalData.lineItemById[lineId] = {
|
|
496
|
+
...lineItem,
|
|
497
|
+
categoryClassRecommendationsFetchState: {
|
|
498
|
+
fetchState: 'Error',
|
|
499
|
+
error,
|
|
500
|
+
},
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
prepare(transactionId, lineIds, error) {
|
|
507
|
+
return { payload: { transactionId, lineIds, error } };
|
|
508
|
+
},
|
|
509
|
+
},
|
|
395
510
|
removeEntityRecommendationForLineIdForTransactionDetail: {
|
|
396
511
|
reducer(draft, action) {
|
|
397
512
|
const { transaction, lineId } = action.payload;
|
|
@@ -663,7 +778,7 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
663
778
|
},
|
|
664
779
|
},
|
|
665
780
|
});
|
|
666
|
-
_a = transactionDetail.actions, exports.downloadAccountingProviderAttachment = _a.downloadAccountingProviderAttachment, exports.downloadAccountingProviderAttachmentSuccess = _a.downloadAccountingProviderAttachmentSuccess, exports.downloadAccountingProviderAttachmentFailure = _a.downloadAccountingProviderAttachmentFailure, exports.fetchTransactionDetail = _a.fetchTransactionDetail, exports.updateTransactionDetailFetchState = _a.updateTransactionDetailFetchState, exports.removeTransactionDetail = _a.removeTransactionDetail, exports.clearTransactionDetail = _a.clearTransactionDetail, exports.uploadMissingAttachmentSuccess = _a.uploadMissingAttachmentSuccess, exports.updateTransactionDetail = _a.updateTransactionDetail, exports.updateTransactionDetailSaveStatus = _a.updateTransactionDetailSaveStatus, exports.clearTransactionDetailSaveStatus = _a.clearTransactionDetailSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.deleteTransactionAttachment = _a.deleteTransactionAttachment, exports.deleteTransactionAttachmentFailure = _a.deleteTransactionAttachmentFailure, exports.deleteTransactionAttachmentSuccess = _a.deleteTransactionAttachmentSuccess, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateStatusConsolidatedSaveTransactionDetail = _a.updateStatusConsolidatedSaveTransactionDetail, exports.updateTransactionStateIfUpdateActionNotAllowed = _a.updateTransactionStateIfUpdateActionNotAllowed, exports.saveTransactionDetail = _a.saveTransactionDetail, exports.initializeTransactionDetailLocalData = _a.initializeTransactionDetailLocalData, exports.saveTransactionDetailLocalData = _a.saveTransactionDetailLocalData, exports.clearTransactionDetailLocalData = _a.clearTransactionDetailLocalData, exports.resetLineItemsCategoryClassInLocalData = _a.resetLineItemsCategoryClassInLocalData, exports.setAllLineItemsToCategoryClassInLocalData = _a.setAllLineItemsToCategoryClassInLocalData, exports.setAllLineItemsLocalDataIsUpdateAllChecked = _a.setAllLineItemsLocalDataIsUpdateAllChecked, exports.setEntityRecommendationForLineIdsForTransactionDetail = _a.setEntityRecommendationForLineIdsForTransactionDetail, exports.removeEntityRecommendationForLineIdForTransactionDetail = _a.removeEntityRecommendationForLineIdForTransactionDetail, exports.updateSelectedVendor = _a.updateSelectedVendor, exports.updateSelectedCustomer = _a.updateSelectedCustomer, exports.resetVendor = _a.resetVendor, exports.resetSelectedCustomer = _a.resetSelectedCustomer, exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = _a.updateLocalDataWithTransactionsUpdateWithVendorCheckbox, exports.updateVendorToAllLineItems = _a.updateVendorToAllLineItems, exports.resetAllLineItemsToVendor = _a.resetAllLineItemsToVendor, exports.updateLatestSelectedEntity = _a.updateLatestSelectedEntity, exports.updateVendorBulkRecommendationsFetchStatus = _a.updateVendorBulkRecommendationsFetchStatus, exports.setIsVendorUpdateAllChecked = _a.setIsVendorUpdateAllChecked;
|
|
781
|
+
_a = transactionDetail.actions, exports.downloadAccountingProviderAttachment = _a.downloadAccountingProviderAttachment, exports.downloadAccountingProviderAttachmentSuccess = _a.downloadAccountingProviderAttachmentSuccess, exports.downloadAccountingProviderAttachmentFailure = _a.downloadAccountingProviderAttachmentFailure, exports.fetchTransactionDetail = _a.fetchTransactionDetail, exports.updateTransactionDetailFetchState = _a.updateTransactionDetailFetchState, exports.removeTransactionDetail = _a.removeTransactionDetail, exports.clearTransactionDetail = _a.clearTransactionDetail, exports.uploadMissingAttachmentSuccess = _a.uploadMissingAttachmentSuccess, exports.updateTransactionDetail = _a.updateTransactionDetail, exports.updateTransactionDetailSaveStatus = _a.updateTransactionDetailSaveStatus, exports.clearTransactionDetailSaveStatus = _a.clearTransactionDetailSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.deleteTransactionAttachment = _a.deleteTransactionAttachment, exports.deleteTransactionAttachmentFailure = _a.deleteTransactionAttachmentFailure, exports.deleteTransactionAttachmentSuccess = _a.deleteTransactionAttachmentSuccess, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateStatusConsolidatedSaveTransactionDetail = _a.updateStatusConsolidatedSaveTransactionDetail, exports.updateTransactionStateIfUpdateActionNotAllowed = _a.updateTransactionStateIfUpdateActionNotAllowed, exports.saveTransactionDetail = _a.saveTransactionDetail, exports.initializeTransactionDetailLocalData = _a.initializeTransactionDetailLocalData, exports.saveTransactionDetailLocalData = _a.saveTransactionDetailLocalData, exports.clearTransactionDetailLocalData = _a.clearTransactionDetailLocalData, exports.resetLineItemsCategoryClassInLocalData = _a.resetLineItemsCategoryClassInLocalData, exports.setAllLineItemsToCategoryClassInLocalData = _a.setAllLineItemsToCategoryClassInLocalData, exports.setAllLineItemsLocalDataIsUpdateAllChecked = _a.setAllLineItemsLocalDataIsUpdateAllChecked, exports.setEntityRecommendationForLineIdsForTransactionDetail = _a.setEntityRecommendationForLineIdsForTransactionDetail, exports.markCategoryClassRecommendationsInProgressForTransactionDetail = _a.markCategoryClassRecommendationsInProgressForTransactionDetail, exports.markCategoryClassRecommendationsCompletedForTransactionDetail = _a.markCategoryClassRecommendationsCompletedForTransactionDetail, exports.markCategoryClassRecommendationsFailureForTransactionDetail = _a.markCategoryClassRecommendationsFailureForTransactionDetail, exports.removeEntityRecommendationForLineIdForTransactionDetail = _a.removeEntityRecommendationForLineIdForTransactionDetail, exports.updateSelectedVendor = _a.updateSelectedVendor, exports.updateSelectedCustomer = _a.updateSelectedCustomer, exports.resetVendor = _a.resetVendor, exports.resetSelectedCustomer = _a.resetSelectedCustomer, exports.updateLocalDataWithTransactionsUpdateWithVendorCheckbox = _a.updateLocalDataWithTransactionsUpdateWithVendorCheckbox, exports.updateVendorToAllLineItems = _a.updateVendorToAllLineItems, exports.resetAllLineItemsToVendor = _a.resetAllLineItemsToVendor, exports.updateLatestSelectedEntity = _a.updateLatestSelectedEntity, exports.updateVendorBulkRecommendationsFetchStatus = _a.updateVendorBulkRecommendationsFetchStatus, exports.setIsVendorUpdateAllChecked = _a.setIsVendorUpdateAllChecked;
|
|
667
782
|
exports.default = transactionDetail.reducer;
|
|
668
783
|
function getUpdatedEntityLocalData(detail, updates, entity, resetRecommendations, type) {
|
|
669
784
|
const key = type === 'customer' ? 'customerUpdates' : 'vendorUpdates';
|
|
@@ -18,6 +18,7 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
18
18
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
19
19
|
classList: ClassListSelectorView;
|
|
20
20
|
deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
|
|
21
|
+
hasInFlightCategoryClassRecommendations: boolean;
|
|
21
22
|
isAccountingClassesEnabled: boolean;
|
|
22
23
|
isAccountingProjectsEnabled: boolean;
|
|
23
24
|
linkedTransactions: SupportedTransactionWithCOT[];
|
|
@@ -30,6 +31,7 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
30
31
|
export interface VendorDetailsView extends SelectorView {
|
|
31
32
|
vendors: Vendor[];
|
|
32
33
|
}
|
|
34
|
+
export declare const getDetailInFlightRecommendations: (state: RootState, transactionId: TransactionID) => boolean;
|
|
33
35
|
export declare const getTransactionDetail: (state: RootState, transactionId: TransactionID, fetchLinkedTransactions?: boolean) => TransactionDetailReport;
|
|
34
36
|
export declare function getTransactionDetailForTransaction(rootState: RootState, transactionId: TransactionID): TransactionDetailReport | undefined;
|
|
35
37
|
export declare const getInitialUpdatablePeriodsForTransactionRecommendations: (companyIncorporationDate?: ZeniDate, bookCloseDate?: ZeniDate) => {
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getInitialUpdatablePeriodsForTransactionRecommendations = exports.getTransactionDetail = void 0;
|
|
6
|
+
exports.getInitialUpdatablePeriodsForTransactionRecommendations = exports.getTransactionDetail = exports.getDetailInFlightRecommendations = void 0;
|
|
7
7
|
exports.getTransactionDetailForTransaction = getTransactionDetailForTransaction;
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
@@ -17,6 +17,27 @@ const accountListSelector_1 = require("../accountList/accountListSelector");
|
|
|
17
17
|
const classListSelector_1 = require("../classList/classListSelector");
|
|
18
18
|
const projectListSelector_1 = require("../projectList/projectListSelector");
|
|
19
19
|
const transactionDetailState_1 = require("./transactionDetailState");
|
|
20
|
+
// "Any line on this transaction is fetching category/class recommendations?"
|
|
21
|
+
// Inlined as a plain function because the upstream selector
|
|
22
|
+
// `getTransactionDetail` is also un-memoized and the iteration is O(lines)
|
|
23
|
+
// — typically <10. Exported standalone so consumers that only need the
|
|
24
|
+
// flag (e.g. footer save-disable) can avoid materializing the whole
|
|
25
|
+
// detail report.
|
|
26
|
+
const getDetailInFlightRecommendations = (state, transactionId) => {
|
|
27
|
+
const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
28
|
+
const detail = (0, get_1.default)(state.transactionDetailState.transactionDetailById, detailKey, undefined);
|
|
29
|
+
if (detail == null) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
for (const lineItem of Object.values(detail.transactionDetailLocalData.lineItemById)) {
|
|
33
|
+
if (lineItem.categoryClassRecommendationsFetchState?.fetchState ===
|
|
34
|
+
'In-Progress') {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
exports.getDetailInFlightRecommendations = getDetailInFlightRecommendations;
|
|
20
41
|
const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
21
42
|
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
|
|
22
43
|
const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
@@ -63,7 +84,13 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
63
84
|
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
|
|
64
85
|
const classList = isAccountingClassesEnabled
|
|
65
86
|
? (0, classListSelector_1.getClassList)(classState, classListState)
|
|
66
|
-
: {
|
|
87
|
+
: {
|
|
88
|
+
classes: [],
|
|
89
|
+
nestedClassHierarchy: [],
|
|
90
|
+
fetchState: 'Completed',
|
|
91
|
+
error: undefined,
|
|
92
|
+
version: 0,
|
|
93
|
+
};
|
|
67
94
|
const isAccountingProjectsEnabled = (0, tenantSelector_1.getIsAccountingProjectsEnabled)(state);
|
|
68
95
|
const projectList = isAccountingProjectsEnabled
|
|
69
96
|
? (0, projectListSelector_1.getProjectList)(projectState, projectListState)
|
|
@@ -79,6 +106,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
79
106
|
: [];
|
|
80
107
|
const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
|
|
81
108
|
const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
|
|
109
|
+
const hasInFlightCategoryClassRecommendations = (0, exports.getDetailInFlightRecommendations)(state, transactionId);
|
|
82
110
|
return {
|
|
83
111
|
reportId: 'transaction_detail',
|
|
84
112
|
reportTitle: 'Transaction Detail',
|
|
@@ -94,6 +122,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
94
122
|
classHierarchyList,
|
|
95
123
|
accountsHierarchyList,
|
|
96
124
|
classList: classList,
|
|
125
|
+
hasInFlightCategoryClassRecommendations,
|
|
97
126
|
isAccountingClassesEnabled,
|
|
98
127
|
isAccountingProjectsEnabled,
|
|
99
128
|
projectList,
|