@zeniai/client-epic-state 4.20.11 → 5.0.0-beta0ND
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/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +3 -0
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/coreEpics.js +2 -1
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountReducer.d.ts +5 -2
- package/lib/entity/account/accountReducer.js +7 -2
- package/lib/entity/account/accountState.d.ts +1 -1
- 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/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- 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/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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +7 -0
- package/lib/entity/tenant/SessionManager.d.ts +38 -0
- package/lib/entity/tenant/SessionManager.js +171 -0
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.d.ts +16 -0
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.js +16 -0
- package/lib/entity/tenant/sessionTypes.d.ts +26 -0
- package/lib/entity/tenant/sessionTypes.js +12 -0
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +10 -3
- package/lib/entity/tenant/tenantReducer.js +30 -2
- package/lib/entity/tenant/tenantSelector.d.ts +1 -0
- package/lib/entity/tenant/tenantSelector.js +9 -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 +9 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +79 -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/epic.d.ts +15 -1
- package/lib/epic.js +15 -1
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
- package/lib/esm/commonStateTypes/animations.js +3 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/esm/coreEpics.js +2 -1
- package/lib/esm/entity/account/accountReducer.js +6 -1
- package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +7 -0
- package/lib/esm/entity/tenant/SessionManager.js +167 -0
- package/lib/esm/entity/tenant/epic/sessionHeartbeatEpic.js +12 -0
- package/lib/esm/entity/tenant/sessionTypes.js +9 -0
- package/lib/esm/entity/tenant/tenantReducer.js +28 -1
- package/lib/esm/entity/tenant/tenantSelector.js +7 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +79 -1
- package/lib/esm/epic.js +15 -1
- package/lib/esm/index.js +22 -16
- package/lib/esm/reducer.js +3 -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/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +44 -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/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 +13 -5
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/esm/view/expenseAutomationView/{bulkUploadTiming.js → helpers/bulkUploadTiming.js} +6 -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 +26 -3
- 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/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -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/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/index.d.ts +32 -22
- package/lib/index.js +72 -33
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -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 +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -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/companyPassport/companyPassportViewState.d.ts +1 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +48 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +48 -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/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 +12 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/view/expenseAutomationView/{bulkUploadTiming.d.ts → helpers/bulkUploadTiming.d.ts} +6 -0
- package/lib/view/expenseAutomationView/{bulkUploadTiming.js → helpers/bulkUploadTiming.js} +7 -1
- 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 +1 -1
- 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 +12 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +27 -4
- 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 +4 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- 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/billList/billListSelector.js +10 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- 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/chargeCardDetail.d.ts +1 -1
- 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/remiListSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- 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/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/package.json +1 -1
|
@@ -21,13 +21,13 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
21
21
|
if (isSuccessResponse(response) && response.data != null) {
|
|
22
22
|
const updateActions = [];
|
|
23
23
|
updateActions.push(updateJESchedules([
|
|
24
|
-
...response.data.
|
|
24
|
+
...response.data.je_schedules,
|
|
25
25
|
...response.data.failed_je_postings.je_schedules,
|
|
26
26
|
]), updateJESchedulesDetails([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), initializeJeScheduleLocalData([
|
|
27
27
|
...response.data.failed_je_postings.je_schedules,
|
|
28
28
|
]));
|
|
29
29
|
updateActions.push(fetchJeSchedulesSuccess({
|
|
30
|
-
jeSchedules: [...response.data.
|
|
30
|
+
jeSchedules: [...response.data.je_schedules],
|
|
31
31
|
failedJeSchedules: [
|
|
32
32
|
...response.data.failed_je_postings.je_schedules,
|
|
33
33
|
],
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { merge, of } from 'rxjs';
|
|
2
|
+
import { filter, mergeMap, switchMap, take, takeUntil } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, restoreBulkUploadMatchingState, storeBatchDetails, } from '../../reducers/missingReceiptsViewReducer';
|
|
5
|
+
/**
|
|
6
|
+
* Show a success toast when batch details arrive for the current upload batch,
|
|
7
|
+
* e.g. "17 out of 20 Receipts Matched". Scoped per upload session so it fires
|
|
8
|
+
* only once: starts on `bulkUploadReceiptsSuccess` (or `restoreBulkUploadMatchingState`
|
|
9
|
+
* for a restored session), waits for the first batch-details action for that batch,
|
|
10
|
+
* emits the toast, then stops. `clearBulkUpload` cancels the in-flight wait.
|
|
11
|
+
*/
|
|
12
|
+
export const bulkUploadMatchResultToastEpic = (actions$) => actions$.pipe(filter((action) => bulkUploadReceiptsSuccess.match(action) ||
|
|
13
|
+
restoreBulkUploadMatchingState.match(action)), switchMap((uploadAction) => {
|
|
14
|
+
const { batchId } = uploadAction.payload;
|
|
15
|
+
return merge(actions$.pipe(filter(fetchBulkUploadBatchDetailsSuccess.match)), actions$.pipe(filter(storeBatchDetails.match))).pipe(filter((a) => a.payload.batchId === batchId), take(1), mergeMap((action) => {
|
|
16
|
+
const { summary } = action.payload;
|
|
17
|
+
return of(openSnackbar({
|
|
18
|
+
messageSection: 'receipts_bulk_match',
|
|
19
|
+
messageText: 'success',
|
|
20
|
+
type: 'success',
|
|
21
|
+
variables: [
|
|
22
|
+
{
|
|
23
|
+
variableName: '_matched_',
|
|
24
|
+
variableValue: String(summary.matched),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
variableName: '_total_',
|
|
28
|
+
variableValue: String(summary.total),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}));
|
|
32
|
+
}), takeUntil(actions$.pipe(filter(clearBulkUpload.match))));
|
|
33
|
+
}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { concat, of, timer } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
4
|
-
import { BULK_UPLOAD_BAR_COMPLETE_HOLD_MS } from '../../bulkUploadTiming';
|
|
4
|
+
import { BULK_UPLOAD_BAR_COMPLETE_HOLD_MS } from '../../helpers/bulkUploadTiming';
|
|
5
5
|
import { bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, updateBulkUploadProgress, } from '../../reducers/missingReceiptsViewReducer';
|
|
6
|
-
export const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(bulkUploadReceipts.match),
|
|
6
|
+
export const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(bulkUploadReceipts.match), switchMap((action) => {
|
|
7
7
|
const { files } = action.payload;
|
|
8
8
|
const formData = new FormData();
|
|
9
9
|
for (const file of files) {
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import {
|
|
3
|
+
import { toMonthYearPeriodId } from '../../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
5
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
6
|
import { toBatchListItem, } from '../../payload/missingReceiptsPayload';
|
|
7
7
|
import { fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
+
import { BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS } from '../../helpers/bulkUploadTiming';
|
|
9
|
+
import { rollingCalendarDateRangeInclusive } from '../../helpers/rollingCalendarDateRangeInclusive';
|
|
8
10
|
export const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatches.match), switchMap((action) => {
|
|
9
11
|
const { cacheOverride } = action.payload;
|
|
10
12
|
const state = state$.value;
|
|
@@ -19,10 +21,10 @@ export const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions
|
|
|
19
21
|
selectedPeriod,
|
|
20
22
|
}));
|
|
21
23
|
}
|
|
22
|
-
const
|
|
24
|
+
const { end, start } = rollingCalendarDateRangeInclusive(BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS);
|
|
23
25
|
const queryParam = {
|
|
24
|
-
start_date:
|
|
25
|
-
end_date:
|
|
26
|
+
start_date: start,
|
|
27
|
+
end_date: end,
|
|
26
28
|
sort_order: 'desc',
|
|
27
29
|
};
|
|
28
30
|
return zeniAPI
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { fetchCompletedTransactions, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, } from '../../reducers/missingReceiptsViewReducer';
|
|
4
|
+
/**
|
|
5
|
+
* Completed transactions are cached per sort key/order/sub-tab. After a sort or sub-tab
|
|
6
|
+
* change, the fetch epic would otherwise skip the network when that cache entry already
|
|
7
|
+
* exists — dispatch a cache-bypassing initial fetch whenever either changes from the UI.
|
|
8
|
+
*/
|
|
9
|
+
export const refetchCompletedTransactionsOnBulkUploadSortEpic = (actions$) => {
|
|
10
|
+
return actions$.pipe(filter((action) => setBulkUploadSortConfig.match(action) ||
|
|
11
|
+
setBulkUploadCompletedSubTab.match(action)), mergeMap(() => of(fetchCompletedTransactions(undefined, true))));
|
|
12
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { EMPTY, concat, from, of } from 'rxjs';
|
|
2
|
+
import { catchError, concatMap, filter, mergeMap, take } from 'rxjs/operators';
|
|
3
|
+
import { isSuccessResponse } from '../../../../responsePayload';
|
|
4
|
+
import { isBatchDetailsStatusPendingOrProcessing, toBatchListItem, } from '../../payload/missingReceiptsPayload';
|
|
5
|
+
import { fetchBulkUploadBatchesSuccess, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, } from '../../reducers/missingReceiptsViewReducer';
|
|
6
|
+
import { BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS } from '../../helpers/bulkUploadTiming';
|
|
7
|
+
import { rollingCalendarDateRangeInclusive } from '../../helpers/rollingCalendarDateRangeInclusive';
|
|
8
|
+
import { toMonthYearPeriodId } from '../../../../commonStateTypes/timePeriod';
|
|
9
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
10
|
+
/**
|
|
11
|
+
* On missing-receipts entry / period switch, hydrate the automatching banner for the logged-in
|
|
12
|
+
* user without relying on UI-driven list fetches (the Missing tab does not fetch the batch list
|
|
13
|
+
* while `phase === 'idle'`). Flow:
|
|
14
|
+
* 1. Call `GET /1.0/batches` (rolling 30-day window).
|
|
15
|
+
* 2. Emit `fetchBulkUploadBatchesSuccess` so `batchListByPeriod` is populated for the selected
|
|
16
|
+
* period (prevents a duplicate list fetch when the user switches to the Unmatched tab).
|
|
17
|
+
* 3. For each `processing|pending` row, call `GET /1.0/batches/:id` in order; for the first row
|
|
18
|
+
* whose details `user_id` matches the logged-in user and whose status is still
|
|
19
|
+
* pending/processing, dispatch `restoreBulkUploadMatchingState` and stop.
|
|
20
|
+
*/
|
|
21
|
+
export const restoreBulkUploadAutomatchingOnMountEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(restoreBulkUploadAutomatchingOnMount.match), mergeMap(() => {
|
|
22
|
+
const state = state$.value;
|
|
23
|
+
const { expenseAutomationMissingReceiptsViewState: { bulkUpload }, expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
|
|
24
|
+
if (bulkUpload.phase !== 'idle') {
|
|
25
|
+
return EMPTY;
|
|
26
|
+
}
|
|
27
|
+
if (bulkUpload.batchListFetchState.fetchState === 'In-Progress') {
|
|
28
|
+
return EMPTY;
|
|
29
|
+
}
|
|
30
|
+
const loggedInUserId = state.tenantState.loggedInUser?.userId;
|
|
31
|
+
if (loggedInUserId == null) {
|
|
32
|
+
return EMPTY;
|
|
33
|
+
}
|
|
34
|
+
const currentTenant = getCurrentTenant(state);
|
|
35
|
+
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
36
|
+
if (selectedPeriod == null) {
|
|
37
|
+
return EMPTY;
|
|
38
|
+
}
|
|
39
|
+
const { end, start } = rollingCalendarDateRangeInclusive(BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS);
|
|
40
|
+
const queryParam = {
|
|
41
|
+
start_date: start,
|
|
42
|
+
end_date: end,
|
|
43
|
+
sort_order: 'desc',
|
|
44
|
+
};
|
|
45
|
+
const listUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
|
|
46
|
+
const detailsBaseUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/`;
|
|
47
|
+
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
48
|
+
const alreadyCached = (bulkUpload.batchListByPeriod[periodId] ?? []).length > 0 &&
|
|
49
|
+
bulkUpload.batchListFetchState.fetchState === 'Completed';
|
|
50
|
+
const listSource = alreadyCached
|
|
51
|
+
? of(null)
|
|
52
|
+
: zeniAPI.getJSON(listUrl).pipe(catchError(() => of(null)));
|
|
53
|
+
return listSource.pipe(mergeMap((listResponse) => {
|
|
54
|
+
const batchList = alreadyCached
|
|
55
|
+
? bulkUpload.batchListByPeriod[periodId] ?? []
|
|
56
|
+
: listResponse != null &&
|
|
57
|
+
isSuccessResponse(listResponse) &&
|
|
58
|
+
listResponse.data != null
|
|
59
|
+
? listResponse.data.batches.map(toBatchListItem)
|
|
60
|
+
: null;
|
|
61
|
+
if (batchList == null) {
|
|
62
|
+
return EMPTY;
|
|
63
|
+
}
|
|
64
|
+
const successAction = alreadyCached
|
|
65
|
+
? null
|
|
66
|
+
: fetchBulkUploadBatchesSuccess({
|
|
67
|
+
batchList,
|
|
68
|
+
selectedPeriod,
|
|
69
|
+
});
|
|
70
|
+
const processingBatches = batchList.filter((b) => {
|
|
71
|
+
const status = b.status.toLowerCase();
|
|
72
|
+
return status === 'processing' || status === 'pending';
|
|
73
|
+
});
|
|
74
|
+
const restoreStream = from(processingBatches).pipe(concatMap((batch) => zeniAPI
|
|
75
|
+
.getJSON(`${detailsBaseUrl}${batch.batchId}`)
|
|
76
|
+
.pipe(mergeMap((response) => {
|
|
77
|
+
if (!isSuccessResponse(response) || response.data == null) {
|
|
78
|
+
return EMPTY;
|
|
79
|
+
}
|
|
80
|
+
const data = response.data;
|
|
81
|
+
const detailsUserId = data.user_id;
|
|
82
|
+
if (detailsUserId == null ||
|
|
83
|
+
detailsUserId !== loggedInUserId) {
|
|
84
|
+
return EMPTY;
|
|
85
|
+
}
|
|
86
|
+
if (!isBatchDetailsStatusPendingOrProcessing(data.status)) {
|
|
87
|
+
return EMPTY;
|
|
88
|
+
}
|
|
89
|
+
return of(restoreBulkUploadMatchingState({
|
|
90
|
+
batchId: batch.batchId,
|
|
91
|
+
totalFiles: batch.totalFiles,
|
|
92
|
+
}));
|
|
93
|
+
}), catchError(() => EMPTY))), take(1));
|
|
94
|
+
return successAction != null
|
|
95
|
+
? concat(of(successAction), restoreStream)
|
|
96
|
+
: restoreStream;
|
|
97
|
+
}));
|
|
98
|
+
}));
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { EMPTY, from, merge, of } from 'rxjs';
|
|
2
2
|
import { catchError, debounceTime, filter, mergeMap, switchMap, } from 'rxjs/operators';
|
|
3
|
-
import { convertToPeriod } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
3
|
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
6
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
5
|
import { supportedTransactionPayloadToManualSearchResult } from '../../payload/missingReceiptsPayload';
|
|
8
6
|
import { searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
9
7
|
import { toTransactionsSortKey } from '../../types/transactionsViewState';
|
|
8
|
+
import { rollingCalendarDateRangeInclusive } from '../../helpers/rollingCalendarDateRangeInclusive';
|
|
10
9
|
/**
|
|
11
10
|
* `auto_categorized` for manual transaction search (Unmatched).
|
|
12
11
|
* Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
|
|
13
12
|
* when the expense-automation API documents the intended filter for this flow.
|
|
14
13
|
*/
|
|
15
14
|
export const MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
|
|
15
|
+
/** Inclusive rolling window for manual match search (ignores accounting period picker). */
|
|
16
|
+
const MANUAL_SEARCH_TRANSACTION_DATE_RANGE_DAYS = 90;
|
|
16
17
|
export const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
|
|
17
18
|
const searchActions$ = actions$.pipe(filter(searchTransactionsForManualMatch.match));
|
|
18
19
|
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
@@ -29,18 +30,11 @@ export const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI)
|
|
|
29
30
|
return EMPTY;
|
|
30
31
|
}
|
|
31
32
|
const state = state$.value;
|
|
32
|
-
const {
|
|
33
|
-
const
|
|
34
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
35
|
-
if (selectedPeriod == null) {
|
|
36
|
-
return of(searchTransactionsForManualMatchFailure({
|
|
37
|
-
error: createZeniAPIStatus('Unexpected Error', 'Manual search requires a selected accounting period.'),
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
const period = convertToPeriod(selectedPeriod);
|
|
33
|
+
const { expenseAutomationMissingReceiptsViewState: { bulkUpload: { manualSearch, sortKey, sortOrder }, }, } = state;
|
|
34
|
+
const { end, start } = rollingCalendarDateRangeInclusive(MANUAL_SEARCH_TRANSACTION_DATE_RANGE_DAYS);
|
|
41
35
|
const queryParam = {
|
|
42
|
-
start_date:
|
|
43
|
-
end_date:
|
|
36
|
+
start_date: start,
|
|
37
|
+
end_date: end,
|
|
44
38
|
auto_categorized: MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED,
|
|
45
39
|
sort_by: toTransactionsSortKey(sortKey),
|
|
46
40
|
sort_order: sortOrder === 'ascending' ? 'asc' : 'desc',
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js
CHANGED
|
@@ -3,11 +3,13 @@ import { catchError, debounceTime, filter, mergeMap, switchMap, takeUntil, } fro
|
|
|
3
3
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
4
|
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
5
5
|
import { isSuccessResponse } from '../../../../responsePayload';
|
|
6
|
-
import { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS } from '../../bulkUploadTiming';
|
|
6
|
+
import { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS } from '../../helpers/bulkUploadTiming';
|
|
7
7
|
import { extractTransactionPayloadsFromBatchFiles, isBatchDetailsApiStatusCompleted, toBatchDetails, } from '../../payload/missingReceiptsPayload';
|
|
8
|
-
import { bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
+
import { bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, restoreBulkUploadMatchingState, } from '../../reducers/missingReceiptsViewReducer';
|
|
9
9
|
/** First poll after upload; then interval while batch not resolved via Pusher or API. */
|
|
10
10
|
const FALLBACK_FIRST_DELAY_MS = 30000;
|
|
11
|
+
/** Shorter first poll for restored sessions — batch may already be near completion. */
|
|
12
|
+
const RESTORE_FIRST_DELAY_MS = 5000;
|
|
11
13
|
const FALLBACK_POLL_INTERVAL_MS = 10000;
|
|
12
14
|
/**
|
|
13
15
|
* On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs),
|
|
@@ -25,7 +27,8 @@ export const pusherBatchStatusCompletionEpic = (actions$) => actions$.pipe(filte
|
|
|
25
27
|
* force `phase` to `completed` (dismiss automatching banner) and refresh the batch list.
|
|
26
28
|
* Cancels when the batch completes normally, bulk state is cleared, or another upload supersedes.
|
|
27
29
|
*/
|
|
28
|
-
export const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe(filter(bulkUploadReceiptsSuccess.match
|
|
30
|
+
export const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe(filter((action) => bulkUploadReceiptsSuccess.match(action) ||
|
|
31
|
+
restoreBulkUploadMatchingState.match(action)), mergeMap((action) => {
|
|
29
32
|
const { batchId } = action.payload;
|
|
30
33
|
return timer(BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS).pipe(mergeMap(() => {
|
|
31
34
|
const bulk = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
@@ -44,10 +47,15 @@ export const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.
|
|
|
44
47
|
* error snackbar per upload session (first failure only) so the user is not spammed every
|
|
45
48
|
* interval; Pusher or a later successful poll still completes the flow.
|
|
46
49
|
*/
|
|
47
|
-
export const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(bulkUploadReceiptsSuccess.match
|
|
50
|
+
export const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter((action) => bulkUploadReceiptsSuccess.match(action) ||
|
|
51
|
+
restoreBulkUploadMatchingState.match(action)), mergeMap((action) => {
|
|
48
52
|
const { batchId } = action.payload;
|
|
49
53
|
let pollErrorNotified = false;
|
|
50
|
-
|
|
54
|
+
const firstDelay = restoreBulkUploadMatchingState.match(action)
|
|
55
|
+
? RESTORE_FIRST_DELAY_MS
|
|
56
|
+
: FALLBACK_FIRST_DELAY_MS;
|
|
57
|
+
return timer(firstDelay, FALLBACK_POLL_INTERVAL_MS).pipe(takeUntil(merge(actions$.pipe(filter(clearBulkUpload.match)), actions$.pipe(filter(pusherBatchStatusUpdate.match), filter((action) => action.payload.batchId === batchId &&
|
|
58
|
+
action.payload.status === 'completed')), actions$.pipe(filter(fetchBulkUploadBatchDetailsSuccess.match), filter((action) => action.payload.batchId === batchId)), actions$.pipe(filter(bulkUploadAutomatchingTimedOut.match), filter((action) => action.payload.batchId === batchId)))), switchMap(() => zeniAPI
|
|
51
59
|
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
|
|
52
60
|
.pipe(mergeMap((response) => {
|
|
53
61
|
/** Same batch-details URL; polls until `status` is completed (Pusher may win first). */
|
|
@@ -91,7 +91,6 @@ export function getExpenseAutomationView(state) {
|
|
|
91
91
|
const fetchStateVariables = [
|
|
92
92
|
expenseAutomationMissingReceiptsViewState,
|
|
93
93
|
expenseAutomationJESchedulesViewState,
|
|
94
|
-
monthEndCloseChecksView,
|
|
95
94
|
expenseAutomationTransactionsView,
|
|
96
95
|
expenseAutomationReconciliationViewState,
|
|
97
96
|
];
|
package/lib/esm/view/expenseAutomationView/{bulkUploadTiming.js → helpers/bulkUploadTiming.js}
RENAMED
|
@@ -8,3 +8,9 @@ export const BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
|
|
|
8
8
|
* fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
|
|
9
9
|
*/
|
|
10
10
|
export const BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
|
|
11
|
+
/**
|
|
12
|
+
* Rolling window (in days) for the bulk-upload batch list API. Period-agnostic — the batch list
|
|
13
|
+
* ignores the accounting month picker. Shared between the regular batch-list fetch and the
|
|
14
|
+
* restore-on-mount hydration so both flows always query the same window.
|
|
15
|
+
*/
|
|
16
|
+
export const BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS = 30;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DEFAULT_DATE_FORMAT } from '../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY';
|
|
2
|
+
import { dateNow } from '../../../zeniDayJS';
|
|
3
|
+
/**
|
|
4
|
+
* Local calendar dates from (end − (days − 1)) through end, inclusive.
|
|
5
|
+
*/
|
|
6
|
+
export function rollingCalendarDateRangeInclusive(days) {
|
|
7
|
+
const end = dateNow().startOf('day');
|
|
8
|
+
const start = end.subtract(days - 1, 'day');
|
|
9
|
+
return {
|
|
10
|
+
end: end.format(DEFAULT_DATE_FORMAT),
|
|
11
|
+
start: start.format(DEFAULT_DATE_FORMAT),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -64,8 +64,8 @@ export const toTransactionUpdatesFromTransactionCategorizationLocalData = (trans
|
|
|
64
64
|
lineItem.account?.qboId !== accountLine.account.qboId &&
|
|
65
65
|
Boolean(lineItem.account?.qboId);
|
|
66
66
|
hasClassChanged =
|
|
67
|
-
|
|
68
|
-
lineItem.class?.qboId !== accountLine.class
|
|
67
|
+
(lineItem.class?.qboId != null || accountLine.class?.qboId != null) &&
|
|
68
|
+
lineItem.class?.qboId !== accountLine.class?.qboId;
|
|
69
69
|
const recommendedAccountBase = toRecommendedAccountBase(lineItem.amount.amount, lineItem.account);
|
|
70
70
|
const recommendedClassBase = toRecommendedClassBase(lineItem.amount.amount, lineItem.class);
|
|
71
71
|
if (entityDetails != null &&
|
package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js
CHANGED
|
@@ -234,7 +234,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
234
234
|
isPreFilled: true,
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
if (accountLine.class
|
|
237
|
+
if (Boolean(accountLine.class?.classId) === false &&
|
|
238
238
|
higherPreferenceRecommendation?.class != null) {
|
|
239
239
|
record.class = {
|
|
240
240
|
...higherPreferenceRecommendation.class,
|
|
@@ -464,7 +464,7 @@ export const setEntityRecommendationForLineIdInLocalData = (draft, transaction,
|
|
|
464
464
|
}
|
|
465
465
|
: accountLine.account;
|
|
466
466
|
record.class =
|
|
467
|
-
accountLine.class
|
|
467
|
+
Boolean(accountLine.class?.classId) !== false
|
|
468
468
|
? accountLine.class
|
|
469
469
|
: recommendations?.[0]?.class
|
|
470
470
|
? {
|
|
@@ -99,8 +99,16 @@ export function toBatchDetails(payload, filesEndPoint) {
|
|
|
99
99
|
files: payload.files.map((file) => toBatchFile(file, filesEndPoint)),
|
|
100
100
|
status: toBatchStatusValue(payload.status),
|
|
101
101
|
summary: toBatchSummary(payload.summary),
|
|
102
|
+
...(payload.user_id != null && payload.user_id !== ''
|
|
103
|
+
? { userId: payload.user_id }
|
|
104
|
+
: {}),
|
|
102
105
|
};
|
|
103
106
|
}
|
|
107
|
+
/** Batch is still in-flight for automatching (GET /batches/:id while not completed). */
|
|
108
|
+
export function isBatchDetailsStatusPendingOrProcessing(status) {
|
|
109
|
+
const s = status.toLowerCase();
|
|
110
|
+
return s === 'processing' || s === 'pending';
|
|
111
|
+
}
|
|
104
112
|
/** Batch list `status` is a string from the API — compare case-insensitively. */
|
|
105
113
|
export function isBatchListStatusCompleted(status) {
|
|
106
114
|
return status.toLowerCase() === 'completed';
|
|
@@ -158,6 +166,7 @@ export function toBatchListItem(payload) {
|
|
|
158
166
|
possibleMatchesCount: payload.possible_matches_count,
|
|
159
167
|
status: payload.status,
|
|
160
168
|
totalFiles: payload.total_files,
|
|
169
|
+
userId: payload.user_id,
|
|
161
170
|
};
|
|
162
171
|
}
|
|
163
172
|
/**
|
|
@@ -44,6 +44,9 @@ export const initialState = {
|
|
|
44
44
|
uiState: {
|
|
45
45
|
searchString: '',
|
|
46
46
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
47
|
+
selectedMainTab: 'pending_review',
|
|
48
|
+
sortKey: 'transactionDate',
|
|
49
|
+
sortOrder: 'descending',
|
|
47
50
|
totalCount: 0,
|
|
48
51
|
limit: 10,
|
|
49
52
|
},
|
|
@@ -365,12 +368,29 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
365
368
|
clearJeAccountSettingsLocalData(draft) {
|
|
366
369
|
draft.accountSettings.localData = accountSettingsInitialState.localData;
|
|
367
370
|
},
|
|
371
|
+
updateJESchedulesUIState(draft, action) {
|
|
372
|
+
if (action.payload.sortKey != null) {
|
|
373
|
+
draft.uiState.sortKey = action.payload.sortKey;
|
|
374
|
+
}
|
|
375
|
+
if (action.payload.sortOrder != null) {
|
|
376
|
+
draft.uiState.sortOrder = action.payload.sortOrder;
|
|
377
|
+
}
|
|
378
|
+
if (action.payload.searchString != null) {
|
|
379
|
+
draft.uiState.searchString = action.payload.searchString;
|
|
380
|
+
}
|
|
381
|
+
if (action.payload.scrollPosition != null) {
|
|
382
|
+
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
383
|
+
}
|
|
384
|
+
if (action.payload.selectedMainTab != null) {
|
|
385
|
+
draft.uiState.selectedMainTab = action.payload.selectedMainTab;
|
|
386
|
+
}
|
|
387
|
+
},
|
|
368
388
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
369
389
|
Object.assign(draft, initialState);
|
|
370
390
|
},
|
|
371
391
|
},
|
|
372
392
|
});
|
|
373
|
-
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
|
|
393
|
+
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
|
|
374
394
|
export default expenseAutomationJESchedulesView.reducer;
|
|
375
395
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
376
396
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = mapAccountTypeRecommendationPayloadToAccountRecommendationByType(payload);
|
|
@@ -27,6 +27,7 @@ export const initialBulkUploadState = {
|
|
|
27
27
|
phase: 'idle',
|
|
28
28
|
sortKey: 'date',
|
|
29
29
|
sortOrder: 'descending',
|
|
30
|
+
uploadedFileCount: 0,
|
|
30
31
|
uploadProgress: 0,
|
|
31
32
|
uploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
32
33
|
};
|
|
@@ -53,6 +54,12 @@ export const initialState = {
|
|
|
53
54
|
};
|
|
54
55
|
/** Epic trigger only; batch-details fetch is handled in epics. */
|
|
55
56
|
export const fetchBulkUploadBatchDetails = createAction('expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetails');
|
|
57
|
+
/**
|
|
58
|
+
* Epic trigger only. Dispatched from the screen on missing-receipts entry / period switch so the
|
|
59
|
+
* automatching banner is restored for the logged-in user even when they sit on the Missing tab
|
|
60
|
+
* after a hard refresh. The epic owns the list + details API calls end-to-end.
|
|
61
|
+
*/
|
|
62
|
+
export const restoreBulkUploadAutomatchingOnMount = createAction('expenseAutomationMissingReceiptsView/restoreBulkUploadAutomatchingOnMount');
|
|
56
63
|
const expenseAutomationMissingReceiptsView = createSlice({
|
|
57
64
|
name: 'expenseAutomationMissingReceiptsView',
|
|
58
65
|
initialState,
|
|
@@ -156,21 +163,29 @@ const expenseAutomationMissingReceiptsView = createSlice({
|
|
|
156
163
|
},
|
|
157
164
|
// -- Bulk Upload Actions --
|
|
158
165
|
bulkUploadReceipts: {
|
|
159
|
-
reducer(draft) {
|
|
166
|
+
reducer(draft, action) {
|
|
160
167
|
draft.bulkUpload.phase = 'uploading';
|
|
161
168
|
draft.bulkUpload.uploadProgress = 0;
|
|
169
|
+
draft.bulkUpload.uploadedFileCount = action.payload.fileCount;
|
|
162
170
|
draft.bulkUpload.uploadStatus = {
|
|
163
171
|
fetchState: 'In-Progress',
|
|
164
172
|
error: undefined,
|
|
165
173
|
};
|
|
166
174
|
},
|
|
167
175
|
prepare(files) {
|
|
168
|
-
return { payload: { files } };
|
|
176
|
+
return { payload: { files, fileCount: files.length } };
|
|
169
177
|
},
|
|
170
178
|
},
|
|
171
179
|
updateBulkUploadProgress(draft, action) {
|
|
172
180
|
draft.bulkUpload.uploadProgress = action.payload;
|
|
173
181
|
},
|
|
182
|
+
/**
|
|
183
|
+
* Sync file count when bulk upload uses direct HTTP (`bulkUploadReceipts` Redux action is not
|
|
184
|
+
* dispatched, so `bulkUploadReceipts` reducer never runs).
|
|
185
|
+
*/
|
|
186
|
+
setBulkUploadUploadedFileCount(draft, action) {
|
|
187
|
+
draft.bulkUpload.uploadedFileCount = action.payload;
|
|
188
|
+
},
|
|
174
189
|
bulkUploadReceiptsSuccess(draft, action) {
|
|
175
190
|
draft.bulkUpload.currentBatchId = action.payload.batchId;
|
|
176
191
|
draft.bulkUpload.uploadProgress = 100;
|
|
@@ -187,6 +202,14 @@ const expenseAutomationMissingReceiptsView = createSlice({
|
|
|
187
202
|
};
|
|
188
203
|
draft.bulkUpload.phase = 'idle';
|
|
189
204
|
},
|
|
205
|
+
restoreBulkUploadMatchingState(draft, action) {
|
|
206
|
+
if (draft.bulkUpload.phase !== 'idle') {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
draft.bulkUpload.currentBatchId = action.payload.batchId;
|
|
210
|
+
draft.bulkUpload.uploadedFileCount = action.payload.totalFiles;
|
|
211
|
+
draft.bulkUpload.phase = 'matching';
|
|
212
|
+
},
|
|
190
213
|
bulkUploadAutomatchingTimedOut: {
|
|
191
214
|
reducer(draft, action) {
|
|
192
215
|
if (draft.bulkUpload.phase !== 'matching' ||
|
|
@@ -551,7 +574,7 @@ const expenseAutomationMissingReceiptsView = createSlice({
|
|
|
551
574
|
});
|
|
552
575
|
export const { fetchMissingReceipts, fetchMissingReceiptsSuccess, fetchMissingReceiptsFailure, uploadMissingReceiptSuccess, updateMissingReceiptUploadState, updateMissingReceiptsUIState, markMissingReceiptAsDone, clearExpenseAutomationMissingReceiptsView,
|
|
553
576
|
// Bulk Upload
|
|
554
|
-
bulkUploadReceipts, updateBulkUploadProgress, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, bulkUploadAutomatchingTimedOut, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, batchDetailFetchFailed, setInitialBatchDetailsLoading, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete,
|
|
577
|
+
bulkUploadReceipts, updateBulkUploadProgress, setBulkUploadUploadedFileCount, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadMatchingState, bulkUploadAutomatchingTimedOut, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, batchDetailFetchFailed, setInitialBatchDetailsLoading, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete,
|
|
555
578
|
// Completed Transactions
|
|
556
579
|
fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, } = expenseAutomationMissingReceiptsView.actions;
|
|
557
580
|
export default expenseAutomationMissingReceiptsView.reducer;
|