@zeniai/client-epic-state 4.20.3-betaSS12 → 4.20.3-betaSS13
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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
- package/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +2 -0
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +4 -0
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +13 -0
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +9 -0
- package/lib/commonStateTypes/common.d.ts +1 -1
- package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +5 -0
- package/lib/commonStateTypes/projectView/projectViewParentID.js +2 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountReducer.d.ts +5 -2
- package/lib/entity/account/accountReducer.js +13 -5
- package/lib/entity/account/accountSelector.d.ts +7 -0
- package/lib/entity/account/accountSelector.js +4 -2
- package/lib/entity/account/accountState.d.ts +3 -1
- package/lib/entity/account/accountState.js +4 -1
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -0
- package/lib/entity/account/subAccountSelector.d.ts +2 -0
- package/lib/entity/account/subAccountSelector.js +2 -0
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -0
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.js +4 -2
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +70 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/project/projectPayload.d.ts +13 -0
- package/lib/entity/project/projectPayload.js +30 -0
- package/lib/entity/project/projectReducer.d.ts +10 -0
- package/lib/entity/project/projectReducer.js +31 -0
- package/lib/entity/project/projectSelector.d.ts +5 -0
- package/lib/entity/project/projectSelector.js +12 -0
- package/lib/entity/project/projectState.d.ts +13 -0
- package/lib/entity/project/projectState.js +2 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +13 -0
- package/lib/entity/sectionProjectView/sectionProjectView.js +6 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +6 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +56 -0
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +11 -0
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +15 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +15 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +64 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +11 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +57 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +16 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +2 -0
- package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +4 -0
- package/lib/entity/sectionProjectView/sectionProjectViewState.js +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.js +10 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +7 -2
- package/lib/entity/tenant/clearAllEpic.js +10 -0
- package/lib/entity/tenant/tenantPayload.d.ts +2 -0
- package/lib/entity/tenant/tenantReducer.d.ts +5 -2
- package/lib/entity/tenant/tenantReducer.js +10 -2
- package/lib/entity/tenant/tenantSelector.d.ts +2 -0
- package/lib/entity/tenant/tenantSelector.js +17 -1
- package/lib/entity/tenant/tenantState.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +11 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +114 -1
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +11 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +22 -2
- package/lib/epic.js +22 -2
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
- package/lib/esm/commonStateTypes/animations.js +4 -0
- package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +5 -0
- package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/account/accountReducer.js +12 -4
- package/lib/esm/entity/account/accountSelector.js +4 -2
- package/lib/esm/entity/account/accountState.js +4 -1
- package/lib/esm/entity/account/subAccountSelector.js +2 -0
- package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +64 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/esm/entity/project/projectPayload.js +26 -0
- package/lib/esm/entity/project/projectReducer.js +27 -0
- package/lib/esm/entity/project/projectSelector.js +8 -0
- package/lib/esm/entity/project/projectState.js +1 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectView.js +3 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +52 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +11 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +60 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +50 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +1 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +1 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +10 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +10 -0
- package/lib/esm/entity/tenant/tenantReducer.js +9 -1
- package/lib/esm/entity/tenant/tenantSelector.js +14 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +114 -1
- package/lib/esm/epic.js +22 -2
- package/lib/esm/index.js +32 -19
- package/lib/esm/reducer.js +20 -2
- package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +152 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +77 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +76 -0
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
- package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +19 -1
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +17 -0
- package/lib/esm/view/companyView/companyViewReducer.js +26 -1
- package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +61 -0
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +1 -39
- package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -1
- package/lib/esm/view/creditAgentView/creditAgentViewState.js +0 -6
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +63 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +65 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +6 -4
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +21 -5
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
- package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +29 -6
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
- package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
- package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +47 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +65 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
- package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
- package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
- package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
- package/lib/index.d.ts +49 -26
- package/lib/index.js +107 -39
- package/lib/reducer.d.ts +20 -2
- package/lib/reducer.js +20 -2
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +33 -0
- package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.js +156 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +16 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.js +83 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +80 -0
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +8 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +20 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +4 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +9 -1
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +7 -0
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +21 -0
- package/lib/view/companyView/companyViewReducer.d.ts +6 -1
- package/lib/view/companyView/companyViewReducer.js +28 -2
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -36
- package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +2 -2
- package/lib/view/creditAgentView/creditAgentViewReducer.js +2 -40
- package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
- package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
- package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -31
- package/lib/view/creditAgentView/creditAgentViewState.js +0 -6
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +67 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +69 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +5 -3
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
- package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
- package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +5 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +10 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +18 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +30 -7
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +5 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
- package/lib/view/financeStatement/financeStatementSelector.js +12 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +51 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +69 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
- package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
- package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
- package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
- package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
- package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
- package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
- package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
- package/package.json +1 -1
package/lib/esm/reducer.js
CHANGED
|
@@ -14,6 +14,7 @@ import chargeCard, { initialState as initialChargeCardState, } from './entity/ch
|
|
|
14
14
|
import chargeCardRepayment, { initialState as initialChargeCardRepaymentState, } from './entity/chargeCardRepayment/chargeCardRepaymentReducer';
|
|
15
15
|
import chargeCardTransaction, { initialState as initialChargeCardTransactionState, } from './entity/chargeCardTransaction/chargeCardTransactionReducer';
|
|
16
16
|
import classes, { initialState as initialClassState, } from './entity/class/classReducer';
|
|
17
|
+
import project, { initialState as initialProjectState, } from './entity/project/projectReducer';
|
|
17
18
|
import company, { initialState as initialCompanyState, } from './entity/company/companyReducer';
|
|
18
19
|
import companyHealthMetric, { initialState as initialCompanyHealthMetricState, } from './entity/companyHealthMetric/companyHealthMetricReducer';
|
|
19
20
|
import connectedAccount, { initialState as initialConnectedAccountState, } from './entity/connectedAccount/connectedAccountReducer';
|
|
@@ -41,6 +42,7 @@ import accountingSummary, { initialState as initialAccountingSummaryState, } fro
|
|
|
41
42
|
import reimbursement, { initialState as initialReimbursementState, } from './entity/reimbursement/reimbursementReducer';
|
|
42
43
|
import sectionAccountsView, { initialState as initialSectionAccountsViewState, } from './entity/sectionAccountsView/sectionAccountsViewReducer';
|
|
43
44
|
import sectionClassesViewV2, { initialState as initialSectionClassesViewStateV2, } from './entity/sectionClassesViewV2/sectionClassesViewReducer';
|
|
45
|
+
import sectionProjectView, { initialState as initialSectionProjectViewState, } from './entity/sectionProjectView/sectionProjectViewReducer';
|
|
44
46
|
import snackbar, { initialSnackbarState, } from './entity/snackbar/snackbarReducer';
|
|
45
47
|
import subscription, { initialState as initialSubscriptionState, } from './entity/subscription/subscription/subscriptionReducer';
|
|
46
48
|
import subscriptionAddOn, { initialState as initialSubscriptionAddOnState, } from './entity/subscription/subscriptionAddOn/subscriptionAddOnReducer';
|
|
@@ -68,6 +70,8 @@ import addressView, { initialState as initialAddressViewState, } from './view/ad
|
|
|
68
70
|
import aggregatedReport, { initialState as initialAggregatedReportViewState, } from './view/aiAgentPerformance/aggregatedReportViewReducer';
|
|
69
71
|
import aiCfoView, { initialAiCfoViewState, } from './view/aiCfoView/aiCfoViewReducer';
|
|
70
72
|
import creditAgentView, { initialState as initialCreditAgentViewState, } from './view/creditAgentView/creditAgentViewReducer';
|
|
73
|
+
import aiAccountantCustomer, { initialAiAccountantCustomerState, } from './entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
74
|
+
import aiAccountantView, { initialAiAccountantViewState, } from './view/aiAccountantView/aiAccountantViewReducer';
|
|
71
75
|
import apAgingDetail, { initialState as initialApAgingDetailState, } from './view/apAgingView/apAgingDetail/apAgingDetailReducer';
|
|
72
76
|
import apAging, { initialState as initialApAgingState, } from './view/apAgingView/apAgingReport/apAgingReducer';
|
|
73
77
|
import arAgingDetail, { initialState as initialArAgingDetailState, } from './view/arAgingView/arAgingDetail/arAgingDetailReducer';
|
|
@@ -123,6 +127,7 @@ import ownerList, { initialState as initialOwnerListState, } from './view/ownerL
|
|
|
123
127
|
import people, { initialState as initialPeopleState, } from './view/people/peopleReducer';
|
|
124
128
|
import profitAndLoss, { initialState as initialProfitAndLossState, } from './view/profitAndLoss/profitAndLossReducer';
|
|
125
129
|
import profitAndLossClassesView, { initialState as initialProfitAndLossClassesViewState, } from './view/profitAndLossClassesView/profitAndLossClassesViewReducer';
|
|
130
|
+
import profitAndLossProjectView, { initialState as initialProfitAndLossProjectViewState, } from './view/profitAndLossProjectView/profitAndLossProjectViewReducer';
|
|
126
131
|
import recommendation, { initialState as initialEntityRecommendationState, } from './view/recommendation/recommendationReducer';
|
|
127
132
|
import referralView, { initialState as initialReferralViewState, } from './view/referralView/referralReducer';
|
|
128
133
|
import reimbursementCard, { initialState as initialReimbursementCardState, } from './view/reimbursementCard/reimbursementCardReducer';
|
|
@@ -135,6 +140,7 @@ import scheduleAccruedDetailView, { initialState as initialScheduleAccruedDetail
|
|
|
135
140
|
import scheduleDetailView, { initialState as initialScheduleDetailViewState, } from './view/scheduleView/scheduleDetailView/scheduleDetailReducer';
|
|
136
141
|
import scheduleListView, { initialState as initialScheduleListViewState, } from './view/scheduleView/scheduleListView/scheduleListReducer';
|
|
137
142
|
import settings, { initialState as initialSettingsViewState, } from './view/settingsView/settingsViewReducer';
|
|
143
|
+
import autotransferRules, { initialState as initialAutotransferRulesState, } from './view/spendManagement/autotransferRules/autoTransferRulesReducer';
|
|
138
144
|
import billDetailView, { initialState as initialBillDetailViewState, } from './view/spendManagement/billPay/billDetailView/billDetailViewReducer';
|
|
139
145
|
import billList, { initialState as initialBillListState, } from './view/spendManagement/billPay/billList/billListReducer';
|
|
140
146
|
import billPayConfig, { initialState as initialBillPayConfigState, } from './view/spendManagement/billPay/billPayConfig/billPayConfigReducer';
|
|
@@ -220,6 +226,7 @@ const initialEntitiesState = {
|
|
|
220
226
|
accountReconState: initialAccountReconState,
|
|
221
227
|
accountState: initialAccountState,
|
|
222
228
|
addressState: initialAddressState,
|
|
229
|
+
aiAccountantCustomerState: initialAiAccountantCustomerState,
|
|
223
230
|
aiCfoState: initialAiCfoState,
|
|
224
231
|
approvalRuleState: initialApprovalRuleState,
|
|
225
232
|
bankAccountState: initialBankAccountState,
|
|
@@ -229,6 +236,7 @@ const initialEntitiesState = {
|
|
|
229
236
|
chargeCardRepaymentState: initialChargeCardRepaymentState,
|
|
230
237
|
chargeCardTransactionState: initialChargeCardTransactionState,
|
|
231
238
|
classState: initialClassState,
|
|
239
|
+
projectState: initialProjectState,
|
|
232
240
|
companyHealthMetricState: initialCompanyHealthMetricState,
|
|
233
241
|
companyState: initialCompanyState,
|
|
234
242
|
connectedAccountState: initialConnectedAccountState,
|
|
@@ -257,6 +265,7 @@ const initialEntitiesState = {
|
|
|
257
265
|
reimbursementState: initialReimbursementState,
|
|
258
266
|
sectionAccountsViewState: initialSectionAccountsViewState,
|
|
259
267
|
sectionClassesViewStateV2: initialSectionClassesViewStateV2,
|
|
268
|
+
sectionProjectViewState: initialSectionProjectViewState,
|
|
260
269
|
snackbarState: initialSnackbarState,
|
|
261
270
|
subscriptionAddOnState: initialSubscriptionAddOnState,
|
|
262
271
|
subscriptionCouponState: initialSubscriptionCouponState,
|
|
@@ -286,13 +295,16 @@ const initialViewsState = {
|
|
|
286
295
|
accountMappingState: initialAccountMappingState,
|
|
287
296
|
addressViewState: initialAddressViewState,
|
|
288
297
|
aggregatedReportViewState: initialAggregatedReportViewState,
|
|
298
|
+
aiAccountantViewState: initialAiAccountantViewState,
|
|
289
299
|
aiCfoViewState: initialAiCfoViewState,
|
|
300
|
+
creditAgentViewState: initialCreditAgentViewState,
|
|
290
301
|
apAgingDetailState: initialApAgingDetailState,
|
|
291
302
|
apAgingState: initialApAgingState,
|
|
292
303
|
arAgingDetailState: initialArAgingDetailState,
|
|
293
304
|
arAgingState: initialArAgingState,
|
|
294
305
|
auditReportViewState: initialAuditReportViewState,
|
|
295
306
|
authenticationViewState: initialAuthenticationViewState,
|
|
307
|
+
autotransferRulesState: initialAutotransferRulesState,
|
|
296
308
|
balanceSheetState: initialBalanceSheetState,
|
|
297
309
|
bankAccountViewState: initialBankAccountView,
|
|
298
310
|
billDetailViewState: initialBillDetailViewState,
|
|
@@ -327,7 +339,6 @@ const initialViewsState = {
|
|
|
327
339
|
companyMonthEndReportViewState: initialCompanyMonthEndReportViewState,
|
|
328
340
|
companyTaskManagerViewState: initialCompanyTaskManagerViewState,
|
|
329
341
|
companyViewState: initialCompanyViewState,
|
|
330
|
-
creditAgentViewState: initialCreditAgentViewState,
|
|
331
342
|
countryListState: initialCountryListState,
|
|
332
343
|
dashboardLayoutState: initialDashboardLayoutState,
|
|
333
344
|
dashboardState: initialDashboardState,
|
|
@@ -371,6 +382,7 @@ const initialViewsState = {
|
|
|
371
382
|
plaidAccountViewState: initialPlaidAccountViewState,
|
|
372
383
|
previousBillsState: initialPreviousBillsState,
|
|
373
384
|
profitAndLossClassesViewState: initialProfitAndLossClassesViewState,
|
|
385
|
+
profitAndLossProjectViewState: initialProfitAndLossProjectViewState,
|
|
374
386
|
profitAndLossState: initialProfitAndLossState,
|
|
375
387
|
realTimeApprovalState: initialRealTimeApprovalState,
|
|
376
388
|
referralViewState: initialReferralViewState,
|
|
@@ -444,6 +456,7 @@ const entityReducers = {
|
|
|
444
456
|
accountingSummaryState: accountingSummary,
|
|
445
457
|
accountState: account,
|
|
446
458
|
addressState: address,
|
|
459
|
+
aiAccountantCustomerState: aiAccountantCustomer,
|
|
447
460
|
aiCfoState: aiCfo,
|
|
448
461
|
approvalRuleState: approvalRule,
|
|
449
462
|
bankAccountState: bankAccount,
|
|
@@ -454,6 +467,7 @@ const entityReducers = {
|
|
|
454
467
|
chargeCardRepaymentState: chargeCardRepayment,
|
|
455
468
|
chargeCardTransactionState: chargeCardTransaction,
|
|
456
469
|
classState: classes,
|
|
470
|
+
projectState: project,
|
|
457
471
|
companyHealthMetricState: companyHealthMetric,
|
|
458
472
|
companyState: company,
|
|
459
473
|
connectedAccountState: connectedAccount,
|
|
@@ -482,6 +496,7 @@ const entityReducers = {
|
|
|
482
496
|
reimbursementState: reimbursement,
|
|
483
497
|
sectionAccountsViewState: sectionAccountsView,
|
|
484
498
|
sectionClassesViewStateV2: sectionClassesViewV2,
|
|
499
|
+
sectionProjectViewState: sectionProjectView,
|
|
485
500
|
snackbarState: snackbar,
|
|
486
501
|
subscriptionAddOnState: subscriptionAddOn,
|
|
487
502
|
subscriptionCouponState: subscriptionCoupon,
|
|
@@ -511,13 +526,16 @@ const viewReducers = {
|
|
|
511
526
|
accountMappingState: accountMapping,
|
|
512
527
|
addressViewState: addressView,
|
|
513
528
|
aggregatedReportViewState: aggregatedReport,
|
|
529
|
+
aiAccountantViewState: aiAccountantView,
|
|
514
530
|
aiCfoViewState: aiCfoView,
|
|
531
|
+
creditAgentViewState: creditAgentView,
|
|
515
532
|
apAgingDetailState: apAgingDetail,
|
|
516
533
|
apAgingState: apAging,
|
|
517
534
|
arAgingDetailState: arAgingDetail,
|
|
518
535
|
arAgingState: arAging,
|
|
519
536
|
auditReportViewState: auditReportView,
|
|
520
537
|
authenticationViewState: authentication,
|
|
538
|
+
autotransferRulesState: autotransferRules,
|
|
521
539
|
balanceSheetState: balanceSheet,
|
|
522
540
|
bankAccountViewState: bankAccountView,
|
|
523
541
|
billDetailViewState: billDetailView,
|
|
@@ -551,7 +569,6 @@ const viewReducers = {
|
|
|
551
569
|
companyMonthEndReportViewState: companyMonthEndReportView,
|
|
552
570
|
companyTaskManagerViewState: companyTaskManagerView,
|
|
553
571
|
companyViewState: companyView,
|
|
554
|
-
creditAgentViewState: creditAgentView,
|
|
555
572
|
countryListState: countryList,
|
|
556
573
|
dashboardState: dashboard,
|
|
557
574
|
dashboardLayoutState: dashboardLayout,
|
|
@@ -596,6 +613,7 @@ const viewReducers = {
|
|
|
596
613
|
plaidAccountViewState: plaidAccountView,
|
|
597
614
|
previousBillsState: previousBills,
|
|
598
615
|
profitAndLossClassesViewState: profitAndLossClassesView,
|
|
616
|
+
profitAndLossProjectViewState: profitAndLossProjectView,
|
|
599
617
|
profitAndLossState: profitAndLoss,
|
|
600
618
|
realTimeApprovalState: realTimeApproval,
|
|
601
619
|
referralViewState: referralView,
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
export const initialAiAccountantViewState = {
|
|
3
|
+
customersByTenantId: {},
|
|
4
|
+
customersFetchStatus: { fetchState: 'Not-Started' },
|
|
5
|
+
selectedTenantIdsForJobTrigger: [],
|
|
6
|
+
triggerJobStatus: { fetchState: 'Not-Started' },
|
|
7
|
+
uiState: {
|
|
8
|
+
filterText: '',
|
|
9
|
+
filters: {},
|
|
10
|
+
selectedCustomerTenantId: '',
|
|
11
|
+
sortKey: 'companyName',
|
|
12
|
+
sortOrder: 'ascending',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const aiAccountantView = createSlice({
|
|
16
|
+
name: 'aiAccountantView',
|
|
17
|
+
initialState: initialAiAccountantViewState,
|
|
18
|
+
reducers: {
|
|
19
|
+
// ── Customers ──
|
|
20
|
+
fetchAiAccountantCustomers(draft) {
|
|
21
|
+
draft.customersFetchStatus = { fetchState: 'In-Progress' };
|
|
22
|
+
},
|
|
23
|
+
updateAiAccountantCustomers(draft, action) {
|
|
24
|
+
draft.customersByTenantId = toCustomersByTenantId(action.payload, draft.customersByTenantId);
|
|
25
|
+
draft.customersFetchStatus = { fetchState: 'Completed' };
|
|
26
|
+
},
|
|
27
|
+
updateAiAccountantCustomersFailure(draft, action) {
|
|
28
|
+
draft.customersFetchStatus = {
|
|
29
|
+
fetchState: 'Error',
|
|
30
|
+
error: action.payload,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
// ── Jobs ──
|
|
34
|
+
fetchAiAccountantJobs: {
|
|
35
|
+
reducer(draft, action) {
|
|
36
|
+
const customerView = draft.customersByTenantId[action.payload.tenantId];
|
|
37
|
+
if (customerView != null) {
|
|
38
|
+
customerView.jobsFetchStatus = { fetchState: 'In-Progress' };
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
prepare(tenantId, fetchNextPage) {
|
|
42
|
+
return { payload: { tenantId, fetchNextPage: fetchNextPage ?? false } };
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
updateAiAccountantJobs: {
|
|
46
|
+
reducer(draft, action) {
|
|
47
|
+
const customerView = draft.customersByTenantId[action.payload.tenantId];
|
|
48
|
+
if (customerView != null) {
|
|
49
|
+
customerView.jobsFetchStatus = { fetchState: 'Completed' };
|
|
50
|
+
customerView.jobsPageToken = action.payload.nextPageToken;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
prepare(tenantId, nextPageToken) {
|
|
54
|
+
return { payload: { tenantId, nextPageToken: nextPageToken ?? null } };
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
updateAiAccountantJobsFailure(draft, action) {
|
|
58
|
+
const customerView = draft.customersByTenantId[action.payload.tenantId];
|
|
59
|
+
if (customerView != null) {
|
|
60
|
+
customerView.jobsFetchStatus = {
|
|
61
|
+
fetchState: 'Error',
|
|
62
|
+
error: action.payload.error,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
setSelectedTenantIdsForJobTrigger(draft, action) {
|
|
67
|
+
draft.selectedTenantIdsForJobTrigger = action.payload;
|
|
68
|
+
},
|
|
69
|
+
// ── Trigger Job ──
|
|
70
|
+
triggerAiAccountantJob: {
|
|
71
|
+
reducer(draft,
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
+
_action) {
|
|
74
|
+
draft.triggerJobStatus = { fetchState: 'In-Progress' };
|
|
75
|
+
},
|
|
76
|
+
prepare(operationType, startDate, endDate) {
|
|
77
|
+
return { payload: { operationType, startDate, endDate } };
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
triggerAiAccountantJobSuccess(draft) {
|
|
81
|
+
draft.triggerJobStatus = { fetchState: 'Completed' };
|
|
82
|
+
// Bulk selection resets after a successful fire so checkboxes
|
|
83
|
+
// return to an empty state along with the customer-list refresh.
|
|
84
|
+
draft.selectedTenantIdsForJobTrigger = [];
|
|
85
|
+
},
|
|
86
|
+
triggerAiAccountantJobFailure(draft, action) {
|
|
87
|
+
draft.triggerJobStatus = { fetchState: 'Error', error: action.payload };
|
|
88
|
+
},
|
|
89
|
+
// ── Cancel Onboarding ──
|
|
90
|
+
cancelAiAccountantOnboarding: {
|
|
91
|
+
reducer(draft, action) {
|
|
92
|
+
const customerView = draft.customersByTenantId[action.payload.tenantId];
|
|
93
|
+
if (customerView != null) {
|
|
94
|
+
customerView.cancelOnboardingStatus = { fetchState: 'In-Progress' };
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
prepare(companyId, tenantId) {
|
|
98
|
+
return { payload: { companyId, tenantId } };
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
cancelAiAccountantOnboardingSuccess: {
|
|
102
|
+
reducer(draft, action) {
|
|
103
|
+
const customerView = draft.customersByTenantId[action.payload.tenantId];
|
|
104
|
+
if (customerView != null) {
|
|
105
|
+
customerView.cancelOnboardingStatus = { fetchState: 'Completed' };
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
prepare(tenantId) {
|
|
109
|
+
return { payload: { tenantId } };
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
cancelAiAccountantOnboardingFailure: {
|
|
113
|
+
reducer(draft, action) {
|
|
114
|
+
const customerView = draft.customersByTenantId[action.payload.tenantId];
|
|
115
|
+
if (customerView != null) {
|
|
116
|
+
customerView.cancelOnboardingStatus = {
|
|
117
|
+
fetchState: 'Error',
|
|
118
|
+
error: action.payload.error,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
prepare(tenantId, error) {
|
|
123
|
+
return { payload: { tenantId, error } };
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
// ── UI State ──
|
|
127
|
+
updateAiAccountantUIState(draft, action) {
|
|
128
|
+
Object.assign(draft.uiState, action.payload);
|
|
129
|
+
},
|
|
130
|
+
// ── Clear ──
|
|
131
|
+
clearAiAccountantView() {
|
|
132
|
+
return initialAiAccountantViewState;
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
export const { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, clearAiAccountantView, fetchAiAccountantCustomers, fetchAiAccountantJobs, setSelectedTenantIdsForJobTrigger, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess, updateAiAccountantCustomers, updateAiAccountantCustomersFailure, updateAiAccountantJobs, updateAiAccountantJobsFailure, updateAiAccountantUIState, } = aiAccountantView.actions;
|
|
137
|
+
export default aiAccountantView.reducer;
|
|
138
|
+
// ── Helpers ──
|
|
139
|
+
const toCustomersByTenantId = (customers, existing) => {
|
|
140
|
+
const result = {};
|
|
141
|
+
for (const payload of customers) {
|
|
142
|
+
const tenantId = payload.tenant_id;
|
|
143
|
+
const existingState = existing[tenantId];
|
|
144
|
+
result[tenantId] = existingState ?? {
|
|
145
|
+
cancelOnboardingStatus: { fetchState: 'Not-Started' },
|
|
146
|
+
jobsFetchStatus: { fetchState: 'Not-Started' },
|
|
147
|
+
jobsPageToken: null,
|
|
148
|
+
tenantId,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createSelector } from '@reduxjs/toolkit';
|
|
2
|
+
import orderBy from 'lodash/orderBy';
|
|
3
|
+
import { getAiAccountantCustomers, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerSelector';
|
|
4
|
+
export const getAiAccountantCockpitView = createSelector((state) => state.aiAccountantViewState, (state) => state.aiAccountantCustomerState, (state) => state.userState, (viewState, customerEntityState, userState) => {
|
|
5
|
+
const { customersByTenantId, customersFetchStatus, selectedTenantIdsForJobTrigger, triggerJobStatus, uiState, } = viewState;
|
|
6
|
+
const allCustomers = getAiAccountantCustomers(customerEntityState, userState);
|
|
7
|
+
let filteredCustomers = allCustomers;
|
|
8
|
+
// Text filter
|
|
9
|
+
const trimmedFilterText = uiState.filterText.trim();
|
|
10
|
+
if (trimmedFilterText.length > 0) {
|
|
11
|
+
const query = trimmedFilterText.toLowerCase();
|
|
12
|
+
filteredCustomers = filteredCustomers.filter((customer) => customer.companyName.toLowerCase().includes(query) ||
|
|
13
|
+
customer.tenantId.toLowerCase().includes(query));
|
|
14
|
+
}
|
|
15
|
+
// Cockpit filters (e.g. enrollmentStatus)
|
|
16
|
+
const enrollmentStatusFilter = uiState.filters.categories?.find((category) => category.field === 'enrollmentStatus');
|
|
17
|
+
if (enrollmentStatusFilter != null &&
|
|
18
|
+
enrollmentStatusFilter.values.length > 0) {
|
|
19
|
+
const selectedStatuses = enrollmentStatusFilter.values.map(String);
|
|
20
|
+
const isEqual = enrollmentStatusFilter.matchingOperator === 'equal';
|
|
21
|
+
filteredCustomers = filteredCustomers.filter((customer) => {
|
|
22
|
+
const status = customer.enrollment?.status ?? 'unknown';
|
|
23
|
+
const matches = selectedStatuses.includes(status);
|
|
24
|
+
return isEqual ? matches : !matches;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
// Sorting
|
|
28
|
+
const sortedCustomers = getSortedCustomers(filteredCustomers, uiState.sortKey, uiState.sortOrder);
|
|
29
|
+
const selectedCustomersForJobTrigger = allCustomers.filter((customer) => selectedTenantIdsForJobTrigger.includes(customer.tenantId));
|
|
30
|
+
const unonboardedTenantIds = allCustomers
|
|
31
|
+
.filter((customer) => customer.enrollment == null)
|
|
32
|
+
.map((customer) => customer.tenantId);
|
|
33
|
+
return {
|
|
34
|
+
averageAccuracy: calcOverallAverageAccuracy(allCustomers),
|
|
35
|
+
fetchState: customersFetchStatus.fetchState,
|
|
36
|
+
error: customersFetchStatus.error,
|
|
37
|
+
customers: sortedCustomers,
|
|
38
|
+
customerViewStateByTenantId: customersByTenantId,
|
|
39
|
+
selectedCustomersForJobTrigger,
|
|
40
|
+
selectedTenantIds: selectedTenantIdsForJobTrigger,
|
|
41
|
+
triggerJobStatus,
|
|
42
|
+
uiState,
|
|
43
|
+
unonboardedTenantIds,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
// ── Helpers ──
|
|
47
|
+
const getSortedCustomers = (customers, sortKey, sortOrder) => {
|
|
48
|
+
const direction = sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
49
|
+
return orderBy(customers, (customer) => {
|
|
50
|
+
switch (sortKey) {
|
|
51
|
+
case 'companyName':
|
|
52
|
+
return customer.companyName.toLowerCase();
|
|
53
|
+
case 'status':
|
|
54
|
+
return (customer.enrollment?.status ?? 'unknown').toLowerCase();
|
|
55
|
+
case 'bookcloseDate':
|
|
56
|
+
return customer.bookcloseDate?.valueOf() ?? 0;
|
|
57
|
+
case 'latestTraining':
|
|
58
|
+
return customer.enrollment?.latestTraining?.valueOf() ?? 0;
|
|
59
|
+
case 'latestSync':
|
|
60
|
+
return customer.enrollment?.latestTransactionSync?.valueOf() ?? 0;
|
|
61
|
+
case 'accuracy':
|
|
62
|
+
return customer.averageAccuracy;
|
|
63
|
+
default:
|
|
64
|
+
return customer.companyName.toLowerCase();
|
|
65
|
+
}
|
|
66
|
+
}, direction);
|
|
67
|
+
};
|
|
68
|
+
const calcOverallAverageAccuracy = (customers) => {
|
|
69
|
+
const customerAccuracies = customers
|
|
70
|
+
.map((customer) => customer.averageAccuracy)
|
|
71
|
+
.filter((accuracy) => accuracy > 0);
|
|
72
|
+
if (customerAccuracies.length === 0) {
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
return (customerAccuracies.reduce((sum, accuracy) => sum + accuracy, 0) /
|
|
76
|
+
customerAccuracies.length);
|
|
77
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { stringToUnion } from '../../commonStateTypes/stringToUnion';
|
|
2
|
+
const ALL_AI_ACCOUNTANT_SORT_KEYS = [
|
|
3
|
+
'companyName',
|
|
4
|
+
'status',
|
|
5
|
+
'bookcloseDate',
|
|
6
|
+
'latestTraining',
|
|
7
|
+
'latestSync',
|
|
8
|
+
'accuracy',
|
|
9
|
+
];
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
+
const toAiAccountantSortKeyType = (v) => stringToUnion(v, ALL_AI_ACCOUNTANT_SORT_KEYS);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
|
+
import { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, fetchAiAccountantCustomers, } from '../aiAccountantViewReducer';
|
|
6
|
+
export const cancelAiAccountantOnboardingEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(cancelAiAccountantOnboarding.match), mergeMap((action) => {
|
|
7
|
+
const { tenantId, companyId } = action.payload;
|
|
8
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
9
|
+
const url = `${base}/ai-accountant/cancel-onboarding`;
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.postAndGetJSON(url, {
|
|
12
|
+
tenant_id: tenantId,
|
|
13
|
+
company_id: companyId,
|
|
14
|
+
})
|
|
15
|
+
.pipe(mergeMap((response) => {
|
|
16
|
+
if (isSuccessResponse(response)) {
|
|
17
|
+
return from([
|
|
18
|
+
cancelAiAccountantOnboardingSuccess(tenantId),
|
|
19
|
+
fetchAiAccountantCustomers(),
|
|
20
|
+
openSnackbar({
|
|
21
|
+
messageSection: 'common',
|
|
22
|
+
messageText: 'success',
|
|
23
|
+
type: 'success',
|
|
24
|
+
}),
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return from([
|
|
29
|
+
cancelAiAccountantOnboardingFailure(tenantId, response.status),
|
|
30
|
+
openSnackbar({
|
|
31
|
+
messageSection: 'common',
|
|
32
|
+
messageText: 'failed',
|
|
33
|
+
type: 'error',
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
}), catchError((error) => from([
|
|
38
|
+
cancelAiAccountantOnboardingFailure(tenantId, createZeniAPIStatus('Unexpected error', 'AI Accountant cancel onboarding failed: ' +
|
|
39
|
+
JSON.stringify(error))),
|
|
40
|
+
openSnackbar({
|
|
41
|
+
messageSection: 'common',
|
|
42
|
+
messageText: 'failed',
|
|
43
|
+
type: 'error',
|
|
44
|
+
}),
|
|
45
|
+
])));
|
|
46
|
+
}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateAiAccountantCustomers as updateAiAccountantCustomerEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
4
|
+
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
|
+
import { fetchAiAccountantCustomers, updateAiAccountantCustomers, updateAiAccountantCustomersFailure, } from '../aiAccountantViewReducer';
|
|
7
|
+
export const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(fetchAiAccountantCustomers.match), switchMap(() => {
|
|
8
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
9
|
+
const url = `${base}/ai-accountant/customers`;
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.getJSON(url)
|
|
12
|
+
.pipe(mergeMap((response) => {
|
|
13
|
+
if (isSuccessResponse(response)) {
|
|
14
|
+
const customers = response.data?.customers ?? [];
|
|
15
|
+
const users = response.data?.users ?? [];
|
|
16
|
+
return from([
|
|
17
|
+
updateAiAccountantCustomerEntities(customers),
|
|
18
|
+
updateAllUsers({ users }),
|
|
19
|
+
updateAiAccountantCustomers(customers),
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return of(updateAiAccountantCustomersFailure(response.status));
|
|
24
|
+
}
|
|
25
|
+
}), catchError((error) => of(updateAiAccountantCustomersFailure(createZeniAPIStatus('Unexpected error', 'AI Accountant customers fetch failed: ' +
|
|
26
|
+
JSON.stringify(error))))));
|
|
27
|
+
}));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateAiAccountantJobs as updateAiAccountantJobEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
4
|
+
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
|
+
import { fetchAiAccountantJobs, updateAiAccountantJobs, updateAiAccountantJobsFailure, } from '../aiAccountantViewReducer';
|
|
7
|
+
export const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchAiAccountantJobs.match), switchMap((action) => {
|
|
8
|
+
const { tenantId, fetchNextPage } = action.payload;
|
|
9
|
+
const rootState = state$.value;
|
|
10
|
+
const customerView = rootState.aiAccountantViewState.customersByTenantId[tenantId];
|
|
11
|
+
const pageToken = fetchNextPage && customerView?.jobsPageToken != null
|
|
12
|
+
? customerView.jobsPageToken
|
|
13
|
+
: null;
|
|
14
|
+
const params = new URLSearchParams({
|
|
15
|
+
page_size: '50',
|
|
16
|
+
tenant_id: tenantId,
|
|
17
|
+
});
|
|
18
|
+
if (pageToken != null) {
|
|
19
|
+
params.set('page_token', pageToken);
|
|
20
|
+
}
|
|
21
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
22
|
+
const url = `${base}/ai-accountant/jobs?${params.toString()}`;
|
|
23
|
+
return zeniAPI
|
|
24
|
+
.getJSON(url)
|
|
25
|
+
.pipe(mergeMap((response) => {
|
|
26
|
+
if (isSuccessResponse(response)) {
|
|
27
|
+
const jobs = response.data?.jobs ?? [];
|
|
28
|
+
const users = response.data?.users ?? [];
|
|
29
|
+
const nextPageToken = response.data?.next_page_token ?? null;
|
|
30
|
+
return from([
|
|
31
|
+
updateAllUsers({ users }),
|
|
32
|
+
updateAiAccountantJobEntities(tenantId, jobs, fetchNextPage),
|
|
33
|
+
updateAiAccountantJobs(tenantId, nextPageToken),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return of(updateAiAccountantJobsFailure({
|
|
38
|
+
tenantId,
|
|
39
|
+
error: response.status,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
}), catchError((error) => of(updateAiAccountantJobsFailure({
|
|
43
|
+
tenantId,
|
|
44
|
+
error: createZeniAPIStatus('Unexpected error', 'AI Accountant jobs fetch failed: ' +
|
|
45
|
+
JSON.stringify(error)),
|
|
46
|
+
}))));
|
|
47
|
+
}));
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
|
+
import { fetchAiAccountantCustomers, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess, } from '../aiAccountantViewReducer';
|
|
6
|
+
export const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(triggerAiAccountantJob.match), mergeMap((action) => {
|
|
7
|
+
const { operationType, startDate, endDate } = action.payload;
|
|
8
|
+
const rootState = state$.value;
|
|
9
|
+
const selectedTenantIds = rootState.aiAccountantViewState.selectedTenantIdsForJobTrigger;
|
|
10
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
11
|
+
const url = `${base}/ai-accountant/jobs`;
|
|
12
|
+
const params = operationType === 'offboard'
|
|
13
|
+
? {}
|
|
14
|
+
: { start_date: startDate, end_date: endDate };
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.postAndGetJSON(url, {
|
|
17
|
+
tenant_ids: selectedTenantIds,
|
|
18
|
+
operation_type: operationType,
|
|
19
|
+
params,
|
|
20
|
+
})
|
|
21
|
+
.pipe(mergeMap((response) => {
|
|
22
|
+
if (isSuccessResponse(response)) {
|
|
23
|
+
return from([
|
|
24
|
+
triggerAiAccountantJobSuccess(),
|
|
25
|
+
fetchAiAccountantCustomers(),
|
|
26
|
+
openSnackbar({
|
|
27
|
+
messageSection: 'ai_accountant_trigger_job',
|
|
28
|
+
messageText: 'success',
|
|
29
|
+
type: 'success',
|
|
30
|
+
}),
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const reason = resolveTriggerFailureReason(response);
|
|
35
|
+
return from([
|
|
36
|
+
triggerAiAccountantJobFailure(response.status),
|
|
37
|
+
openSnackbar({
|
|
38
|
+
messageSection: 'ai_accountant_trigger_job',
|
|
39
|
+
messageText: 'failed',
|
|
40
|
+
type: 'error',
|
|
41
|
+
variables: [
|
|
42
|
+
{ variableName: '__reason__', variableValue: reason },
|
|
43
|
+
],
|
|
44
|
+
}),
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
}), catchError((error) => from([
|
|
48
|
+
triggerAiAccountantJobFailure(createZeniAPIStatus('Unexpected error', 'AI Accountant trigger job failed: ' + JSON.stringify(error))),
|
|
49
|
+
openSnackbar({
|
|
50
|
+
messageSection: 'ai_accountant_trigger_job',
|
|
51
|
+
messageText: 'failed',
|
|
52
|
+
type: 'error',
|
|
53
|
+
variables: [
|
|
54
|
+
{ variableName: '__reason__', variableValue: 'Unexpected error' },
|
|
55
|
+
],
|
|
56
|
+
}),
|
|
57
|
+
])));
|
|
58
|
+
}));
|
|
59
|
+
/**
|
|
60
|
+
* Pick the most useful failure reason from the trigger response:
|
|
61
|
+
* prefer the first `skipped[].reason`, then `data.error`, then the
|
|
62
|
+
* status message. Falls back to empty so the snackbar template can
|
|
63
|
+
* still render.
|
|
64
|
+
*/
|
|
65
|
+
const resolveTriggerFailureReason = (response) => {
|
|
66
|
+
if (response.data?.skipped != null && response.data.skipped.length > 0) {
|
|
67
|
+
return response.data.skipped[0].reason;
|
|
68
|
+
}
|
|
69
|
+
if (response.data?.error != null && response.data.error.length > 0) {
|
|
70
|
+
return response.data.error;
|
|
71
|
+
}
|
|
72
|
+
if (response.status.message.length > 0) {
|
|
73
|
+
return response.status.message;
|
|
74
|
+
}
|
|
75
|
+
return '';
|
|
76
|
+
};
|