đ§ MaintenancePlanController Documentation
QUICK DOCUMENTATIONâ
- File Path: /API/Controllers/MaintenancePlanController.cs
- Primary Purpose: Manages maintenance plans for assets, including creating, retrieving, updating, and deleting maintenance plans and their associated images.
- Key Endpoints:
- đ POST /List - Retrieves a list of maintenance plans
- đ GET /Get - Gets a specific maintenance plan by ID
- đ POST /Update - Updates a maintenance plan
- đī¸ POST /Delete - Deletes a maintenance plan
- đī¸ POST /DeleteImage - Deletes an image associated with a maintenance plan
- đī¸ POST /BulkDelete - Deletes multiple maintenance plans
- Related Models: MaintenancePlanDto, MaintenancePlanSummary
- Used By:
- Maintenance planning interfaces
- Asset management screens
- Maintenance scheduling tools
- Asset lifecycle management
DETAILED DOCUMENTATIONâ
đ Overviewâ
The MaintenancePlanController manages maintenance plans for assets within Asset Valuer Pro. Maintenance plans define scheduled maintenance activities, inspections, and interventions for assets, supporting asset lifecycle management and preventive maintenance strategies. This controller provides functionality to list, retrieve, update, and delete maintenance plans and their associated images.
đī¸ Controller Dependenciesâ
- Namespace: AVP.API.Controllers
- Services Used:
- Mediator (CQRS pattern implementation)
- ILogger (for logging operations)
- Other Dependencies: None specified
đ Endpointsâ
đ List Maintenance Plansâ
- HTTP Method: POST
- URL Pattern: /List
- Authentication: đ Required (inherited from ApiController)
- Description: Retrieves a list of maintenance plans based on query parameters
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetMaintenancePlanListQuery | Yes | Query parameters for filtering maintenance plans |
Response Formatâ
[
{
"id": 123,
"name": "Annual HVAC Maintenance",
"assetId": 456,
"assetName": "Office Building A",
"description": "Annual maintenance schedule for HVAC systems",
"scheduledDate": "2025-06-15T00:00:00Z",
"status": "Scheduled",
"estimatedCost": 5000,
"assignedTo": "John Smith",
"priority": "Medium",
"hasImages": true
},
{
"id": 124,
"name": "Quarterly Electrical Inspection",
"assetId": 457,
"assetName": "Warehouse B",
"description": "Quarterly inspection of electrical systems",
"scheduledDate": "2025-05-10T00:00:00Z",
"status": "Scheduled",
"estimatedCost": 2500,
"assignedTo": "Jane Doe",
"priority": "High",
"hasImages": false
}
]
đ Get Maintenance Planâ
- HTTP Method: GET
- URL Pattern: /Get
- Authentication: đ Required (inherited from ApiController)
- Description: Retrieves detailed information about a specific maintenance plan
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetMaintenancePlanQuery | Yes | Contains MaintenancePlanId to retrieve |
Response Formatâ
{
"id": 123,
"name": "Annual HVAC Maintenance",
"assetId": 456,
"assetName": "Office Building A",
"description": "Annual maintenance schedule for HVAC systems",
"scheduledDate": "2025-06-15T00:00:00Z",
"completionDate": null,
"status": "Scheduled",
"estimatedCost": 5000,
"actualCost": null,
"assignedTo": "John Smith",
"priority": "Medium",
"maintenanceType": "Preventive",
"recurrencePattern": "Annual",
"nextScheduledDate": "2026-06-15T00:00:00Z",
"notes": "Check all filters, belts, and bearings. Test cooling capacity and clean condenser coils.",
"componentIds": [101, 102, 103],
"images": [
{
"id": 201,
"fileName": "hvac_system_diagram.jpg",
"uploadDate": "2025-01-15T00:00:00Z",
"description": "HVAC system diagram"
},
{
"id": 202,
"fileName": "maintenance_checklist.jpg",
"uploadDate": "2025-01-15T00:00:00Z",
"description": "Maintenance checklist"
}
]
}
đ Update Maintenance Planâ
- HTTP Method: POST
- URL Pattern: /Update
- Authentication: đ Required (inherited from ApiController)
- Description: Updates an existing maintenance plan or creates a new one
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | UpdateMaintenancePlanCommand | Yes | Contains maintenance plan data to update |
Response Formatâ
123
(Returns the maintenance plan ID)
đī¸ Delete Maintenance Plan Imageâ
- HTTP Method: POST
- URL Pattern: /DeleteImage
- Authentication: đ Required (inherited from ApiController)
- Description: Deletes an image associated with a maintenance plan
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | DeleteMaintenancePlanImageCommand | Yes | Contains MaintenancePlanId and ImageId to delete |
Response Formatâ
"Image deleted successfully"
(Returns a status message)
đī¸ Delete Maintenance Planâ
- HTTP Method: POST
- URL Pattern: /Delete
- Authentication: đ Required (inherited from ApiController)
- Description: Deletes a maintenance plan by ID
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | DeleteMaintenancePlanCommand | Yes | Contains MaintenancePlanId to delete |
Response Formatâ
"Maintenance plan deleted successfully"
(Returns a status message)
đī¸ Bulk Delete Maintenance Plansâ
- HTTP Method: POST
- URL Pattern: /BulkDelete
- Authentication: đ Required (inherited from ApiController)
- Description: Deletes multiple maintenance plans at once
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | DeleteMaintenancePlansCommand | Yes | Contains array of MaintenancePlanIds to delete |
Response Formatâ
"4 maintenance plans deleted successfully"
(Returns a status message with count)
đĄ Tips for Maintenance Plan Managementâ
- â Maintenance plans can be linked to specific components within assets for better tracking
- đ Use recurring patterns to automatically schedule future maintenance activities
- â ī¸ Deleting maintenance plans will also delete associated images
- âšī¸ Completed maintenance plans provide valuable historical data for asset lifecycle analysis