đ LookupController Documentation
đ QUICK DOCUMENTATIONâ
- File Path: /API/Controllers/LookupController.cs
- Primary Purpose: Provides centralized lookup endpoints for dropdown lists of various entities in the system, including asset classes, types, subtypes, component types, and financial classes.
- Key Endpoints:
- đ GET /AssetClass - Retrieves list of asset classes
- đ GET /AssetType - Retrieves asset types for dropdown lists
- đ GET /AssetSubType - Retrieves asset subtypes
- đ GET /ComponentType - Retrieves component types
- đ GET /ComponentSubType - Retrieves component subtypes
- âī¸ POST /FinancialAssetClass - Retrieves financial asset classes
- Related Models: DropDownDto
- Used By:
- Dropdown components throughout the user interface
- Form selection fields
- Asset and component creation/editing screens
- Filtering components
đī¸ DETAILED DOCUMENTATIONâ
đī¸ Overviewâ
The LookupController serves as a central provider of dropdown list data throughout the Asset Valuer Pro application. It handles requests for various entities that need to be presented in dropdown lists, such as asset classes, asset types, component types, and financial categories. This controller simplifies the retrieval of standard selection lists, ensuring consistent data presentation across the application.
đ§ Controller Dependenciesâ
- Namespace: AVP.API.Controllers
- Services Used:
- Mediator (CQRS pattern implementation)
- Other Dependencies: None specified
đ Endpointsâ
đ Get Asset Class Listâ
- HTTP Method: GET
- URL Pattern: /AssetClass
- Authentication: đ Required (inherited from ApiController)
- Description: Retrieves a list of asset classes for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetAssetClassListQuery | Yes | Filter parameters for asset classes |
Response Formatâ
[
{
"id": 1,
"name": "Buildings"
},
{
"id": 2,
"name": "Infrastructure"
},
{
"id": 3,
"name": "Land"
}
]
đ Get Asset Type Listâ
- HTTP Method: GET
- URL Pattern: /AssetType
- Authentication: đ Required
- Description: Retrieves a list of asset types for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | AssetTypeListQuery | Yes | Contains AssetClassId to filter types |
Response Formatâ
[
{
"id": 101,
"name": "Commercial"
},
{
"id": 102,
"name": "Residential"
},
{
"id": 103,
"name": "Industrial"
}
]
đ Get Asset SubType Listâ
- HTTP Method: GET
- URL Pattern: /AssetSubType
- Authentication: đ Required
- Description: Retrieves a list of asset subtypes for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | AssetSubTypeListQuery | Yes | Contains AssetTypeId to filter subtypes |
Response Formatâ
[
{
"id": 201,
"name": "Office"
},
{
"id": 202,
"name": "Retail"
},
{
"id": 203,
"name": "Mixed Use"
}
]
đ Get Component Type Listâ
- HTTP Method: GET
- URL Pattern: /ComponentType
- Authentication: đ Required
- Description: Retrieves a list of component types for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | ComponentTypeListQuery | Yes | Filter parameters for component types |
Response Formatâ
[
{
"id": 1,
"name": "Structural"
},
{
"id": 2,
"name": "Mechanical"
},
{
"id": 3,
"name": "Electrical"
}
]
đ Get Component SubType Listâ
- HTTP Method: GET
- URL Pattern: /ComponentSubType
- Authentication: đ Required
- Description: Retrieves a list of component subtypes for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | ComponentSubTypeListQuery | Yes | Contains ComponentTypeId to filter subtypes |
Response Formatâ
[
{
"id": 101,
"name": "External Walls"
},
{
"id": 102,
"name": "Internal Walls"
},
{
"id": 103,
"name": "Roof Structure"
}
]
âī¸ Get Financial Asset Class Listâ
- HTTP Method: POST
- URL Pattern: /FinancialAssetClass
- Authentication: đ Required
- Description: Retrieves a list of financial asset classes for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | FinancialAssetClassListQuery | Yes | Filter parameters for financial asset classes |
Response Formatâ
[
{
"id": 1,
"name": "Land"
},
{
"id": 2,
"name": "Buildings & Improvements"
},
{
"id": 3,
"name": "Plant & Equipment"
}
]
đ Get Financial Asset SubClass Listâ
- HTTP Method: GET
- URL Pattern: /FinancialAssetSubClass
- Authentication: đ Required
- Description: Retrieves a list of financial asset subclasses for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | FinancialAssetSubClassListQuery | Yes | Contains FinancialAssetClassId to filter subclasses |
Response Formatâ
[
{
"id": 101,
"name": "Operational Land"
},
{
"id": 102,
"name": "Community Land"
},
{
"id": 103,
"name": "Land Under Roads"
}
]
âī¸ Get Valuation Profile Listâ
- HTTP Method: POST
- URL Pattern: /ValuationProfile
- Authentication: đ Required
- Description: Retrieves a list of valuation profiles for dropdown selection
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | ValuationProfileListQuery | Yes | Filter parameters for valuation profiles |
Response Formatâ
[
{
"id": 1,
"name": "Standard Building Valuation"
},
{
"id": 2,
"name": "Infrastructure Valuation"
},
{
"id": 3,
"name": "Land Valuation"
}
]
đ Lookup Type Categoriesâ
âšī¸ Note: The LookupController manages several categories of lookup data:
-
Asset Hierarchy
- Asset Classes, Types, SubTypes
- Provides the core classification structure
-
Component Hierarchy
- Component Types and SubTypes
- Provides component classification options
-
Financial Classification
- Financial Asset Classes and SubClasses
- Used for financial reporting categorization
-
Valuation Parameters
- Valuation Profiles
- Used for setting valuation calculation rules
đ Response Formatâ
All endpoints return a standardized DropDownDto format with:
id: The unique identifier for the lookup itemname: The display name for dropdown selection- Optional additional fields depending on the lookup type
đ Business Contextâ
The lookup system provides important business benefits:
-
Standardization
- Ensures consistent naming and classification
- Centralizes the management of lookup options
- Maintains referential integrity in selections
-
User Interface Support
- Powers dropdown selection components
- Enables dynamic filtering of related options
- Simplifies form data entry
-
Data Quality
- Prevents free-text entry errors
- Enforces valid selection options
- Maintains data consistency across the application
⥠Performance Considerationsâ
đĄ Tip: Lookup results are frequently accessed during user interaction. Consider:
- Client-side caching of common lookup data
- Using the most specific endpoint for filtered results
- Implementing cascading dropdowns to limit result sizes