@zeniai/client-epic-state 5.0.76 → 5.0.77-betaAD01
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/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/aiCfo/aiCfoPayload.d.ts +2 -0
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoReducer.js +33 -3
- package/lib/entity/aiCfo/aiCfoSelector.js +13 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +2 -0
- 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/epic.d.ts +14 -10
- package/lib/epic.js +15 -11
- 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/aiCfo/aiCfoReducer.js +32 -2
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +13 -1
- 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/epic.js +15 -11
- package/lib/esm/index.js +34 -24
- package/lib/esm/reducer.js +2 -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/aiCfoView/aiCfoViewReducer.js +11 -1
- package/lib/esm/view/aiCfoView/epics/updateChatSessionPinEpic.js +46 -0
- 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/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 +33 -26
- package/lib/index.js +89 -58
- package/lib/reducer.d.ts +2 -2
- package/lib/reducer.js +2 -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/aiCfoView/aiCfoViewReducer.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +12 -2
- package/lib/view/aiCfoView/epics/updateChatSessionPinEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/updateChatSessionPinEpic.js +50 -0
- 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/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
package/lib/reducer.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { AccountGroupState } from './entity/accountGroup/accountGroupState';
|
|
|
3
3
|
import { AccountReconState } from './entity/accountRecon/accountReconState';
|
|
4
4
|
import { AddressState } from './entity/address/addressState';
|
|
5
5
|
import { AiAccountantCustomerState } from './entity/aiAccountantCustomer/aiAccountantCustomerState';
|
|
6
|
-
import { CreditAgentEntityState } from './entity/creditAgent/creditAgentState';
|
|
7
6
|
import { AiCfoState } from './entity/aiCfo/aiCfoState';
|
|
8
7
|
import { ApprovalRuleState } from './entity/approvalRule/approvalRuleState';
|
|
9
8
|
import { BankAccountState } from './entity/bankAccount/bankAccount';
|
|
@@ -19,6 +18,7 @@ import { CompanyState } from './entity/company/companyState';
|
|
|
19
18
|
import { CompanyHealthState } from './entity/companyHealthMetric/companyHealthMetricState';
|
|
20
19
|
import { ConnectedAccountState } from './entity/connectedAccount/connectedAccount';
|
|
21
20
|
import { CountryListState } from './entity/countryList/countryListState';
|
|
21
|
+
import { CreditAgentEntityState } from './entity/creditAgent/creditAgentState';
|
|
22
22
|
import { CurrencyState } from './entity/currency/currency';
|
|
23
23
|
import { CustomerState } from './entity/customer/customerState';
|
|
24
24
|
import { CustomerIncomeState } from './entity/customerIncome/customerIncomeTrendState';
|
|
@@ -106,8 +106,8 @@ import { JESchedulesViewState as ExpenseAutomationJESchedulesViewState } from '.
|
|
|
106
106
|
import { MissingReceiptsViewState as ExpenseAutomationMissingReceiptsViewState } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
107
107
|
import { ReconciliationViewState as ExpenseAutomationReconciliationViewState } from './view/expenseAutomationView/types/reconciliationViewState';
|
|
108
108
|
import { TransactionsViewState as ExpenseAutomationTransactionsViewState } from './view/expenseAutomationView/types/transactionsViewState';
|
|
109
|
-
import { FileViewState } from './view/fileView/fileViewState';
|
|
110
109
|
import { FeatureNotificationViewState } from './view/featureNotificationView/featureNotificationViewState';
|
|
110
|
+
import { FileViewState } from './view/fileView/fileViewState';
|
|
111
111
|
import { FinanceStatementState } from './view/financeStatement/financeStatementState';
|
|
112
112
|
import { ForecastListState } from './view/forecastList/forecastListState';
|
|
113
113
|
import { GlobalMerchantAutoCompleteState } from './view/globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewState';
|
package/lib/reducer.js
CHANGED
|
@@ -43,7 +43,6 @@ const accountGroupReducer_1 = __importStar(require("./entity/accountGroup/accoun
|
|
|
43
43
|
const accountReconReducer_1 = __importStar(require("./entity/accountRecon/accountReconReducer"));
|
|
44
44
|
const addressReducer_1 = __importStar(require("./entity/address/addressReducer"));
|
|
45
45
|
const aiAccountantCustomerReducer_1 = __importStar(require("./entity/aiAccountantCustomer/aiAccountantCustomerReducer"));
|
|
46
|
-
const creditAgentReducer_1 = __importStar(require("./entity/creditAgent/creditAgentReducer"));
|
|
47
46
|
const aiCfoReducer_1 = __importStar(require("./entity/aiCfo/aiCfoReducer"));
|
|
48
47
|
const approvalRuleReducer_1 = __importStar(require("./entity/approvalRule/approvalRuleReducer"));
|
|
49
48
|
const bankAccountReducer_1 = __importStar(require("./entity/bankAccount/bankAccountReducer"));
|
|
@@ -59,6 +58,7 @@ const companyReducer_1 = __importStar(require("./entity/company/companyReducer")
|
|
|
59
58
|
const companyHealthMetricReducer_1 = __importStar(require("./entity/companyHealthMetric/companyHealthMetricReducer"));
|
|
60
59
|
const connectedAccountReducer_1 = __importStar(require("./entity/connectedAccount/connectedAccountReducer"));
|
|
61
60
|
const countryListReducer_1 = __importStar(require("./entity/countryList/countryListReducer"));
|
|
61
|
+
const creditAgentReducer_1 = __importStar(require("./entity/creditAgent/creditAgentReducer"));
|
|
62
62
|
const currencyReducer_1 = __importStar(require("./entity/currency/currencyReducer"));
|
|
63
63
|
const customerReducer_1 = __importStar(require("./entity/customer/customerReducer"));
|
|
64
64
|
const customerIncomeTrendReducer_1 = __importStar(require("./entity/customerIncome/customerIncomeTrendReducer"));
|
|
@@ -146,9 +146,9 @@ const jeSchedulesViewReducer_1 = __importStar(require("./view/expenseAutomationV
|
|
|
146
146
|
const missingReceiptsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/missingReceiptsViewReducer"));
|
|
147
147
|
const reconciliationViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/reconciliationViewReducer"));
|
|
148
148
|
const transactionsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/transactionsViewReducer"));
|
|
149
|
+
const featureNotificationViewReducer_1 = __importStar(require("./view/featureNotificationView/featureNotificationViewReducer"));
|
|
149
150
|
const fileViewReducer_1 = __importDefault(require("./view/fileView/fileViewReducer"));
|
|
150
151
|
const fileViewState_1 = require("./view/fileView/fileViewState");
|
|
151
|
-
const featureNotificationViewReducer_1 = __importStar(require("./view/featureNotificationView/featureNotificationViewReducer"));
|
|
152
152
|
const financeStatementReducer_1 = __importStar(require("./view/financeStatement/financeStatementReducer"));
|
|
153
153
|
const forecastListReducer_1 = __importStar(require("./view/forecastList/forecastListReducer"));
|
|
154
154
|
const globalMerchantAutoCompleteViewReducer_1 = __importStar(require("./view/globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewReducer"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ZeniAPIResponse } from '../../responsePayload';
|
|
2
|
-
export { AiAccountantCustomerPayload, AiAccountantEnrollmentPayload, AiAccountantJobPayload, toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
|
|
3
1
|
import type { AiAccountantCustomerPayload, AiAccountantJobPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
|
|
4
2
|
import { UserPayload } from '../../entity/user/userPayload';
|
|
3
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
|
+
export { AiAccountantCustomerPayload, AiAccountantEnrollmentPayload, AiAccountantJobPayload, toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
|
|
5
5
|
export interface AiAccountantCustomersResponseData {
|
|
6
6
|
customers: AiAccountantCustomerPayload[];
|
|
7
7
|
users: UserPayload[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AiAccountantCustomerPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
|
|
2
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { AiAccountantCustomerPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
|
|
3
3
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
4
|
import { AiAccountantUIState, AiAccountantViewState } from './aiAccountantViewState';
|
|
5
5
|
export declare const initialAiAccountantViewState: AiAccountantViewState;
|
|
@@ -10,9 +10,7 @@ const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
|
10
10
|
const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantCustomers.match), (0, operators_1.switchMap)(() => {
|
|
11
11
|
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
12
12
|
const url = `${base}/ai-accountant/customers`;
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.getJSON(url)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
16
14
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
17
15
|
const customers = response.data?.customers ?? [];
|
|
18
16
|
const users = response.data?.users ?? [];
|
|
@@ -25,7 +23,6 @@ const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((
|
|
|
25
23
|
else {
|
|
26
24
|
return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)(response.status));
|
|
27
25
|
}
|
|
28
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' +
|
|
29
|
-
JSON.stringify(error))))));
|
|
26
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' + JSON.stringify(error))))));
|
|
30
27
|
}));
|
|
31
28
|
exports.fetchAiAccountantCustomersEpic = fetchAiAccountantCustomersEpic;
|
|
@@ -23,9 +23,7 @@ const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
23
23
|
}
|
|
24
24
|
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
25
25
|
const url = `${base}/ai-accountant/jobs?${params.toString()}`;
|
|
26
|
-
return zeniAPI
|
|
27
|
-
.getJSON(url)
|
|
28
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
26
|
+
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
29
27
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
30
28
|
const jobs = response.data?.jobs ?? [];
|
|
31
29
|
const users = response.data?.users ?? [];
|
|
@@ -44,8 +42,7 @@ const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
44
42
|
}
|
|
45
43
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
|
|
46
44
|
tenantId,
|
|
47
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' +
|
|
48
|
-
JSON.stringify(error)),
|
|
45
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' + JSON.stringify(error)),
|
|
49
46
|
}))));
|
|
50
47
|
}));
|
|
51
48
|
exports.fetchAiAccountantJobsEpic = fetchAiAccountantJobsEpic;
|
|
@@ -54,7 +54,10 @@ const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
54
54
|
messageText: 'failed',
|
|
55
55
|
type: 'error',
|
|
56
56
|
variables: [
|
|
57
|
-
{
|
|
57
|
+
{
|
|
58
|
+
variableName: '__reason__',
|
|
59
|
+
variableValue: 'Unexpected error',
|
|
60
|
+
},
|
|
58
61
|
],
|
|
59
62
|
}),
|
|
60
63
|
])));
|
|
@@ -87,7 +87,10 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
87
87
|
error: ZeniAPIStatus;
|
|
88
88
|
}, "aiCfoView/deleteChatSessionFailure">, clearDeleteChatSessionStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
89
89
|
chatSessionId: ID;
|
|
90
|
-
}, "aiCfoView/clearDeleteChatSessionStatus">,
|
|
90
|
+
}, "aiCfoView/clearDeleteChatSessionStatus">, updateChatSessionPin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chatSessionId: string, isPinned: boolean], {
|
|
91
|
+
chatSessionId: string;
|
|
92
|
+
isPinned: boolean;
|
|
93
|
+
}, "aiCfoView/updateChatSessionPin", never, never>, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">, updateCotCollapsedState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
91
94
|
isCollapsed: boolean;
|
|
92
95
|
questionAnswerId: ID;
|
|
93
96
|
}, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
4
|
+
exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateCotCollapsedState = exports.clearAiCfoView = exports.updateChatSessionPin = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
function removeSessionIdFromPageKeyMap(draft, sessionId) {
|
|
7
7
|
const map = draft.uiState.chatSessionIdByPageKey;
|
|
@@ -381,6 +381,16 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
381
381
|
const { chatSessionId } = action.payload;
|
|
382
382
|
delete draft.deleteChatSessionStateByChatSessionId[chatSessionId];
|
|
383
383
|
},
|
|
384
|
+
/** Dispatched to trigger {@link updateChatSessionPinEpic}; no view state mutation. */
|
|
385
|
+
updateChatSessionPin: {
|
|
386
|
+
reducer(draft, _action) {
|
|
387
|
+
void draft;
|
|
388
|
+
void _action;
|
|
389
|
+
},
|
|
390
|
+
prepare(chatSessionId, isPinned) {
|
|
391
|
+
return { payload: { chatSessionId, isPinned } };
|
|
392
|
+
},
|
|
393
|
+
},
|
|
384
394
|
clearInput(draft) {
|
|
385
395
|
draft.uiState.currentInput = '';
|
|
386
396
|
},
|
|
@@ -456,5 +466,5 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
456
466
|
},
|
|
457
467
|
},
|
|
458
468
|
});
|
|
459
|
-
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure, exports.applyAiCfoSidePanelHostPageTransition = _a.applyAiCfoSidePanelHostPageTransition, exports.clearAiCfoSidePanelHostPageContext = _a.clearAiCfoSidePanelHostPageContext;
|
|
469
|
+
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.updateChatSessionPin = _a.updateChatSessionPin, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure, exports.applyAiCfoSidePanelHostPageTransition = _a.applyAiCfoSidePanelHostPageTransition, exports.clearAiCfoSidePanelHostPageContext = _a.clearAiCfoSidePanelHostPageContext;
|
|
460
470
|
exports.default = aiCfoView.reducer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { mergeChatSessionFromPutResponse } from '../../../entity/aiCfo/aiCfoReducer';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
|
+
import { updateChatSessionPin } from '../aiCfoViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateChatSessionPin> | ReturnType<typeof mergeChatSessionFromPutResponse>;
|
|
8
|
+
export declare const updateChatSessionPinEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateChatSessionPinEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
+
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
9
|
+
/**
|
|
10
|
+
* TEMP (remove after chat platform pin API is deployed everywhere):
|
|
11
|
+
* When PUT pin/unpin fails, still merge requested pin state so the drawer/navbar UX works
|
|
12
|
+
* against older backends. Revert this file when the platform supports pin or when dropping
|
|
13
|
+
* compatibility — search for `TEMP_PIN_OPTIMISTIC`.
|
|
14
|
+
*/
|
|
15
|
+
function buildOptimisticPinPayload_TEMP_PIN_OPTIMISTIC(state, chatSessionId, isPinned) {
|
|
16
|
+
const session = state.aiCfoState.aiCfoByChatSessionId[chatSessionId]?.chatSession;
|
|
17
|
+
if (session == null) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
chat_session_id: chatSessionId,
|
|
22
|
+
user_id: session.userId,
|
|
23
|
+
created_at: session.createdAt.toISOString(),
|
|
24
|
+
chat_session_summary: session.chatSessionSummary ?? null,
|
|
25
|
+
is_pinned: isPinned,
|
|
26
|
+
pinned_at: isPinned ? new Date().toISOString() : null,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const updateChatSessionPinEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.updateChatSessionPin.match), (0, operators_1.switchMap)((action) => {
|
|
30
|
+
const { chatSessionId, isPinned } = action.payload;
|
|
31
|
+
return zeniAPI
|
|
32
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions/${chatSessionId}`, { is_pinned: isPinned })
|
|
33
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
34
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
35
|
+
return (0, rxjs_1.of)((0, aiCfoReducer_1.mergeChatSessionFromPutResponse)(response.data));
|
|
36
|
+
}
|
|
37
|
+
// TEMP_PIN_OPTIMISTIC — see comment above
|
|
38
|
+
const synthetic = buildOptimisticPinPayload_TEMP_PIN_OPTIMISTIC(state$.value, chatSessionId, isPinned);
|
|
39
|
+
return synthetic != null
|
|
40
|
+
? (0, rxjs_1.of)((0, aiCfoReducer_1.mergeChatSessionFromPutResponse)(synthetic))
|
|
41
|
+
: rxjs_1.EMPTY;
|
|
42
|
+
}), (0, operators_1.catchError)(() => {
|
|
43
|
+
// TEMP_PIN_OPTIMISTIC — see comment above
|
|
44
|
+
const synthetic = buildOptimisticPinPayload_TEMP_PIN_OPTIMISTIC(state$.value, chatSessionId, isPinned);
|
|
45
|
+
return synthetic != null
|
|
46
|
+
? (0, rxjs_1.of)((0, aiCfoReducer_1.mergeChatSessionFromPutResponse)(synthetic))
|
|
47
|
+
: rxjs_1.EMPTY;
|
|
48
|
+
}));
|
|
49
|
+
}));
|
|
50
|
+
exports.updateChatSessionPinEpic = updateChatSessionPinEpic;
|
|
@@ -299,7 +299,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
299
299
|
const key = currentFilter.field;
|
|
300
300
|
const categoryValue = getCategoryValueForCompany(key, company);
|
|
301
301
|
if (categoryValue == null) {
|
|
302
|
-
if (currentFilter.matchingOperator === '
|
|
302
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
303
303
|
return true;
|
|
304
304
|
}
|
|
305
305
|
return false;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FetchState } from '../../commonStateTypes/common';
|
|
1
2
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
3
|
import { Company } from '../../entity/company/companyStateTypes';
|
|
3
4
|
import { Tag } from '../../entity/tag/tagState';
|
|
@@ -5,7 +6,6 @@ import { Task } from '../../entity/task/taskState';
|
|
|
5
6
|
import { User } from '../../entity/user/userState';
|
|
6
7
|
import { RootState } from '../../reducer';
|
|
7
8
|
import { CompanyTaskManagerViewUIState, TaskManagerMetrics } from './companyTaskManagerViewState';
|
|
8
|
-
import { FetchState } from '../../commonStateTypes/common';
|
|
9
9
|
export interface TaskWithCompanyDetail {
|
|
10
10
|
assignees: User[];
|
|
11
11
|
company: Company;
|
|
@@ -7,7 +7,7 @@ const tagSelector_1 = require("../../entity/tag/tagSelector");
|
|
|
7
7
|
const taskSelector_1 = require("../../entity/task/taskSelector");
|
|
8
8
|
const userSelector_1 = require("../../entity/user/userSelector");
|
|
9
9
|
exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (companyTaskManagerViewState, companyState, userState, taskState, tagState) => {
|
|
10
|
-
const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState } = companyTaskManagerViewState;
|
|
10
|
+
const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState, } = companyTaskManagerViewState;
|
|
11
11
|
const tasksList = [];
|
|
12
12
|
taskIds.forEach((taskId) => {
|
|
13
13
|
const task = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
@@ -51,7 +51,7 @@ const filterCompanyOnCategoriesWithSingleValue = (categoryValue, currentFilter,
|
|
|
51
51
|
return filterCompanyOnRangeCategoryType(categoryValue, currentFilter);
|
|
52
52
|
}
|
|
53
53
|
// if filter category is not annualRecurringRevenue OR monthlyRecurringRevenue
|
|
54
|
-
if (currentFilter.matchingOperator === '
|
|
54
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
55
55
|
return currentFilter.values.indexOf(categoryValue) === -1;
|
|
56
56
|
}
|
|
57
57
|
return currentFilter.values.indexOf(categoryValue) > -1;
|
|
@@ -159,7 +159,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
159
159
|
const key = currentFilter.field;
|
|
160
160
|
const categoryValue = getCategoryValueForCompany(key, company);
|
|
161
161
|
if (categoryValue == null) {
|
|
162
|
-
if (currentFilter.matchingOperator === '
|
|
162
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
163
163
|
return true;
|
|
164
164
|
}
|
|
165
165
|
return false;
|
|
@@ -122,7 +122,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
122
122
|
const key = currentFilter.field;
|
|
123
123
|
const categoryValue = getCategoryValueForCompany(key, company);
|
|
124
124
|
if (categoryValue == null) {
|
|
125
|
-
if (currentFilter.matchingOperator === '
|
|
125
|
+
if (currentFilter.matchingOperator === 'not_equal') {
|
|
126
126
|
return true;
|
|
127
127
|
}
|
|
128
128
|
return false;
|
|
@@ -19,7 +19,7 @@ export type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusC
|
|
|
19
19
|
export type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
|
|
20
20
|
export type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | 'companyEngagementMetricsUpdatedAt' | 'companyGroupId' | 'monthlyRecurringRevenue';
|
|
21
21
|
export interface CockpitFilterCategory {
|
|
22
|
-
matchingOperator: 'equal' | '
|
|
22
|
+
matchingOperator: 'equal' | 'not_equal';
|
|
23
23
|
values: FilterCategoryValueType[];
|
|
24
24
|
valuesCombinationOperator: 'ANY' | 'ALL';
|
|
25
25
|
field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
|
|
@@ -6,10 +6,10 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
10
|
-
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
11
9
|
const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
|
|
12
10
|
const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
|
|
11
|
+
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
12
|
+
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
13
13
|
const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatches.match), (0, operators_1.switchMap)((action) => {
|
|
14
14
|
const { cacheOverride } = action.payload;
|
|
15
15
|
const state = state$.value;
|
package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js
CHANGED
|
@@ -8,6 +8,7 @@ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
|
8
8
|
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
9
9
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
10
10
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
11
|
+
const completedSubTab_1 = require("../../types/completedSubTab");
|
|
11
12
|
const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchCompletedTransactions.match), (0, operators_1.switchMap)((action) => {
|
|
12
13
|
const state = state$.value;
|
|
13
14
|
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
@@ -42,7 +43,7 @@ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
42
43
|
if (sortOrder != null) {
|
|
43
44
|
queryPayload.sort_order = sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
44
45
|
}
|
|
45
|
-
if (completedSubTab !==
|
|
46
|
+
if (completedSubTab !== completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB) {
|
|
46
47
|
queryPayload.match_type = completedSubTab;
|
|
47
48
|
}
|
|
48
49
|
const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
|
package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js
CHANGED
|
@@ -35,10 +35,19 @@ function fetchBatchDetailsByIds(batchIds, zeniAPI) {
|
|
|
35
35
|
}
|
|
36
36
|
const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
37
37
|
const batchList = action.payload.batchList;
|
|
38
|
-
const
|
|
38
|
+
const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
39
|
+
const { batchDetailsById, batchDetailsRevalidating } = bulkUpload;
|
|
39
40
|
/** Only completed list rows may trigger batch-details API; preserve platform order. */
|
|
40
|
-
const
|
|
41
|
-
|
|
41
|
+
const completedRows = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList);
|
|
42
|
+
/**
|
|
43
|
+
* Stale-while-revalidate: when a manual refresh has set `batchDetailsRevalidating`, refresh
|
|
44
|
+
* every completed list row (replacing entries via `storeBatchDetails` as they arrive). On a
|
|
45
|
+
* normal first fetch we still only request rows whose details are missing.
|
|
46
|
+
*/
|
|
47
|
+
const candidateRows = batchDetailsRevalidating === true
|
|
48
|
+
? completedRows
|
|
49
|
+
: completedRows.filter((batch) => batchDetailsById[batch.batchId] == null);
|
|
50
|
+
const completedBatchIds = candidateRows.map((batch) => batch.batchId);
|
|
42
51
|
const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
|
|
43
52
|
if (batchIdsToFetch.length === 0) {
|
|
44
53
|
/**
|
|
@@ -46,7 +55,6 @@ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
46
55
|
* `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
|
|
47
56
|
* Fall back to the single-batch-details epic so `phase` and details can resolve.
|
|
48
57
|
*/
|
|
49
|
-
const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
50
58
|
const currentId = bulkUpload.currentBatchId;
|
|
51
59
|
if (currentId != null &&
|
|
52
60
|
bulkUpload.phase === 'matching' &&
|
|
@@ -54,7 +62,15 @@ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
54
62
|
(0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
|
|
55
63
|
return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails)());
|
|
56
64
|
}
|
|
57
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Close the pagination loop so the Unmatched-tab loading heuristic can settle.
|
|
67
|
+
* `fetchMoreBatchDetailsComplete` also clears `batchDetailsRevalidating` and flips
|
|
68
|
+
* `initialBatchDetailsLoaded` to true. Without this, `batchDetailsPaginationState` stays
|
|
69
|
+
* at `Not-Started` forever after a list refresh that finds zero completed rows (or all
|
|
70
|
+
* already cached) — the direct-open-Unmatched-without-upload path used to render an
|
|
71
|
+
* infinite skeleton.
|
|
72
|
+
*/
|
|
73
|
+
return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
|
|
58
74
|
}
|
|
59
75
|
return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.setInitialBatchDetailsLoading)()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)()));
|
|
60
76
|
}));
|
package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { batchDetailFetchFailed, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof refreshBatchDetailsForBatchId> | ReturnType<typeof markBatchDetailRefreshAttempted> | ReturnType<typeof updateTransactions> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof batchDetailFetchFailed>;
|
|
8
|
+
/**
|
|
9
|
+
* Single-batch stale-while-revalidate refresh. Triggered by `pusherBatchStatusCompletionEpic`
|
|
10
|
+
* (and any other path that wants to update one batch without wiping the cache). The response is
|
|
11
|
+
* stored via `storeBatchDetails`, which replaces the entry by `batchId` so the row updates in
|
|
12
|
+
* place — no skeleton, no list reflow.
|
|
13
|
+
*
|
|
14
|
+
* Throttle: `lastBatchDetailRefreshAtById[batchId]` is checked against `TARGETED_REFRESH_DEDUPE_MS`
|
|
15
|
+
* before issuing the call. The marker is emitted first so concurrent dispatches (e.g. Pusher
|
|
16
|
+
* resend during an in-flight request) see the dedupe timestamp and collapse to a single call.
|
|
17
|
+
*/
|
|
18
|
+
export declare const refreshBatchDetailsForBatchIdEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refreshBatchDetailsForBatchIdEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
9
|
+
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
10
|
+
/**
|
|
11
|
+
* Pusher resends the same `completed` event in some cases (reconnect, server retry). Skip a
|
|
12
|
+
* targeted refresh if we issued one for the same batch within this window — the cached details
|
|
13
|
+
* are already fresh, so another `GET /1.0/batches/:id` is wasteful and visually flickers nothing.
|
|
14
|
+
*/
|
|
15
|
+
const TARGETED_REFRESH_DEDUPE_MS = 5000;
|
|
16
|
+
/**
|
|
17
|
+
* Single-batch stale-while-revalidate refresh. Triggered by `pusherBatchStatusCompletionEpic`
|
|
18
|
+
* (and any other path that wants to update one batch without wiping the cache). The response is
|
|
19
|
+
* stored via `storeBatchDetails`, which replaces the entry by `batchId` so the row updates in
|
|
20
|
+
* place — no skeleton, no list reflow.
|
|
21
|
+
*
|
|
22
|
+
* Throttle: `lastBatchDetailRefreshAtById[batchId]` is checked against `TARGETED_REFRESH_DEDUPE_MS`
|
|
23
|
+
* before issuing the call. The marker is emitted first so concurrent dispatches (e.g. Pusher
|
|
24
|
+
* resend during an in-flight request) see the dedupe timestamp and collapse to a single call.
|
|
25
|
+
*/
|
|
26
|
+
const refreshBatchDetailsForBatchIdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.refreshBatchDetailsForBatchId.match), (0, operators_1.mergeMap)((action) => {
|
|
27
|
+
const { batchId } = action.payload;
|
|
28
|
+
const now = Date.now();
|
|
29
|
+
const lastAttempt = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload
|
|
30
|
+
.lastBatchDetailRefreshAtById[batchId];
|
|
31
|
+
if (lastAttempt != null &&
|
|
32
|
+
now - lastAttempt < TARGETED_REFRESH_DEDUPE_MS) {
|
|
33
|
+
return rxjs_1.EMPTY;
|
|
34
|
+
}
|
|
35
|
+
const apiCall = zeniAPI
|
|
36
|
+
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
|
|
37
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
38
|
+
if (!(0, responsePayload_1.isSuccessResponse)(response) ||
|
|
39
|
+
response.data == null ||
|
|
40
|
+
!(0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
|
|
41
|
+
return rxjs_1.EMPTY;
|
|
42
|
+
}
|
|
43
|
+
const actions = [];
|
|
44
|
+
const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
|
|
45
|
+
if (transactionPayloads.length > 0) {
|
|
46
|
+
actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
|
|
47
|
+
}
|
|
48
|
+
actions.push((0, missingReceiptsViewReducer_1.storeBatchDetails)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
|
|
49
|
+
return (0, rxjs_1.from)(actions);
|
|
50
|
+
}), (0, operators_1.catchError)((error) => {
|
|
51
|
+
console.error(`Failed to refresh batch details for ${batchId}:`, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Refresh batch details errored out: ' + JSON.stringify(error)));
|
|
52
|
+
return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.batchDetailFetchFailed)({ batchId }));
|
|
53
|
+
}));
|
|
54
|
+
return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.markBatchDetailRefreshAttempted)({ batchId, timestamp: now })), apiCall);
|
|
55
|
+
}));
|
|
56
|
+
exports.refreshBatchDetailsForBatchIdEpic = refreshBatchDetailsForBatchIdEpic;
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.restoreBulkUploadAutomatchingOnMountEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
6
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
8
|
-
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
9
9
|
const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
|
|
10
10
|
const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
12
|
+
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
13
13
|
/**
|
|
14
14
|
* On missing-receipts entry / period switch, hydrate the automatching banner for the logged-in
|
|
15
15
|
* user without relying on UI-driven list fetches (the Missing tab does not fetch the batch list
|
|
@@ -52,10 +52,12 @@ const restoreBulkUploadAutomatchingOnMountEpic = (actions$, state$, zeniAPI) =>
|
|
|
52
52
|
bulkUpload.batchListFetchState.fetchState === 'Completed';
|
|
53
53
|
const listSource = alreadyCached
|
|
54
54
|
? (0, rxjs_1.of)(null)
|
|
55
|
-
: zeniAPI
|
|
55
|
+
: zeniAPI
|
|
56
|
+
.getJSON(listUrl)
|
|
57
|
+
.pipe((0, operators_1.catchError)(() => (0, rxjs_1.of)(null)));
|
|
56
58
|
return listSource.pipe((0, operators_1.mergeMap)((listResponse) => {
|
|
57
59
|
const batchList = alreadyCached
|
|
58
|
-
? bulkUpload.batchListByPeriod[periodId] ?? []
|
|
60
|
+
? (bulkUpload.batchListByPeriod[periodId] ?? [])
|
|
59
61
|
: listResponse != null &&
|
|
60
62
|
(0, responsePayload_1.isSuccessResponse)(listResponse) &&
|
|
61
63
|
listResponse.data != null
|
package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js
CHANGED
|
@@ -5,10 +5,11 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
|
|
8
9
|
const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
|
|
9
10
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
11
|
+
const completedSubTab_1 = require("../../types/completedSubTab");
|
|
10
12
|
const transactionsViewState_1 = require("../../types/transactionsViewState");
|
|
11
|
-
const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
|
|
12
13
|
/**
|
|
13
14
|
* `auto_categorized` for manual transaction search (Unmatched).
|
|
14
15
|
* Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
|
|
@@ -49,6 +50,11 @@ const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
|
|
|
49
50
|
page_token: pageToken ?? null,
|
|
50
51
|
page_size: manualSearch.pageSize,
|
|
51
52
|
search_text: query,
|
|
53
|
+
// Manual search ignores the Completed sub-tab axis — always span the
|
|
54
|
+
// default sentinel so the receipt-matching UX returns results
|
|
55
|
+
// regardless of where the transaction would otherwise be bucketed on
|
|
56
|
+
// the Completed tab.
|
|
57
|
+
sub_tab: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
|
|
52
58
|
};
|
|
53
59
|
return zeniAPI
|
|
54
60
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, fetchCompletedTransactions, fetchMissingReceipts, restoreBulkUploadMatchingState, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchCompletedTransactions>;
|
|
6
|
+
/**
|
|
7
|
+
* After automatch completes for the active bulk-upload batch, refresh the two
|
|
8
|
+
* caches that are not invalidated by the existing batch-details refresh path:
|
|
9
|
+
* - Missing Receipts list (`transactionIdsBySelectedPeriod`)
|
|
10
|
+
* - Completed transactions cache (`bulkUpload.completedTransactionsByPeriod`)
|
|
11
|
+
*
|
|
12
|
+
* The Unmatched tab is already kept fresh via `pusherBatchStatusCompletionEpic`
|
|
13
|
+
* dispatching `fetchBulkUploadBatches({invalidateBatchDetailsCache: true})`,
|
|
14
|
+
* which feeds `fetchMultipleBatchDetailsEpic` and re-stores batch details.
|
|
15
|
+
*
|
|
16
|
+
* Lifecycle mirrors `bulkUploadMatchResultToastEpic`: trigger on
|
|
17
|
+
* `bulkUploadReceiptsSuccess` (fresh upload) or `restoreBulkUploadMatchingState`
|
|
18
|
+
* (restored session), then wait for the first batch-details action for that
|
|
19
|
+
* batchId — landing as either `fetchBulkUploadBatchDetailsSuccess` or
|
|
20
|
+
* `storeBatchDetails`. `clearBulkUpload` cancels the in-flight wait.
|
|
21
|
+
*
|
|
22
|
+
* Refetches use `cacheOverride: true` to bypass per-tab cache guards, and
|
|
23
|
+
* `fetchMissingReceipts` uses `refreshViewInBackground: true` to keep the
|
|
24
|
+
* existing rows visible while fresh data is in flight (the authoritative
|
|
25
|
+
* server filter `is_attachment_missing_only=true` removes matched rows once
|
|
26
|
+
* the response lands).
|
|
27
|
+
*/
|
|
28
|
+
export declare const syncTabsAfterAutomatchEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|