Skip to content

[BE-52] Implement specialised report endpoints — warranty expiry, maintenance costs, and asset utilisation #925

Description

@yusuftomilola

Overview

Beyond the summary, asset managers need targeted reports to act on specific risks: warranties about to expire, high maintenance costs, and underutilised assets. These feed into the advanced reports page (FE-19) and can be exported as PDF/Excel (BE-53).

Context

  • Depends on BE-51 (ReportsModule base), BE-26 (MaintenanceRecord), BE-41 (Depreciation), BE-30 (Checkouts)
  • All report endpoints must support ?departmentId, ?categoryId, and date range (?from, ?to) filters

Acceptance Criteria

  • GET /reports/warranty-expiring with ?days=30 (default) — returns assets where warrantyExpiration is within the next N days, sorted by warrantyExpiration ASC. Response includes assetId, name, warrantyExpiration, department.name, assignedTo
  • GET /reports/maintenance-costs with ?from and ?to date range — total maintenance spend per asset and per department, sorted by cost DESC. Sums MaintenanceRecord.cost and WorkOrder.actualCost in the period
  • GET /reports/depreciation — all depreciating assets with: purchasePrice, currentValue, totalDepreciation (purchasePrice - currentValue), depreciationMethod, usefulLifeYears, grouped by category with subtotals
  • GET /reports/asset-utilisation — assets by utilisation: total days checked out vs total days in the period, percentage utilised, assets never used (0 checkouts)
  • All endpoints are paginated and apply RBAC department scoping

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions