@zeniai/client-epic-state 4.20.3-betaSS12 → 4.20.3-betaSS14
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 +8 -2
- package/lib/entity/tenant/clearAllEpic.js +12 -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 +12 -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 +74 -76
- package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -1
- package/lib/esm/view/creditAgentView/creditAgentViewState.js +1 -28
- package/lib/esm/view/creditAgentView/epics/downloadCreditReportEpic.js +20 -17
- package/lib/esm/view/creditAgentView/epics/fetchCardProfilesEpic.js +5 -5
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +8 -8
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +7 -7
- package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +8 -3
- package/lib/esm/view/creditAgentView/epics/updateCardProfileEpic.js +5 -11
- 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/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +10 -3
- 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 +51 -28
- package/lib/index.js +117 -49
- 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 +20 -9
- package/lib/view/creditAgentView/creditAgentViewReducer.js +77 -79
- package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
- package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
- package/lib/view/creditAgentView/creditAgentViewState.d.ts +5 -46
- package/lib/view/creditAgentView/creditAgentViewState.js +0 -29
- package/lib/view/creditAgentView/epics/downloadCreditReportEpic.d.ts +20 -5
- package/lib/view/creditAgentView/epics/downloadCreditReportEpic.js +21 -16
- package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.d.ts +4 -4
- package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.js +4 -4
- package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +6 -6
- package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +5 -5
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +5 -5
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +5 -5
- package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +8 -3
- package/lib/view/creditAgentView/epics/updateCardProfileEpic.d.ts +5 -5
- package/lib/view/creditAgentView/epics/updateCardProfileEpic.js +4 -10
- 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/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +9 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +10 -3
- 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
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
2
|
+
export const initialCreditAgentViewState = {
|
|
3
|
+
access: {
|
|
4
|
+
fetchState: 'Not-Started',
|
|
5
|
+
isAllowed: null,
|
|
6
|
+
},
|
|
7
|
+
cardProfiles: {
|
|
8
|
+
downloadState: 'Not-Started',
|
|
9
|
+
error: undefined,
|
|
10
|
+
fetchState: 'Not-Started',
|
|
11
|
+
rows: [],
|
|
12
|
+
},
|
|
13
|
+
macro: {
|
|
14
|
+
data: null,
|
|
15
|
+
error: undefined,
|
|
16
|
+
fetchState: 'Not-Started',
|
|
17
|
+
updateState: 'Not-Started',
|
|
18
|
+
},
|
|
19
|
+
scheduleCron: {
|
|
20
|
+
error: undefined,
|
|
21
|
+
fetchState: 'Not-Started',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
3
24
|
const creditAgentView = createSlice({
|
|
4
25
|
name: 'creditAgentView',
|
|
5
26
|
initialState: initialCreditAgentViewState,
|
|
@@ -8,57 +29,22 @@ const creditAgentView = createSlice({
|
|
|
8
29
|
draft.access.fetchState = 'In-Progress';
|
|
9
30
|
draft.access.isAllowed = null;
|
|
10
31
|
},
|
|
11
|
-
|
|
32
|
+
fetchCreditAgentAccessSuccess(draft, action) {
|
|
12
33
|
draft.access.fetchState = 'Completed';
|
|
13
34
|
draft.access.isAllowed = action.payload;
|
|
14
35
|
},
|
|
15
|
-
|
|
36
|
+
fetchCreditAgentAccessFailure(draft, action) {
|
|
16
37
|
draft.access.fetchState = 'Error';
|
|
17
|
-
draft.access.
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
draft
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
customerName: row.customer_name,
|
|
28
|
-
totalCashBalance: row.total_cash_balance,
|
|
29
|
-
totalCardBalance: row.total_card_balance,
|
|
30
|
-
cards: row.cards,
|
|
31
|
-
controllerName: row.controller_name,
|
|
32
|
-
period: row.period,
|
|
33
|
-
runway: row.runway,
|
|
34
|
-
burnRateMonthly: row.burn_rate_monthly,
|
|
35
|
-
healthMonitorScore: row.health_monitor_score,
|
|
36
|
-
creditScore: row.credit_score,
|
|
37
|
-
confidence: row.confidence,
|
|
38
|
-
creditAmount: row.credit_amount,
|
|
39
|
-
creditLimit: row.credit_limit,
|
|
40
|
-
conservativeLimitRationale: row.conservative_limit_rationale,
|
|
41
|
-
liberalCreditLimit: row.liberal_credit_limit,
|
|
42
|
-
liberalLimitRationale: row.liberal_limit_rationale,
|
|
43
|
-
pros: row.pros,
|
|
44
|
-
cons: row.cons,
|
|
45
|
-
reasoning: row.reasoning,
|
|
46
|
-
goingConcernAnalysis: row.going_concern_analysis,
|
|
47
|
-
keyRatios: row.key_ratios,
|
|
48
|
-
runDate: row.run_date,
|
|
49
|
-
status: row.status,
|
|
50
|
-
}));
|
|
51
|
-
draft.report.count = action.payload.count;
|
|
52
|
-
},
|
|
53
|
-
updateTenantCreditScoreReportFailure(draft, action) {
|
|
54
|
-
draft.report.fetchState = 'Error';
|
|
55
|
-
draft.report.error = action.payload;
|
|
56
|
-
},
|
|
57
|
-
scheduleTenantCreditScoreCron(draft,
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
-
_action) {
|
|
60
|
-
draft.scheduleCron.fetchState = 'In-Progress';
|
|
61
|
-
draft.scheduleCron.error = undefined;
|
|
38
|
+
draft.access.error = action.payload;
|
|
39
|
+
},
|
|
40
|
+
scheduleTenantCreditScoreCron: {
|
|
41
|
+
reducer(draft) {
|
|
42
|
+
draft.scheduleCron.fetchState = 'In-Progress';
|
|
43
|
+
draft.scheduleCron.error = undefined;
|
|
44
|
+
},
|
|
45
|
+
prepare(tenantId) {
|
|
46
|
+
return { payload: { tenantId } };
|
|
47
|
+
},
|
|
62
48
|
},
|
|
63
49
|
scheduleTenantCreditScoreCronSuccess(draft) {
|
|
64
50
|
draft.scheduleCron.fetchState = 'Completed';
|
|
@@ -76,20 +62,23 @@ const creditAgentView = createSlice({
|
|
|
76
62
|
draft.macro.fetchState = 'In-Progress';
|
|
77
63
|
draft.macro.error = undefined;
|
|
78
64
|
},
|
|
79
|
-
|
|
65
|
+
fetchCreditAgentMacroSuccess(draft, action) {
|
|
80
66
|
draft.macro.fetchState = 'Completed';
|
|
81
67
|
draft.macro.error = undefined;
|
|
82
68
|
draft.macro.data = mapMacroPayload(action.payload);
|
|
83
69
|
},
|
|
84
|
-
|
|
70
|
+
fetchCreditAgentMacroFailure(draft, action) {
|
|
85
71
|
draft.macro.fetchState = 'Error';
|
|
86
72
|
draft.macro.error = action.payload;
|
|
87
73
|
},
|
|
88
|
-
saveCreditAgentMacro
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
74
|
+
saveCreditAgentMacro: {
|
|
75
|
+
reducer(draft) {
|
|
76
|
+
draft.macro.updateState = 'In-Progress';
|
|
77
|
+
draft.macro.error = undefined;
|
|
78
|
+
},
|
|
79
|
+
prepare(instructions) {
|
|
80
|
+
return { payload: { instructions } };
|
|
81
|
+
},
|
|
93
82
|
},
|
|
94
83
|
saveCreditAgentMacroSuccess(draft, action) {
|
|
95
84
|
draft.macro.updateState = 'Completed';
|
|
@@ -108,40 +97,49 @@ const creditAgentView = createSlice({
|
|
|
108
97
|
draft.cardProfiles.fetchState = 'In-Progress';
|
|
109
98
|
draft.cardProfiles.error = undefined;
|
|
110
99
|
},
|
|
111
|
-
|
|
100
|
+
fetchCardProfilesSuccess(draft, action) {
|
|
112
101
|
draft.cardProfiles.fetchState = 'Completed';
|
|
113
102
|
draft.cardProfiles.error = undefined;
|
|
114
103
|
draft.cardProfiles.rows = action.payload;
|
|
115
104
|
},
|
|
116
|
-
|
|
105
|
+
fetchCardProfilesFailure(draft, action) {
|
|
117
106
|
draft.cardProfiles.fetchState = 'Error';
|
|
118
107
|
draft.cardProfiles.error = action.payload;
|
|
119
108
|
},
|
|
120
|
-
updateCardProfile
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
updateCardProfile: {
|
|
110
|
+
reducer() {
|
|
111
|
+
// action dispatched to trigger the epic; no optimistic state update needed
|
|
112
|
+
},
|
|
113
|
+
prepare(payload) {
|
|
114
|
+
return { payload };
|
|
115
|
+
},
|
|
126
116
|
},
|
|
127
|
-
|
|
117
|
+
updateCardProfileSuccess(draft, action) {
|
|
128
118
|
const { tenantNamespace, profile } = action.payload;
|
|
129
119
|
draft.cardProfiles.rows = draft.cardProfiles.rows.map((row) => row.tenantNamespace === tenantNamespace ? { ...row, ...profile } : row);
|
|
130
120
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
121
|
+
updateCardProfileFailure: {
|
|
122
|
+
reducer() {
|
|
123
|
+
// noop — the epic will surface the error via alert
|
|
124
|
+
},
|
|
125
|
+
prepare(payload) {
|
|
126
|
+
return { payload };
|
|
127
|
+
},
|
|
137
128
|
},
|
|
138
129
|
downloadCreditReport(draft) {
|
|
139
130
|
draft.cardProfiles.downloadState = 'In-Progress';
|
|
140
131
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
132
|
+
// Payload carries the CSV string so the consuming app can trigger the actual
|
|
133
|
+
// file download using its platform-appropriate mechanism (browser Blob / RN file API).
|
|
134
|
+
downloadCreditReportSuccess: {
|
|
135
|
+
reducer(draft) {
|
|
136
|
+
draft.cardProfiles.downloadState = 'Completed';
|
|
137
|
+
},
|
|
138
|
+
prepare(csv) {
|
|
139
|
+
return { payload: { csv } };
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
downloadCreditReportFailure(draft) {
|
|
145
143
|
draft.cardProfiles.downloadState = 'Error';
|
|
146
144
|
},
|
|
147
145
|
},
|
|
@@ -158,7 +156,7 @@ export function mapCardTenantProfileRowPayload(row) {
|
|
|
158
156
|
recommendedAmount: row.recommended_amount ?? null,
|
|
159
157
|
reportDate: row.report_date ?? null,
|
|
160
158
|
tenantId: row.tenant_id ?? null,
|
|
161
|
-
tenantNamespace:
|
|
159
|
+
tenantNamespace: row.tenant_namespace,
|
|
162
160
|
updatedByName: row.updated_by_name ?? null,
|
|
163
161
|
updatedByUserId: row.updated_by_user_id ?? null,
|
|
164
162
|
updatedOn: row.updated_on ?? null,
|
|
@@ -178,6 +176,6 @@ function mapMacroPayload(payload) {
|
|
|
178
176
|
updatedAt: payload.updated_at,
|
|
179
177
|
};
|
|
180
178
|
}
|
|
181
|
-
export const { fetchCreditAgentAccess,
|
|
179
|
+
export const { fetchCreditAgentAccess, fetchCreditAgentAccessSuccess, fetchCreditAgentAccessFailure, scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, fetchCreditAgentMacroSuccess, fetchCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, fetchCardProfiles, fetchCardProfilesSuccess, fetchCardProfilesFailure, updateCardProfile, updateCardProfileSuccess, updateCardProfileFailure, downloadCreditReport, downloadCreditReportSuccess, downloadCreditReportFailure, } = creditAgentView.actions;
|
|
182
180
|
export { initialCreditAgentViewState as initialState };
|
|
183
181
|
export default creditAgentView.reducer;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
const getCreditAgentViewState = (state) => state.creditAgentViewState;
|
|
3
|
-
export const getCreditAgentReport = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.report);
|
|
4
3
|
export const getCreditAgentMacro = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.macro);
|
|
5
4
|
export const getScheduleCronState = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.scheduleCron);
|
|
6
5
|
export const getCardProfilesData = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.cardProfiles);
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
access: {
|
|
3
|
-
fetchState: 'Not-Started',
|
|
4
|
-
isAllowed: null,
|
|
5
|
-
},
|
|
6
|
-
cardProfiles: {
|
|
7
|
-
downloadState: 'Not-Started',
|
|
8
|
-
error: undefined,
|
|
9
|
-
fetchState: 'Not-Started',
|
|
10
|
-
rows: [],
|
|
11
|
-
},
|
|
12
|
-
macro: {
|
|
13
|
-
data: null,
|
|
14
|
-
error: undefined,
|
|
15
|
-
fetchState: 'Not-Started',
|
|
16
|
-
updateState: 'Not-Started',
|
|
17
|
-
},
|
|
18
|
-
report: {
|
|
19
|
-
count: 0,
|
|
20
|
-
error: undefined,
|
|
21
|
-
fetchState: 'Not-Started',
|
|
22
|
-
rows: [],
|
|
23
|
-
},
|
|
24
|
-
scheduleCron: {
|
|
25
|
-
error: undefined,
|
|
26
|
-
fetchState: 'Not-Started',
|
|
27
|
-
},
|
|
28
|
-
};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { downloadCreditReport,
|
|
4
|
-
const CSV_HEADERS = [
|
|
3
|
+
import { downloadCreditReport, downloadCreditReportFailure, downloadCreditReportSuccess, } from '../creditAgentViewReducer';
|
|
4
|
+
export const CSV_HEADERS = [
|
|
5
5
|
'Customer Name',
|
|
6
6
|
'Card Status',
|
|
7
7
|
'Credit Limit ($)',
|
|
@@ -15,7 +15,7 @@ const CSV_HEADERS = [
|
|
|
15
15
|
'Updated By',
|
|
16
16
|
'Updated On',
|
|
17
17
|
];
|
|
18
|
-
function rowToCsvLine(row) {
|
|
18
|
+
export function rowToCsvLine(row) {
|
|
19
19
|
const fields = [
|
|
20
20
|
row.customerName,
|
|
21
21
|
row.cardStatus,
|
|
@@ -37,23 +37,26 @@ function rowToCsvLine(row) {
|
|
|
37
37
|
})
|
|
38
38
|
.join(',');
|
|
39
39
|
}
|
|
40
|
+
export function buildCsvString(rows) {
|
|
41
|
+
const csvLines = [CSV_HEADERS.join(','), ...rows.map(rowToCsvLine)];
|
|
42
|
+
return csvLines.join('\n');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Epic: gather rows from state and emit downloadCreditReportSuccess with CSV data.
|
|
46
|
+
*
|
|
47
|
+
* This epic intentionally does NOT touch the DOM (no Blob, no document, no
|
|
48
|
+
* URL.createObjectURL). Those browser-only APIs would break SSR and React Native
|
|
49
|
+
* consumers of this shared package. The consuming web app should listen for
|
|
50
|
+
* downloadCreditReportSuccess and perform the actual file-save using its own
|
|
51
|
+
* platform-appropriate mechanism.
|
|
52
|
+
*/
|
|
40
53
|
export const downloadCreditReportEpic = (actions$, state$, _zeniAPI) => actions$.pipe(filter(downloadCreditReport.match), switchMap(() => {
|
|
41
54
|
try {
|
|
42
55
|
const rows = state$.value.creditAgentViewState.cardProfiles.rows;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
|
46
|
-
const objectUrl = URL.createObjectURL(blob);
|
|
47
|
-
const link = document.createElement('a');
|
|
48
|
-
link.href = objectUrl;
|
|
49
|
-
link.setAttribute('download', 'card-tenant-profiles.csv');
|
|
50
|
-
document.body.appendChild(link);
|
|
51
|
-
link.click();
|
|
52
|
-
document.body.removeChild(link);
|
|
53
|
-
URL.revokeObjectURL(objectUrl);
|
|
54
|
-
return of(downloadCreditReportCompleted());
|
|
56
|
+
const csv = buildCsvString(rows);
|
|
57
|
+
return of(downloadCreditReportSuccess(csv));
|
|
55
58
|
}
|
|
56
59
|
catch {
|
|
57
|
-
return of(
|
|
60
|
+
return of(downloadCreditReportFailure());
|
|
58
61
|
}
|
|
59
|
-
}), catchError(() => of(
|
|
62
|
+
}), catchError(() => of(downloadCreditReportFailure())));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchCardProfiles,
|
|
4
|
+
import { fetchCardProfiles, fetchCardProfilesFailure, fetchCardProfilesSuccess, mapCardTenantProfileRowPayload, } from '../creditAgentViewReducer';
|
|
5
5
|
export const fetchCardProfilesEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchCardProfiles.match), switchMap(() => {
|
|
6
6
|
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/card-tenant-profiles`;
|
|
7
7
|
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
8
|
-
if (isSuccessResponse(response)
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
9
|
const rows = (response.data.rows ?? []).map(mapCardTenantProfileRowPayload);
|
|
10
|
-
return of(
|
|
10
|
+
return of(fetchCardProfilesSuccess(rows));
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
return of(
|
|
13
|
+
return of(fetchCardProfilesFailure(response.status));
|
|
14
14
|
}
|
|
15
|
-
}), catchError((error) => of(
|
|
15
|
+
}), catchError((error) => of(fetchCardProfilesFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
16
16
|
}));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchCreditAgentAccess,
|
|
5
|
-
export const fetchCreditAgentAccessEpic = (actions$,
|
|
2
|
+
import { catchError, filter, switchMap, withLatestFrom } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
+
import { fetchCreditAgentAccess, fetchCreditAgentAccessFailure, fetchCreditAgentAccessSuccess, } from '../creditAgentViewReducer';
|
|
5
|
+
export const fetchCreditAgentAccessEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCreditAgentAccess.match), withLatestFrom(state$), filter(([, state]) => state.creditAgentViewState.access.fetchState !== 'In-Progress'), switchMap(() => {
|
|
6
6
|
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/cards-cockpit-access`;
|
|
7
7
|
return zeniAPI.getJSON(url).pipe(switchMap((response) => {
|
|
8
|
-
if (isSuccessResponse(response)
|
|
9
|
-
return of(
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
|
+
return of(fetchCreditAgentAccessSuccess(response.data.is_allowed === true));
|
|
10
10
|
}
|
|
11
|
-
return of(
|
|
12
|
-
}), catchError(() => of(
|
|
11
|
+
return of(fetchCreditAgentAccessFailure(response.status));
|
|
12
|
+
}), catchError((error) => of(fetchCreditAgentAccessFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
13
13
|
}));
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
2
|
+
import { catchError, filter, switchMap, mergeMap, withLatestFrom } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchCreditAgentMacro,
|
|
5
|
-
export const fetchCreditAgentMacroEpic = (actions$,
|
|
4
|
+
import { fetchCreditAgentMacro, fetchCreditAgentMacroFailure, fetchCreditAgentMacroSuccess, } from '../creditAgentViewReducer';
|
|
5
|
+
export const fetchCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCreditAgentMacro.match), withLatestFrom(state$), filter(([, state]) => state.creditAgentViewState.macro.fetchState !== 'In-Progress'), switchMap(() => {
|
|
6
6
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
|
|
7
7
|
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
8
|
-
if (isSuccessResponse(response)
|
|
9
|
-
return of(
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
|
+
return of(fetchCreditAgentMacroSuccess(response.data));
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
return of(
|
|
12
|
+
return of(fetchCreditAgentMacroFailure(response.status));
|
|
13
13
|
}
|
|
14
|
-
}), catchError((error) => of(
|
|
14
|
+
}), catchError((error) => of(fetchCreditAgentMacroFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
15
15
|
}));
|
|
@@ -5,14 +5,19 @@ import { saveCreditAgentMacro, saveCreditAgentMacroFailure, saveCreditAgentMacro
|
|
|
5
5
|
export const saveCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveCreditAgentMacro.match), switchMap((action) => {
|
|
6
6
|
const { instructions } = action.payload;
|
|
7
7
|
const existingMacro = state$.value.creditAgentViewState.macro.data;
|
|
8
|
+
// Fail fast if macro has not been loaded yet — avoids overwriting server-side
|
|
9
|
+
// name/description fields with empty defaults.
|
|
10
|
+
if (existingMacro == null) {
|
|
11
|
+
return of(saveCreditAgentMacroFailure(createZeniAPIStatus('Save failed', 'Cannot save macro: macro data has not been loaded yet.')));
|
|
12
|
+
}
|
|
8
13
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
|
|
9
14
|
const body = {
|
|
10
15
|
instructions,
|
|
11
|
-
name: existingMacro
|
|
12
|
-
description: existingMacro
|
|
16
|
+
name: existingMacro.name,
|
|
17
|
+
description: existingMacro.description,
|
|
13
18
|
};
|
|
14
19
|
return zeniAPI.putAndGetJSON(url, body).pipe(mergeMap((response) => {
|
|
15
|
-
if (isSuccessResponse(response)
|
|
20
|
+
if (isSuccessResponse(response)) {
|
|
16
21
|
return of(saveCreditAgentMacroSuccess(response.data));
|
|
17
22
|
}
|
|
18
23
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { updateCardProfile,
|
|
4
|
+
import { updateCardProfile, updateCardProfileFailure, updateCardProfileSuccess, mapCardTenantProfileRowPayload, } from '../creditAgentViewReducer';
|
|
5
5
|
export const updateCardProfileEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateCardProfile.match), switchMap((action) => {
|
|
6
6
|
const { tenantNamespace, update } = action.payload;
|
|
7
7
|
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/card-tenant-profiles`;
|
|
@@ -23,19 +23,13 @@ export const updateCardProfileEpic = (actions$, _state$, zeniAPI) => actions$.pi
|
|
|
23
23
|
return zeniAPI.putAndGetJSON(url, body).pipe(mergeMap((response) => {
|
|
24
24
|
if (isSuccessResponse(response) && response.data?.profile != null) {
|
|
25
25
|
const mapped = mapCardTenantProfileRowPayload(response.data.profile);
|
|
26
|
-
return of(
|
|
27
|
-
profile:
|
|
28
|
-
cardStatus: mapped.cardStatus,
|
|
29
|
-
creditLimit: mapped.creditLimit,
|
|
30
|
-
updatedByName: mapped.updatedByName,
|
|
31
|
-
updatedByUserId: mapped.updatedByUserId,
|
|
32
|
-
updatedOn: mapped.updatedOn,
|
|
33
|
-
},
|
|
26
|
+
return of(updateCardProfileSuccess({
|
|
27
|
+
profile: mapped,
|
|
34
28
|
tenantNamespace,
|
|
35
29
|
}));
|
|
36
30
|
}
|
|
37
31
|
else {
|
|
38
|
-
return of(
|
|
32
|
+
return of(updateCardProfileFailure(response.status));
|
|
39
33
|
}
|
|
40
|
-
}), catchError((error) => of(
|
|
34
|
+
}), catchError((error) => of(updateCardProfileFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
41
35
|
}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { changeAccountKey } from '../../../../entity/account/accountReducer';
|
|
4
|
+
import { getAccountKey } from '../../../../entity/account/accountState';
|
|
5
|
+
import { getAccountReconByAccountIdAndSelectedPeriod } from '../../../../entity/accountRecon/accountReconSelector';
|
|
6
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
8
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
9
|
+
import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess, } from '../../reducers/reconciliationViewReducer';
|
|
10
|
+
export const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(excludeAccountFromReconciliation.match), mergeMap((action) => {
|
|
11
|
+
const { accountId } = action.payload;
|
|
12
|
+
const state = state$.value;
|
|
13
|
+
const currentTenant = getCurrentTenant(state);
|
|
14
|
+
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
15
|
+
const reconciliationData = getAccountReconByAccountIdAndSelectedPeriod(state, accountId, selectedPeriod);
|
|
16
|
+
const payload = {
|
|
17
|
+
account_id: accountId,
|
|
18
|
+
bank_balance: reconciliationData?.balance?.amount ?? null,
|
|
19
|
+
cleared_balance: reconciliationData?.clearedBalance?.amount ?? null,
|
|
20
|
+
variance: reconciliationData?.variance?.amount ?? null,
|
|
21
|
+
};
|
|
22
|
+
const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`;
|
|
23
|
+
return zeniAPI
|
|
24
|
+
.postAndGetJSON(apiUrl, payload)
|
|
25
|
+
.pipe(mergeMap((response) => {
|
|
26
|
+
if (isSuccessResponse(response)) {
|
|
27
|
+
const newAccountKey = getAccountKey('excluded_account_reconciliation', accountId);
|
|
28
|
+
const oldAccountKey = getAccountKey('account_reconciliation', accountId);
|
|
29
|
+
return of(excludeAccountFromReconciliationSuccess({
|
|
30
|
+
account: response.data?.excluded_account ?? undefined,
|
|
31
|
+
selectedPeriod,
|
|
32
|
+
}), changeAccountKey({
|
|
33
|
+
oldKey: oldAccountKey,
|
|
34
|
+
newKey: newAccountKey,
|
|
35
|
+
}), openSnackbar({
|
|
36
|
+
messageSection: 'account_excluded_from_reconciliation',
|
|
37
|
+
messageText: 'success',
|
|
38
|
+
type: 'success',
|
|
39
|
+
variables: [
|
|
40
|
+
{
|
|
41
|
+
variableName: '_account-name_',
|
|
42
|
+
variableValue: reconciliationData?.account.accountName ?? '',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return of(excludeAccountFromReconciliationFailure({
|
|
49
|
+
error: response.status,
|
|
50
|
+
}), openSnackbar({
|
|
51
|
+
messageSection: 'account_excluded_from_reconciliation',
|
|
52
|
+
messageText: 'failed',
|
|
53
|
+
type: 'error',
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
}), catchError((error) => of(excludeAccountFromReconciliationFailure({
|
|
57
|
+
error: createZeniAPIStatus('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
|
|
58
|
+
}), openSnackbar({
|
|
59
|
+
messageSection: 'account_excluded_from_reconciliation',
|
|
60
|
+
messageText: 'failed',
|
|
61
|
+
type: 'error',
|
|
62
|
+
}))));
|
|
63
|
+
}));
|
package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js
CHANGED
|
@@ -53,22 +53,17 @@ export const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => action
|
|
|
53
53
|
return zeniAPI.getJSON(apiUrl).pipe(mergeMap((response) => {
|
|
54
54
|
if (isSuccessResponse(response) && response.data != null) {
|
|
55
55
|
const updateActions = [];
|
|
56
|
-
|
|
57
|
-
updateActions.push(updateAllUsers({
|
|
56
|
+
const allTransactionsPerRecon = getAllReviewTransactionsFromReconcilePayload(response.data.reconciliation);
|
|
57
|
+
updateActions.push(updateAccounts(response.data.accounts, 'account_reconciliation'), updateAccounts(response.data.excluded_accounts ?? [], 'excluded_account_reconciliation'), updateAllUsers({
|
|
58
58
|
users: response.data.users ?? [],
|
|
59
59
|
updateType: 'merge',
|
|
60
|
-
}));
|
|
61
|
-
updateActions.push(updateFiles({ files: response.data.files ?? [] }));
|
|
62
|
-
const allTransactionsPerRecon = getAllReviewTransactionsFromReconcilePayload(response.data.reconciliation);
|
|
63
|
-
updateActions.push(updateMultipleReconcileTransactions(allTransactionsPerRecon, 'merge'));
|
|
64
|
-
updateActions.push(updateAccountRecon(selectedPeriod, response.data.reconciliation));
|
|
60
|
+
}), updateFiles({ files: response.data.files ?? [] }), updateMultipleReconcileTransactions(allTransactionsPerRecon, 'merge'), updateAccountRecon(selectedPeriod, response.data.reconciliation));
|
|
65
61
|
const reviewTabLocalData = prepareReviewTabLocalData(response.data.reconciliation[0]?.transactions?.review ?? []);
|
|
66
62
|
if (accountId != null) {
|
|
67
63
|
const selectedTransactionIds = getTransactionIdFromCheckedMatchedTransactionPayload(response.data.reconciliation[0].transactions.reconcile);
|
|
68
64
|
updateActions.push(updateReconcileTabLocalData({
|
|
69
65
|
selectedTransactionIds: selectedTransactionIds,
|
|
70
|
-
}));
|
|
71
|
-
updateActions.push(initializeReconciliationReviewTabLocalData(reviewTabLocalData));
|
|
66
|
+
}), initializeReconciliationReviewTabLocalData(reviewTabLocalData));
|
|
72
67
|
}
|
|
73
68
|
updateActions.push(fetchReconciliationSuccess(selectedPeriod, response.data, refreshViewInBackground, accountId));
|
|
74
69
|
return from(updateActions);
|
package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { convertToPeriod } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { changeAccountKey } from '../../../../entity/account/accountReducer';
|
|
5
|
+
import { getAccountBase } from '../../../../entity/account/accountSelector';
|
|
6
|
+
import { getAccountKey } from '../../../../entity/account/accountState';
|
|
7
|
+
import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
|
|
8
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
10
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
11
|
+
import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess, } from '../../reducers/reconciliationViewReducer';
|
|
12
|
+
export const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(includeAccountInReconciliation.match), mergeMap((action) => {
|
|
13
|
+
const { accountId } = action.payload;
|
|
14
|
+
const state = state$.value;
|
|
15
|
+
const currentTenant = getCurrentTenant(state);
|
|
16
|
+
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
17
|
+
const account = getAccountBase(state.accountState, accountId, 'excluded_account_reconciliation');
|
|
18
|
+
const period = convertToPeriod(selectedPeriod, true);
|
|
19
|
+
const query = JSON.stringify({
|
|
20
|
+
start_date: period.start,
|
|
21
|
+
end_date: period.end,
|
|
22
|
+
});
|
|
23
|
+
const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
|
|
24
|
+
return zeniAPI
|
|
25
|
+
.deleteAndGetJSON(apiUrl)
|
|
26
|
+
.pipe(mergeMap((response) => {
|
|
27
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
28
|
+
const reconciliation = response.data.reconciliation;
|
|
29
|
+
const oldAccountKey = getAccountKey('excluded_account_reconciliation', reconciliation.account_id);
|
|
30
|
+
const newAccountKey = getAccountKey('account_reconciliation', reconciliation.account_id);
|
|
31
|
+
return of(updateAccountRecon(selectedPeriod, [reconciliation]), includeAccountInReconciliationSuccess({
|
|
32
|
+
reconciliation,
|
|
33
|
+
selectedPeriod,
|
|
34
|
+
}), changeAccountKey({
|
|
35
|
+
oldKey: oldAccountKey,
|
|
36
|
+
newKey: newAccountKey,
|
|
37
|
+
}), openSnackbar({
|
|
38
|
+
messageSection: 'account_included_in_reconciliation',
|
|
39
|
+
messageText: 'success',
|
|
40
|
+
type: 'success',
|
|
41
|
+
variables: [
|
|
42
|
+
{
|
|
43
|
+
variableName: '_account-name_',
|
|
44
|
+
variableValue: account?.accountName ?? '',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return of(includeAccountInReconciliationFailure({
|
|
51
|
+
error: response.status,
|
|
52
|
+
}), openSnackbar({
|
|
53
|
+
messageSection: 'account_included_in_reconciliation',
|
|
54
|
+
messageText: 'failed',
|
|
55
|
+
type: 'error',
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
}), catchError((error) => of(includeAccountInReconciliationFailure({
|
|
59
|
+
error: createZeniAPIStatus('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
|
|
60
|
+
}), openSnackbar({
|
|
61
|
+
messageSection: 'account_included_in_reconciliation',
|
|
62
|
+
messageText: 'failed',
|
|
63
|
+
type: 'error',
|
|
64
|
+
}))));
|
|
65
|
+
}));
|
|
@@ -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
|
],
|