@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,14 +1,14 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
|
-
import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
2
|
+
import { reduceAllFetchState, reduceAnyFetchState, } from '../../../commonStateTypes/reduceFetchState';
|
|
3
3
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
4
|
+
import { getIsAccountingClassesEnabled, getCurrentTenant, } from '../../../entity/tenant/tenantSelector';
|
|
5
5
|
import { getTransactionWithCOT } from '../../../entity/transaction/transactionHelper';
|
|
6
6
|
import { getSupportedTransactionsByIds } from '../../../entity/transaction/transactionSelector';
|
|
7
7
|
import { getAccountList, getNestedAccountListHierarchy, getUncategorizedAccounts, } from '../../accountList/accountListSelector';
|
|
8
8
|
import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
|
|
9
9
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
10
10
|
export function getExpenseAutomationTransactionView(state) {
|
|
11
|
-
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
11
|
+
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
12
12
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
13
13
|
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
14
14
|
const uncategorizedIncomeExpense = getUncategorizedAccounts(accountState, accountListState, 'accountList');
|
|
@@ -41,10 +41,20 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
41
41
|
.filter((transaction) => transaction != null);
|
|
42
42
|
const transactions = getSupportedTransactionsByIds(transactionState, transactionIds);
|
|
43
43
|
const transactionsWithCOT = transactions.map((transaction) => getTransactionWithCOT(transaction));
|
|
44
|
-
const
|
|
44
|
+
const monthEndFetchState = monthYearPeriodId != null
|
|
45
|
+
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
46
|
+
: { fetchState: 'Not-Started', error: undefined };
|
|
47
|
+
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
|
|
48
|
+
const allFetchStateList = [
|
|
45
49
|
accountList,
|
|
46
|
-
classList,
|
|
47
50
|
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
51
|
+
];
|
|
52
|
+
if (isAccountingClassesEnabled) {
|
|
53
|
+
allFetchStateList.push(classList);
|
|
54
|
+
}
|
|
55
|
+
const fetchStatus = reduceAnyFetchState([
|
|
56
|
+
reduceAllFetchState(allFetchStateList),
|
|
57
|
+
monthEndFetchState,
|
|
48
58
|
]);
|
|
49
59
|
const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
|
|
50
60
|
.uiState.totalCount;
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
const JE_SCHEDULE_SORT_KEYS = [
|
|
3
|
+
'vendor',
|
|
4
|
+
'category',
|
|
5
|
+
'class',
|
|
6
|
+
'depCategory',
|
|
7
|
+
'scheduleCategory',
|
|
8
|
+
'startMonth',
|
|
9
|
+
'type',
|
|
10
|
+
'amortizationPeriod',
|
|
11
|
+
'jePostingDate',
|
|
12
|
+
'remainingMonths',
|
|
13
|
+
'runningBalance',
|
|
14
|
+
'totalAmount',
|
|
15
|
+
'transactionDate',
|
|
16
|
+
'memo',
|
|
17
|
+
];
|
|
18
|
+
export const toJEScheduleSortKey = (v) => stringToUnion(v, JE_SCHEDULE_SORT_KEYS);
|
|
19
|
+
const JE_SCHEDULE_MAIN_TABS = [
|
|
20
|
+
'pending_review',
|
|
21
|
+
'ongoing',
|
|
22
|
+
'completed',
|
|
23
|
+
];
|
|
24
|
+
export const toJEScheduleMainTab = (v) => stringToUnion(v, JE_SCHEDULE_MAIN_TABS);
|
|
@@ -9,8 +9,10 @@ import { extractThisPeriod } from '../../commonStateTypes/viewAndReport/thisPeri
|
|
|
9
9
|
import { getBalanceSheet } from '../balanceSheet/balanceSheetSelector';
|
|
10
10
|
import { getCashFlow } from '../cashFlow/cashFlowSelector';
|
|
11
11
|
import { getProfitAndLossReport, } from '../profitAndLoss/profitAndLossSelector';
|
|
12
|
+
import { newBalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
12
13
|
import { getProfitAndLossClassesHorizontalView } from '../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
13
14
|
import { getProfitAndLossClassesView } from '../profitAndLossClassesView/profitAndLossClassesViewSelector';
|
|
15
|
+
import { getProfitAndLossProjectView } from '../profitAndLossProjectView/profitAndLossProjectViewSelector';
|
|
14
16
|
function getDateRangeForFinanceReports(profitAndLossState, balanceSheetState, cashFlowState) {
|
|
15
17
|
const datesSorted = [
|
|
16
18
|
profitAndLossState.dataAvailable?.startDate,
|
|
@@ -35,7 +37,7 @@ function getFirstMonthOfFY(profitAndLossState, balanceSheetState, cashFlowState)
|
|
|
35
37
|
cashFlowState.firstMonthOfFY ??
|
|
36
38
|
1);
|
|
37
39
|
}
|
|
38
|
-
export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.balanceSheetState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, balanceSheetState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
40
|
+
export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
39
41
|
// to get min and max dates across three reports
|
|
40
42
|
let allTimeframeTicks = [];
|
|
41
43
|
let balancesInTimeframe = [];
|
|
@@ -69,6 +71,8 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
69
71
|
const profitAndLossReport = getProfitAndLossReport(filter, undefined, accountState, accountGroupState, sectionAccountsViewState, profitAndLossState, forecastState);
|
|
70
72
|
const classFilter = newBalancesFilterClassesView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, profitAndLossClassesViewState.uiState.classesToFilterOut);
|
|
71
73
|
const profitAndLossByClassReport = getProfitAndLossClassesView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState);
|
|
74
|
+
const projectFilter = newBalancesFilterProjectView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, profitAndLossProjectViewState.uiState.projectsToFilterOut);
|
|
75
|
+
const profitAndLossByProjectReport = getProfitAndLossProjectView(projectFilter, accountState, projectState, sectionProjectViewState, profitAndLossProjectViewState);
|
|
72
76
|
const profitAndLossByClassHorizontalReport = getProfitAndLossClassesHorizontalView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState, profitAndLossClassesViewState.uiState.classViewLayout === 'horizontal'
|
|
73
77
|
? thisPeriod
|
|
74
78
|
: undefined);
|
|
@@ -89,6 +93,12 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
89
93
|
error: profitAndLossReport.error,
|
|
90
94
|
};
|
|
91
95
|
break;
|
|
96
|
+
case 'profit_and_loss_by_projects':
|
|
97
|
+
selectedReportAndTimeframeFetchState = {
|
|
98
|
+
fetchState: profitAndLossByProjectReport.fetchState,
|
|
99
|
+
error: profitAndLossByProjectReport.error,
|
|
100
|
+
};
|
|
101
|
+
break;
|
|
92
102
|
case 'balance_sheet':
|
|
93
103
|
selectedReportAndTimeframeFetchState = {
|
|
94
104
|
fetchState: balanceSheetReport.fetchState,
|
|
@@ -119,6 +129,7 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
119
129
|
dataAvailable,
|
|
120
130
|
profitAndLossReport,
|
|
121
131
|
profitAndLossByClassReport,
|
|
132
|
+
profitAndLossByProjectReport,
|
|
122
133
|
profitAndLossByClassHorizontalReport,
|
|
123
134
|
balanceSheetReport,
|
|
124
135
|
cashFlowReport,
|
package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js
CHANGED
|
@@ -3,6 +3,7 @@ import { getSummationFreeRangeTotalBalance } from '../../commonStateTypes/coaBal
|
|
|
3
3
|
import { defaultCustomerCurrency } from '../../commonStateTypes/currencyHelper';
|
|
4
4
|
import { reduceFetchStateParallelTimeframes } from '../../commonStateTypes/reduceFetchState';
|
|
5
5
|
import { getSectionClassesViewReport } from '../../entity/sectionClassesViewV2/sectionClassesViewSelector';
|
|
6
|
+
import { HORIZONTAL_CLASS_TOTAL_BALANCE_ID, } from './profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
6
7
|
import { enrichProfitAndLossByClassHorizontalReport } from './profitAndLossHorizontalEnrichment';
|
|
7
8
|
/** Standard class ID returned by the accounting platform for transactions without an assigned class. */
|
|
8
9
|
export const NOT_SPECIFIED_CLASS_ID = 'not_specified';
|
|
@@ -317,6 +318,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
|
|
|
317
318
|
startDate,
|
|
318
319
|
type: 'default',
|
|
319
320
|
label: col.className,
|
|
321
|
+
id: col.classId,
|
|
320
322
|
}));
|
|
321
323
|
// Add a "Total" column
|
|
322
324
|
balances.push({
|
|
@@ -326,6 +328,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
|
|
|
326
328
|
startDate,
|
|
327
329
|
type: 'default',
|
|
328
330
|
label: 'Total',
|
|
331
|
+
id: HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
|
|
329
332
|
});
|
|
330
333
|
return balances;
|
|
331
334
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { updateProjects } from '../../entity/project/projectReducer';
|
|
4
|
+
import { updateSectionProjectView } from '../../entity/sectionProjectView/sectionProjectViewReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
|
|
6
|
+
import { fetchProfitAndLossForTimeframeProjectView, updateProfitAndLossForTimeframeProjectView, updateProfitAndLossForTimeframeProjectViewFailure, } from './profitAndLossProjectViewReducer';
|
|
7
|
+
export const fetchProfitAndLossForTimeframeProjectViewEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(fetchProfitAndLossForTimeframeProjectView.match), mergeMap((action) => {
|
|
8
|
+
const getTimeSeriesGroup = (timeframe) => {
|
|
9
|
+
switch (timeframe) {
|
|
10
|
+
case 'month':
|
|
11
|
+
return 'months';
|
|
12
|
+
case 'quarter':
|
|
13
|
+
return 'quarters';
|
|
14
|
+
case 'year':
|
|
15
|
+
return 'years';
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const queryValue = {
|
|
19
|
+
is_full_response: action.payload.fetchFullReport,
|
|
20
|
+
time_series_groups: [getTimeSeriesGroup(action.payload.timeframe)],
|
|
21
|
+
is_group_by_project: true,
|
|
22
|
+
};
|
|
23
|
+
return zeniAPI
|
|
24
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/2.0/reports/profit_and_loss?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
25
|
+
.pipe(mergeMap((response) => {
|
|
26
|
+
if (response.data != null && isSuccessResponse(response)) {
|
|
27
|
+
const actions = [];
|
|
28
|
+
const report = response.data.report;
|
|
29
|
+
const currency = report.currency;
|
|
30
|
+
actions.push(updateProjects(report.projects));
|
|
31
|
+
actions.push(updateSectionProjectView(action.payload.timeframe, 'cogs', 'profit_and_loss_by_projects', report.cogs, report.accounts, currency));
|
|
32
|
+
actions.push(updateSectionProjectView(action.payload.timeframe, 'expenses', 'profit_and_loss_by_projects', report.expenses, report.accounts, currency));
|
|
33
|
+
actions.push(updateSectionProjectView(action.payload.timeframe, 'income', 'profit_and_loss_by_projects', report.income, report.accounts, currency));
|
|
34
|
+
actions.push(updateSectionProjectView(action.payload.timeframe, 'otherExpenses', 'profit_and_loss_by_projects', report.other_expenses, report.accounts, currency));
|
|
35
|
+
actions.push(updateSectionProjectView(action.payload.timeframe, 'otherIncome', 'profit_and_loss_by_projects', report.other_income, report.accounts, currency));
|
|
36
|
+
actions.push(updateProfitAndLossForTimeframeProjectView({
|
|
37
|
+
timeframe: action.payload.timeframe,
|
|
38
|
+
report: response.data,
|
|
39
|
+
}));
|
|
40
|
+
return from(actions);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return of(updateProfitAndLossForTimeframeProjectViewFailure(response.status, action.payload.timeframe));
|
|
44
|
+
}
|
|
45
|
+
}), catchError((error) => of(updateProfitAndLossForTimeframeProjectViewFailure(createZeniAPIStatus('Unexpected Error', 'P&L by Projects REST API call errored out' +
|
|
46
|
+
JSON.stringify(error)), action.payload.timeframe))));
|
|
47
|
+
}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { filter, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { fetchProfitAndLossForTimeframeProjectView, fetchProfitAndLossProjectView, } from './profitAndLossProjectViewReducer';
|
|
4
|
+
export const fetchProfitAndLossProjectViewEpic = (actions$, state) => actions$.pipe(filter(fetchProfitAndLossProjectView.match), switchMap((action) => {
|
|
5
|
+
const { cacheOverride } = action.payload;
|
|
6
|
+
if (cacheOverride === true) {
|
|
7
|
+
return from([
|
|
8
|
+
fetchProfitAndLossForTimeframeProjectView('month'),
|
|
9
|
+
fetchProfitAndLossForTimeframeProjectView('quarter'),
|
|
10
|
+
fetchProfitAndLossForTimeframeProjectView('year'),
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
const fetchActions = [];
|
|
15
|
+
const projectFetchState = state.value.profitAndLossProjectViewState.fetchState;
|
|
16
|
+
if (projectFetchState['month'].fetchState !== 'In-Progress' &&
|
|
17
|
+
projectFetchState['month'].fetchState !== 'Completed') {
|
|
18
|
+
fetchActions.push(fetchProfitAndLossForTimeframeProjectView('month'));
|
|
19
|
+
}
|
|
20
|
+
if (projectFetchState['quarter'].fetchState !== 'In-Progress' &&
|
|
21
|
+
projectFetchState['quarter'].fetchState !== 'Completed') {
|
|
22
|
+
fetchActions.push(fetchProfitAndLossForTimeframeProjectView('quarter'));
|
|
23
|
+
}
|
|
24
|
+
if (projectFetchState['year'].fetchState !== 'In-Progress' &&
|
|
25
|
+
projectFetchState['year'].fetchState !== 'Completed') {
|
|
26
|
+
fetchActions.push(fetchProfitAndLossForTimeframeProjectView('year'));
|
|
27
|
+
}
|
|
28
|
+
return from(fetchActions);
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { mapReportPayloadV2ToReportV2 } from '../../commonPayloadTypes/v2/viewAndReportPayloadv2';
|
|
3
|
+
export const initialState = {
|
|
4
|
+
bookCloseDate: undefined,
|
|
5
|
+
fetchState: {
|
|
6
|
+
month: {
|
|
7
|
+
fetchState: 'Not-Started',
|
|
8
|
+
error: undefined,
|
|
9
|
+
},
|
|
10
|
+
quarter: {
|
|
11
|
+
fetchState: 'Not-Started',
|
|
12
|
+
error: undefined,
|
|
13
|
+
},
|
|
14
|
+
year: {
|
|
15
|
+
fetchState: 'Not-Started',
|
|
16
|
+
error: undefined,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
firstMonthOfFY: 1,
|
|
20
|
+
projectIds: [],
|
|
21
|
+
reportId: 'profit_and_loss_by_projects',
|
|
22
|
+
reportTitle: 'profit_and_loss_by_projects',
|
|
23
|
+
uiState: {
|
|
24
|
+
accountViewMode: 'project',
|
|
25
|
+
nodeCollapseState: {},
|
|
26
|
+
projectsToFilterOut: [],
|
|
27
|
+
scrollPosition: undefined,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const profitAndLossProjectView = createSlice({
|
|
31
|
+
name: 'profitAndLossProjectView',
|
|
32
|
+
initialState,
|
|
33
|
+
reducers: {
|
|
34
|
+
fetchProfitAndLossProjectView: {
|
|
35
|
+
prepare(cacheOverride = false) {
|
|
36
|
+
return { payload: { cacheOverride } };
|
|
37
|
+
},
|
|
38
|
+
reducer(
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40
|
+
_draft,
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
+
_action) {
|
|
43
|
+
// nothing to do here
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
fetchProfitAndLossForTimeframeProjectView: {
|
|
47
|
+
prepare(timeframe, fetchFullReport = true, cacheOverride = false) {
|
|
48
|
+
return { payload: { timeframe, fetchFullReport, cacheOverride } };
|
|
49
|
+
},
|
|
50
|
+
reducer(draft, action) {
|
|
51
|
+
const timeframe = action.payload.timeframe;
|
|
52
|
+
draft.fetchState[timeframe].fetchState = 'In-Progress';
|
|
53
|
+
draft.fetchState[timeframe].error = undefined;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
updateProfitAndLossForTimeframeProjectView(draft, action) {
|
|
57
|
+
doUpdateProfitAndLossProjectView(draft, action.payload.timeframe, action.payload.report);
|
|
58
|
+
},
|
|
59
|
+
updateProfitAndLossForTimeframeProjectViewFailure: {
|
|
60
|
+
prepare(error, timeframe) {
|
|
61
|
+
return {
|
|
62
|
+
payload: {
|
|
63
|
+
error,
|
|
64
|
+
timeframe,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
reducer(draft, action) {
|
|
69
|
+
draft.fetchState[action.payload.timeframe] = {
|
|
70
|
+
fetchState: 'Error',
|
|
71
|
+
error: action.payload.error,
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
updateProjectsToFilterOut(draft, action) {
|
|
76
|
+
draft.uiState.projectsToFilterOut = action.payload.projectsToFilterOut;
|
|
77
|
+
},
|
|
78
|
+
updateProfitAndLossProjectViewUIState(draft, action) {
|
|
79
|
+
const { nodeCollapseState, scrollPosition } = action.payload;
|
|
80
|
+
if (nodeCollapseState != null) {
|
|
81
|
+
draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
|
|
82
|
+
[nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (scrollPosition != null) {
|
|
86
|
+
draft.uiState.scrollPosition = scrollPosition;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
updateProjectViewAccountViewMode(draft, action) {
|
|
90
|
+
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
91
|
+
},
|
|
92
|
+
resetProfitAndLossProjectNodeCollapseState(draft) {
|
|
93
|
+
draft.uiState.nodeCollapseState = {};
|
|
94
|
+
},
|
|
95
|
+
clearProfitAndLossProjectView(draft) {
|
|
96
|
+
Object.assign(draft, initialState);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
export const { fetchProfitAndLossProjectView, fetchProfitAndLossForTimeframeProjectView, updateProfitAndLossForTimeframeProjectView, updateProfitAndLossForTimeframeProjectViewFailure, updateProjectsToFilterOut, updateProfitAndLossProjectViewUIState, updateProjectViewAccountViewMode, resetProfitAndLossProjectNodeCollapseState, clearProfitAndLossProjectView, } = profitAndLossProjectView.actions;
|
|
101
|
+
export default profitAndLossProjectView.reducer;
|
|
102
|
+
const doUpdateProfitAndLossProjectView = (draft, timeframe, pandLReport) => {
|
|
103
|
+
const report = mapReportPayloadV2ToReportV2(pandLReport.report);
|
|
104
|
+
draft.currency = report.currency;
|
|
105
|
+
draft.dataAvailable = report.dataAvailable;
|
|
106
|
+
draft.firstMonthOfFY = report.firstMonthOfFY;
|
|
107
|
+
draft.bookCloseDate = report.bookCloseDate;
|
|
108
|
+
draft.status = report.status;
|
|
109
|
+
draft.fetchState[timeframe].fetchState = 'Completed';
|
|
110
|
+
if (draft.projectIds.length <= 0) {
|
|
111
|
+
draft.projectIds = pandLReport.report.projects.map((project) => project.zeni_project_id);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getDifferenceOfBalancesGroupedByPeriod } from '../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod';
|
|
2
|
+
import { getSumOfBalancesByGroupedByPeriod } from '../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod';
|
|
3
|
+
import { getCOABalances } from '../../commonStateTypes/coaBalance/coaBalance';
|
|
4
|
+
import { reduceFetchStateParallelTimeframes } from '../../commonStateTypes/reduceFetchState';
|
|
5
|
+
import { getProjectsByIds } from '../../entity/project/projectSelector';
|
|
6
|
+
import { getSectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelector';
|
|
7
|
+
import { ALL_PANDL_REPORT_VIEW_SECTION_IDS, } from '../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
|
|
8
|
+
export const profitAndLossProjectIdsInOrder = [
|
|
9
|
+
'income',
|
|
10
|
+
'cogs',
|
|
11
|
+
'grossProfit',
|
|
12
|
+
'expenses',
|
|
13
|
+
'earningsBeforeInterestAndTax',
|
|
14
|
+
'otherIncome',
|
|
15
|
+
'otherExpenses',
|
|
16
|
+
'netOtherIncome',
|
|
17
|
+
'netIncome',
|
|
18
|
+
];
|
|
19
|
+
export const getProfitAndLossProjectView = (filter, accountState, projectState, sectionsState, profitAndLossProjectViewState) => {
|
|
20
|
+
const fetchState = reduceFetchStateParallelTimeframes([
|
|
21
|
+
profitAndLossProjectViewState.fetchState.month,
|
|
22
|
+
profitAndLossProjectViewState.fetchState.quarter,
|
|
23
|
+
profitAndLossProjectViewState.fetchState.year,
|
|
24
|
+
]);
|
|
25
|
+
const reportId = 'profit_and_loss_by_projects';
|
|
26
|
+
const sections = {};
|
|
27
|
+
const calculatedSections = {};
|
|
28
|
+
if (fetchState.fetchState === 'Completed') {
|
|
29
|
+
ALL_PANDL_REPORT_VIEW_SECTION_IDS.forEach((sectionId) => {
|
|
30
|
+
sections[`${sectionId}`] = getSectionProjectViewReport(accountState, projectState, sectionsState, profitAndLossProjectViewState.projectIds, {
|
|
31
|
+
reportId,
|
|
32
|
+
sectionId,
|
|
33
|
+
}, filter);
|
|
34
|
+
});
|
|
35
|
+
const grossProfitBalancesByPeriod = getDifferenceOfBalancesGroupedByPeriod(sections['income'].sectionBalancesTotalByPeriod, sections['cogs'].sectionBalancesTotalByPeriod);
|
|
36
|
+
calculatedSections['grossProfit'] = getCOABalances(grossProfitBalancesByPeriod, filter);
|
|
37
|
+
const ebitBalancesByPeriod = getDifferenceOfBalancesGroupedByPeriod(grossProfitBalancesByPeriod, sections['expenses'].sectionBalancesTotalByPeriod);
|
|
38
|
+
calculatedSections['earningsBeforeInterestAndTax'] = getCOABalances(ebitBalancesByPeriod, filter);
|
|
39
|
+
const netOtherIncomeBalances = getDifferenceOfBalancesGroupedByPeriod(sections['otherIncome'].sectionBalancesTotalByPeriod, sections['otherExpenses'].sectionBalancesTotalByPeriod);
|
|
40
|
+
calculatedSections['netOtherIncome'] = getCOABalances(netOtherIncomeBalances, filter);
|
|
41
|
+
const netIncomeBalances = getSumOfBalancesByGroupedByPeriod([
|
|
42
|
+
ebitBalancesByPeriod,
|
|
43
|
+
netOtherIncomeBalances,
|
|
44
|
+
]);
|
|
45
|
+
calculatedSections['netIncome'] = getCOABalances(netIncomeBalances, filter);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
sections,
|
|
49
|
+
calculatedSections,
|
|
50
|
+
reportId: profitAndLossProjectViewState.reportId,
|
|
51
|
+
reportTitle: profitAndLossProjectViewState.reportTitle,
|
|
52
|
+
firstMonthOfFY: profitAndLossProjectViewState.firstMonthOfFY,
|
|
53
|
+
dataAvailable: profitAndLossProjectViewState.dataAvailable,
|
|
54
|
+
bookCloseDate: profitAndLossProjectViewState.bookCloseDate,
|
|
55
|
+
version: profitAndLossProjectViewState.version,
|
|
56
|
+
status: profitAndLossProjectViewState.status,
|
|
57
|
+
fetchState: fetchState.fetchState,
|
|
58
|
+
error: fetchState.error,
|
|
59
|
+
filter,
|
|
60
|
+
uiState: profitAndLossProjectViewState.uiState,
|
|
61
|
+
projects: getProjectsByIds(projectState, profitAndLossProjectViewState.projectIds),
|
|
62
|
+
projectsToFilterOut: profitAndLossProjectViewState.uiState.projectsToFilterOut,
|
|
63
|
+
idsInOrder: profitAndLossProjectIdsInOrder,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { filter, switchMap } from 'rxjs/operators';
|
|
|
3
3
|
import { fetchNetBurnOrIncomeClassesView } from '../netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer';
|
|
4
4
|
import { fetchOpExClassesView } from '../opExClassesView/opExClassesViewReducer';
|
|
5
5
|
import { fetchProfitAndLossClassesView } from '../profitAndLossClassesView/profitAndLossClassesViewReducer';
|
|
6
|
+
import { fetchProfitAndLossProjectView } from '../profitAndLossProjectView/profitAndLossProjectViewReducer';
|
|
6
7
|
import { fetchRevenueClassesView } from '../revenueClassesView/revenueClassesViewReducer';
|
|
7
8
|
import { initiateReportsClassViewRefetching } from './reportsResyncReducer';
|
|
8
9
|
export const initiateReportsClassViewRefetchingEpic = (actions$,
|
|
@@ -23,6 +24,9 @@ _) => actions$.pipe(filter(initiateReportsClassViewRefetching.match), switchMap(
|
|
|
23
24
|
case 'net_burn_or_income_by_classes':
|
|
24
25
|
actions.push(fetchNetBurnOrIncomeClassesView(true));
|
|
25
26
|
break;
|
|
27
|
+
case 'profit_and_loss_by_projects':
|
|
28
|
+
actions.push(fetchProfitAndLossProjectView(true));
|
|
29
|
+
break;
|
|
26
30
|
default:
|
|
27
31
|
break;
|
|
28
32
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { date } from '../../../zeniDayJS';
|
|
2
|
+
export const mapPayloadToAutoTransferRule = (payload) => ({
|
|
3
|
+
amount: payload.amount,
|
|
4
|
+
autoTransferRuleId: payload.auto_transfer_rule_id,
|
|
5
|
+
createTime: payload.create_time != null ? date(payload.create_time) : undefined,
|
|
6
|
+
currencyCode: payload.currency_code,
|
|
7
|
+
currencySymbol: payload.currency_symbol ?? '$',
|
|
8
|
+
destinationBankAccountId: payload.destination_bank_account_id,
|
|
9
|
+
destinationBankAccountMetadata: payload.destination_bank_account_metadata?.map((m) => ({
|
|
10
|
+
accountId: m.account_id,
|
|
11
|
+
accountType: m.account_type,
|
|
12
|
+
percentage: m.percentage,
|
|
13
|
+
})) ?? undefined,
|
|
14
|
+
destinationBankAccountType: payload.destination_bank_account_type ?? undefined,
|
|
15
|
+
frequency: payload.frequency,
|
|
16
|
+
isActive: payload.is_active,
|
|
17
|
+
isDeleted: payload.is_deleted,
|
|
18
|
+
lastRunTime: payload.last_run_time,
|
|
19
|
+
nextTransferDate: payload.next_transfer_date != null
|
|
20
|
+
? date(payload.next_transfer_date)
|
|
21
|
+
: undefined,
|
|
22
|
+
ruleType: payload.rule_type,
|
|
23
|
+
sourceBankAccountId: payload.source_bank_account_id,
|
|
24
|
+
sourceBankAccountType: payload.source_bank_account_type,
|
|
25
|
+
updateTime: payload.update_time != null ? date(payload.update_time) : undefined,
|
|
26
|
+
});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import recordGet from 'lodash/get';
|
|
3
|
+
import { initialCommonHistory } from '../commonHistoryView/commonHistory';
|
|
4
|
+
import { toHistoricEvent, } from '../commonHistoryView/commonHistoryPayload';
|
|
5
|
+
import { mapReviewTransferMoneyPayloadToReviewTransferMoney, } from '../zeniAccounts/transferDetail/transferDetailPayload';
|
|
6
|
+
export const initialState = {
|
|
7
|
+
autoTransferReviewDetail: {
|
|
8
|
+
reviewTransferMoney: {
|
|
9
|
+
isShowDailyAchLimitWarning: false,
|
|
10
|
+
dailyAchDebitLimit: {
|
|
11
|
+
amount: 0,
|
|
12
|
+
currencyCode: 'USD',
|
|
13
|
+
currencySymbol: '$',
|
|
14
|
+
},
|
|
15
|
+
transferSchedules: [],
|
|
16
|
+
},
|
|
17
|
+
fetchState: 'Not-Started',
|
|
18
|
+
error: undefined,
|
|
19
|
+
},
|
|
20
|
+
historyByRuleId: {},
|
|
21
|
+
ruleDeleteStatusById: {},
|
|
22
|
+
ruleUpdateLocalData: {},
|
|
23
|
+
ruleUpdateStatusById: {},
|
|
24
|
+
rules: [],
|
|
25
|
+
fetchState: 'Not-Started',
|
|
26
|
+
error: undefined,
|
|
27
|
+
createRuleFetchState: {
|
|
28
|
+
fetchState: 'Not-Started',
|
|
29
|
+
error: undefined,
|
|
30
|
+
},
|
|
31
|
+
hasValidState() {
|
|
32
|
+
return this.fetchState === 'Completed';
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const autotransferRules = createSlice({
|
|
36
|
+
name: 'autotransferRules',
|
|
37
|
+
initialState,
|
|
38
|
+
reducers: {
|
|
39
|
+
fetchAutoTransferRules: {
|
|
40
|
+
reducer(draft) {
|
|
41
|
+
draft.fetchState = 'In-Progress';
|
|
42
|
+
},
|
|
43
|
+
prepare(cacheOverride = false) {
|
|
44
|
+
return {
|
|
45
|
+
payload: {
|
|
46
|
+
cacheOverride,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
updateAutoTransferRules(draft, action) {
|
|
52
|
+
draft.rules = action.payload.rules;
|
|
53
|
+
draft.fetchState = 'Completed';
|
|
54
|
+
draft.error = undefined;
|
|
55
|
+
},
|
|
56
|
+
updateAutoTransferRulesFailure(draft, action) {
|
|
57
|
+
draft.fetchState = action.payload.fetchState;
|
|
58
|
+
draft.error = action.payload.error;
|
|
59
|
+
},
|
|
60
|
+
updateRuleLocalData(draft, action) {
|
|
61
|
+
draft.ruleUpdateLocalData = {
|
|
62
|
+
...draft.ruleUpdateLocalData,
|
|
63
|
+
...action.payload,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
clearRuleUpdateLocalData(draft) {
|
|
67
|
+
draft.ruleUpdateLocalData = {};
|
|
68
|
+
},
|
|
69
|
+
fetchAutoTransferReviewDetail(draft) {
|
|
70
|
+
draft.autoTransferReviewDetail.fetchState = 'In-Progress';
|
|
71
|
+
draft.autoTransferReviewDetail.error = undefined;
|
|
72
|
+
},
|
|
73
|
+
updateAutoTransferReviewDetail(draft, action) {
|
|
74
|
+
draft.autoTransferReviewDetail.fetchState = 'Completed';
|
|
75
|
+
draft.autoTransferReviewDetail.error = undefined;
|
|
76
|
+
draft.autoTransferReviewDetail.reviewTransferMoney =
|
|
77
|
+
mapReviewTransferMoneyPayloadToReviewTransferMoney(action.payload);
|
|
78
|
+
},
|
|
79
|
+
updateAutoTransferReviewDetailFailure(draft, action) {
|
|
80
|
+
draft.autoTransferReviewDetail.fetchState = 'Error';
|
|
81
|
+
draft.autoTransferReviewDetail.error = action.payload;
|
|
82
|
+
},
|
|
83
|
+
clearAutoTransferReviewDetail(draft) {
|
|
84
|
+
draft.autoTransferReviewDetail = initialState.autoTransferReviewDetail;
|
|
85
|
+
},
|
|
86
|
+
createAutoTransferRule(draft) {
|
|
87
|
+
draft.createRuleFetchState = {
|
|
88
|
+
fetchState: 'In-Progress',
|
|
89
|
+
error: undefined,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
createAutoTransferRuleSuccess(draft, action) {
|
|
93
|
+
draft.rules = [...draft.rules, action.payload.rule];
|
|
94
|
+
draft.createRuleFetchState = {
|
|
95
|
+
fetchState: 'Completed',
|
|
96
|
+
error: undefined,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
createAutoTransferRuleFailure(draft, action) {
|
|
100
|
+
draft.createRuleFetchState = {
|
|
101
|
+
fetchState: action.payload.fetchState,
|
|
102
|
+
error: action.payload.error,
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
updateAutoTransferRule: {
|
|
106
|
+
reducer(draft, action) {
|
|
107
|
+
draft.ruleUpdateStatusById[action.payload.ruleId] = {
|
|
108
|
+
fetchState: 'In-Progress',
|
|
109
|
+
error: undefined,
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
prepare(ruleId, pauseRule, resumeRule) {
|
|
113
|
+
return { payload: { ruleId, pauseRule, resumeRule } };
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
updateAutoTransferRuleSuccess(draft, action) {
|
|
117
|
+
const updatedRule = action.payload.rule;
|
|
118
|
+
draft.rules = draft.rules.map((rule) => rule.autoTransferRuleId === updatedRule.autoTransferRuleId
|
|
119
|
+
? updatedRule
|
|
120
|
+
: rule);
|
|
121
|
+
draft.ruleUpdateStatusById[updatedRule.autoTransferRuleId] = {
|
|
122
|
+
fetchState: 'Completed',
|
|
123
|
+
error: undefined,
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
updateAutoTransferRuleFailure(draft, action) {
|
|
127
|
+
draft.ruleUpdateStatusById[action.payload.ruleId] = {
|
|
128
|
+
fetchState: action.payload.fetchState,
|
|
129
|
+
error: action.payload.error,
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
deleteAutoTransferRule: {
|
|
133
|
+
reducer(draft, action) {
|
|
134
|
+
draft.ruleDeleteStatusById[action.payload.ruleId] = {
|
|
135
|
+
fetchState: 'In-Progress',
|
|
136
|
+
error: undefined,
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
prepare(ruleId) {
|
|
140
|
+
return { payload: { ruleId } };
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
deleteAutoTransferRuleSuccess(draft, action) {
|
|
144
|
+
const { ruleId } = action.payload;
|
|
145
|
+
draft.rules = draft.rules.filter((rule) => rule.autoTransferRuleId !== ruleId);
|
|
146
|
+
draft.ruleDeleteStatusById[ruleId] = {
|
|
147
|
+
fetchState: 'Completed',
|
|
148
|
+
error: undefined,
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
deleteAutoTransferRuleFailure(draft, action) {
|
|
152
|
+
draft.ruleDeleteStatusById[action.payload.ruleId] = {
|
|
153
|
+
fetchState: action.payload.fetchState,
|
|
154
|
+
error: action.payload.error,
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
fetchAutoTransferRuleHistory: {
|
|
158
|
+
reducer(draft, action) {
|
|
159
|
+
const { ruleId, cacheOverride } = action.payload;
|
|
160
|
+
const detail = recordGet(draft.historyByRuleId, ruleId, undefined);
|
|
161
|
+
if (cacheOverride === true ||
|
|
162
|
+
detail == null ||
|
|
163
|
+
detail.fetchState !== 'In-Progress') {
|
|
164
|
+
draft.historyByRuleId[ruleId] = {
|
|
165
|
+
...initialCommonHistory,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
prepare(ruleId, cacheOverride = true) {
|
|
170
|
+
return {
|
|
171
|
+
payload: { ruleId, cacheOverride },
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
updateAutoTransferRuleHistory(draft, action) {
|
|
176
|
+
const { ruleId, historicEventsPayload } = action.payload;
|
|
177
|
+
const historicEvents = historicEventsPayload.map((historicEventPayload) => toHistoricEvent(historicEventPayload));
|
|
178
|
+
draft.historyByRuleId[ruleId] = {
|
|
179
|
+
...initialCommonHistory,
|
|
180
|
+
fetchState: 'Completed',
|
|
181
|
+
error: undefined,
|
|
182
|
+
historicEvents,
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
updateAutoTransferRuleHistoryFetchStatus(draft, action) {
|
|
186
|
+
const { ruleId, fetchState, error } = action.payload;
|
|
187
|
+
const detail = recordGet(draft.historyByRuleId, ruleId, undefined);
|
|
188
|
+
if (detail != null) {
|
|
189
|
+
detail.fetchState = fetchState;
|
|
190
|
+
detail.error = error;
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
clearAutoTransferRules(draft) {
|
|
194
|
+
Object.assign(draft, initialState);
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
export const { fetchAutoTransferRules, updateAutoTransferRules, updateAutoTransferRulesFailure, fetchAutoTransferReviewDetail, updateAutoTransferReviewDetail, updateAutoTransferReviewDetailFailure, clearAutoTransferReviewDetail, createAutoTransferRule, createAutoTransferRuleSuccess, createAutoTransferRuleFailure, updateAutoTransferRule, updateAutoTransferRuleSuccess, updateAutoTransferRuleFailure, deleteAutoTransferRule, deleteAutoTransferRuleSuccess, deleteAutoTransferRuleFailure, fetchAutoTransferRuleHistory, updateAutoTransferRuleHistory, updateAutoTransferRuleHistoryFetchStatus, updateRuleLocalData, clearRuleUpdateLocalData, clearAutoTransferRules, } = autotransferRules.actions;
|
|
199
|
+
export default autotransferRules.reducer;
|