Skip to main content

Business Logic Services Inventory

This document provides an inventory of the business logic services in the Asset Valuer Pro application. The application follows the CQRS (Command Query Responsibility Segregation) pattern, which separates read operations (Queries) from write operations (Commands).

Application Architecture Overview

The business logic in Asset Valuer Pro is organized using the following patterns:

  1. Command Handlers - Handle operations that change state (create, update, delete)
  2. Query Handlers - Handle operations that read data
  3. Event Handlers - Process domain events
  4. Services - Provide cross-cutting functionality

Each functional domain has its own set of commands, queries, and handlers.

Command Handlers

Command handlers implement the business logic for state-changing operations.

Command HandlerPathPrimary Purpose
UpdateJobCommandHandler/Application/Jobs/Commands/UpdateJob/UpdateJobCommand.csCreate or update a valuation job
ArchiveJobCommandHandler/Application/Jobs/Commands/ArchiveJob/ArchiveJobCommand.csArchive a completed job
DeleteJobCommandHandler/Application/Jobs/Commands/DeleteJob/DeleteJobCommand.csDelete a job and its related data
RefreshJobDataCommandHandler/Application/Jobs/Commands/RefreshJobData/RefreshJobDataCommand.csRecalculate job data
RevalidateCommandHandler/Application/Jobs/Commands/Revalidate/RevalidateCommand.csRevalidate job data
UpdateAssetCommandHandler/Application/Assets/Commands/UpdateAsset/UpdateAssetCommand.csCreate or update an asset
DeleteAssetsCommandHandler/Application/Assets/Commands/DeleteAssets/DeleteAssetsCommand.csDelete assets
ImportAssetRegisterSpreadsheetCommandHandler/Application/Assets/Commands/ImportAssets/ImportAssetRegisterSpreadsheetCommand.csImport assets from spreadsheet
UpdateValuationProfileCommandHandler/Application/ValuationProfiles/Commands/UpdateValuationProfile/UpdateValuationProfileCommand.csUpdate valuation profile
UpdateComponentCommandHandler/Application/Components/Commands/UpdateComponent/UpdateComponentCommand.csUpdate a component
UpdateAssetAssumptionsCommandHandler/Application/Assumptions/Commands/UpdateAssetAssumptions/UpdateAssetAssumptionsCommand.csUpdate asset assumptions
UpdateComponentAssumptionsCommandHandler/Application/Assumptions/Commands/UpdateComponentAssumptions/UpdateComponentAssumptionsCommand.csUpdate component assumptions
ImportHierarchyCommandHandler/Application/AssetHierarchy/Commands/ImportHierarchy/ImportHierarchyCommand.csImport asset hierarchy data
CopyHierarchyNodeCommandHandler/Application/AssetHierarchy/Commands/CopyHierarchyNode/CopyHierarchyNodeCommand.csCopy hierarchy node structure
UpdateHierarchyNodeCommandHandler/Application/AssetHierarchy/Commands/UpdateHierarchyNode/UpdateHierarchyNodeCommand.csUpdate hierarchy node
ImportCaptureAssetCommandHandler/Application/Assets/Commands/ImportCaptureAsset/ImportCaptureAssetCommand.csImport assets captured via mobile
ImportImagesCommandHandler/Application/Assets/Commands/ImportImages/ImportImagesCommand.csImport asset images

Query Handlers

Query handlers implement the business logic for read operations.

Query HandlerPathPrimary Purpose
GetJobQueryHandler/Application/Jobs/Queries/GetJob/GetJobQuery.csRetrieve detailed job information
GetJobListQueryHandler/Application/Jobs/Queries/GetJobList/GetJobListQuery.csRetrieve list of jobs
GetAssetQueryHandler/Application/Assets/Queries/GetAsset/GetAssetQuery.csRetrieve detailed asset information
SearchAssetsQueryHandler/Application/Assets/Queries/Search/SearchAssets/SearchAssetsQuery.csSearch for assets with filtering
ExportAssetsQueryHandler/Application/Assets/Queries/ExportAssets/ExportAssetsQuery.csExport assets to spreadsheet
GetAssetHierarchyForOfflineQueryHandler/Application/AssetHierarchy/Queries/GetAssetHierarchyForOffline/GetAssetHierarchyForOfflineQuery.csGet hierarchy for offline use
GetValuationProfileQueryHandler/Application/ValuationProfiles/Queries/GetValuationProfile/GetValuationProfileQuery.csGet valuation profile details
GetComponentQueryHandler/Application/Components/Queries/GetComponent/GetComponentQuery.csGet component details
GetAssetAssumptionsQueryHandler/Application/Assumptions/Queries/GetAssetAssumptions/GetAssetAssumptionsQuery.csGet asset assumptions
GetReplacementCostQueryHandler/Application/ReplacementCosts/Queries/GetReplacementCost/GetReplacementCostQuery.csGet replacement cost information
GetSummaryReportQueryHandler/Application/Reports/Queries/GetSummaryReport/GetSummaryReportQuery.csGenerate summary report
GetMethodologyReportQueryHandler/Application/Reports/Queries/GetMethodologyReport/GetMethodologyReportQuery.csGenerate methodology report

Event Handlers

Event handlers process domain events for loosely coupled operations.

Event HandlerPathPrimary Purpose
GetValuationProfileEventHandler/Application/Assets/EventHandlers/GetValuationProfileEventHandler.csHandle valuation profile retrieval events
RefreshAssetValuationDataEventHandler/Application/Assets/EventHandlers/RefreshAssetValuationDataEventHandler.csRefresh asset valuation data when triggered
ValidateAssetEventHandler/Application/Assets/EventHandlers/ValidateAssetEventHandler.csValidate asset data when triggered

Services

Services provide cross-cutting functionality used across the application.

ServicePathPrimary Purpose
ICurrentUserService/Application/Common/Interfaces/ICurrentUserService.csProvides access to current user context
ApiCurrentUserService/API/Services/ApiCurrentUserService.csImplementation of current user service for API
BgTasksCurrentUserService/AVP.BackgroundTasks/Services/BgTasksCurrentUserService.csImplementation for background tasks
IApplicationDbContext/Application/Common/Interfaces/IApplicationDbContext.csDatabase context interface
IIdentityService/Application/Common/Interfaces/IIdentityService.csUser identity management
IExcelBuilder/Application/Common/Interfaces/IExcelBuilder.csExcel file generation
IFileStore/Application/Common/Interfaces/IFileStore.csFile storage operations

Core Domain Services

These services implement core business logic related to valuation calculations.

ServiceDescription
JobOperationCore service for managing job lifecycle and operations
ValuationCalculationImplements valuation calculation logic
ImportExportHandles data import and export operations
AssetValidationValidates asset data completeness and correctness
HierarchyManagementManages asset and component hierarchy
ReportGenerationGenerates various reports

Priority Services

Based on business requirements and core functionality, the following services should be prioritized for detailed documentation:

  1. JobOperation - Critical for valuation workflow
  2. ValuationCalculation - Core business logic for valuations
  3. ImportExport - Essential for data integration
  4. AssetValidation - Important for data quality
  5. ReportGeneration - Key for business outputs