đ ComponentHierarchyController Documentation
đ QUICK DOCUMENTATIONâ
- File Path: /API/Controllers/ComponentHierarchyController.cs
- Primary Purpose: Manages component hierarchy information, providing lookups for component types, subtypes, and names within the asset structure.
- Key Endpoints:
- đ GET /GetComponentNames - Retrieves component names based on filters
- đ GET /GetComponentTypes - Retrieves component types list
- đ GET /GetComponentSubTypes - Retrieves component subtypes for a given type
- đ GET /GetComponentNamesByAsset - Retrieves components for a specific asset
- đ GET /GetComponentHierarchyList - Retrieves the complete component hierarchy
- Related Models: DropDownDto, ComponentHierarchyList
- Used By:
- Asset management screens
- Component configuration
- Component selection dropdowns
- Data capture interfaces
đī¸ DETAILED DOCUMENTATIONâ
đī¸ Overviewâ
The ComponentHierarchyController manages the component hierarchy, which is a key part of the asset structure in Asset Valuer Pro. Components are the building blocks that make up assets (e.g., a building asset might have components like structure, roof, HVAC, etc.). This controller provides lookups and filtering capabilities for component types, subtypes, and names, supporting the component selection and hierarchy navigation throughout the application.
đ§ Controller Dependenciesâ
- Namespace: AVP.API.Controllers
- Services Used:
- Mediator (CQRS pattern implementation)
- ICurrentUserService (for user context)
- Other Dependencies: None specified
đ Endpointsâ
đ Get Component Names By Assetâ
- HTTP Method: GET
- URL Pattern: /GetComponentNamesByAsset
- Authentication: đ Required (inherited from ApiController)
- Description: Retrieves component names for a specific asset
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetComponentNamesByAssetQuery | Yes | Contains AssetId to retrieve component names |
Response Formatâ
[
{
"id": 101,
"name": "Structure"
},
{
"id": 102,
"name": "Roof"
},
{
"id": 103,
"name": "HVAC"
}
]
đ Get Component Namesâ
- HTTP Method: GET
- URL Pattern: /GetComponentNames
- Authentication: đ Required
- Description: Retrieves component names based on filter criteria
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetComponentNamesQuery | Yes | Filter criteria for component names |
Response Formatâ
[
{
"id": 101,
"name": "Structure"
},
{
"id": 102,
"name": "Roof"
}
]
đ Get Component Hierarchy Listâ
- HTTP Method: GET
- URL Pattern: /GetComponentHierarchyList
- Authentication: đ Required
- Description: Retrieves the complete component hierarchy structure
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetComponentHierarchyListQuery | Yes | Filter parameters for hierarchy |
Response Formatâ
[
{
"componentNameId": 101,
"componentName": "Structure",
"componentTypeId": 1,
"componentType": "Structural",
"componentSubTypeId": 10,
"componentSubType": "External Walls",
"assetClassId": 1,
"assetTypeName": "Building",
"assetType": "Commercial",
"assetSubType": "Office"
},
{
"componentNameId": 102,
"componentName": "Roof",
"componentTypeId": 1,
"componentType": "Structural",
"componentSubTypeId": 11,
"componentSubType": "Roof Structure",
"assetClassId": 1,
"assetTypeName": "Building",
"assetType": "Commercial",
"assetSubType": "Office"
}
]
đ Get Component Typesâ
- HTTP Method: GET
- URL Pattern: /GetComponentTypes
- Authentication: đ Required
- Description: Retrieves a list of component types
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetComponentTypesQuery | Yes | Filter parameters for component types |
Response Formatâ
[
{
"id": 1,
"name": "Structural"
},
{
"id": 2,
"name": "Mechanical"
},
{
"id": 3,
"name": "Electrical"
}
]
đ Get Component SubTypesâ
- HTTP Method: GET
- URL Pattern: /GetComponentSubTypes
- Authentication: đ Required
- Description: Retrieves a list of component subtypes for a specific component type
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetComponentSubTypesQuery | Yes | Contains ComponentTypeId and other filters |
Response Formatâ
[
{
"id": 10,
"name": "External Walls"
},
{
"id": 11,
"name": "Roof Structure"
},
{
"id": 12,
"name": "Internal Walls"
}
]
đ Component Hierarchy Structureâ
âšī¸ Note: The component hierarchy follows this structure:
-
Component Name (Level 1)
- Top-level categorization (e.g., Structure, Roof, HVAC)
- Defines major building blocks of an asset
-
Component Type (Level 2)
- Sub-categorization of component names (e.g., Metal Roof, Tiled Roof)
- Defines material or construction type variations
-
Component SubType (Level 3)
- Detailed specification (e.g., Colorbond, Terracotta)
- Defines specific implementations for costing and lifecycle modeling
This hierarchy provides a standardized framework for component classification across the system.
đ Asset-Component Relationshipâ
The component hierarchy has a direct relationship with the asset hierarchy:
- Asset Class â Can have specific component configurations
- Asset Type â Refines available components
- Asset SubType â Defines the exact component template
When an asset is created, the component structure is often determined by its classification in the asset hierarchy. The ComponentHierarchyController helps manage these relationships and provides the necessary lookups to maintain consistent component classification.
đ Business Contextâ
Component hierarchy provides important business benefits:
-
Standardization
- Ensures consistent component naming and classification
- Supports componentized valuation approaches
- Enables consistent lifecycle modeling
-
Valuation Framework
- Allows different valuation parameters by component type
- Supports detailed cost breakdowns
- Enables component-level condition assessment
-
Strategic Asset Management
- Facilitates component-level renewal planning
- Supports maintenance scheduling by component
- Enables accurate component lifecycle forecasting