Skip to content

Feat(asset-maintenance): implement asset maintenance scheduling, completion, and history#268

Merged
yusuftomilola merged 3 commits intoDistinctCodes:mainfrom
Cedarich:feature/asset-maintenance-scheduling-history
Oct 1, 2025
Merged

Feat(asset-maintenance): implement asset maintenance scheduling, completion, and history#268
yusuftomilola merged 3 commits intoDistinctCodes:mainfrom
Cedarich:feature/asset-maintenance-scheduling-history

Conversation

@Cedarich
Copy link
Contributor

Summary

This PR introduces a dedicated asset-maintenance module to schedule and track maintenance activities for assets.
It provides REST endpoints for:

  • Scheduling maintenance tasks
  • Marking maintenance as completed
  • Fetching historical maintenance records

Note: Scheduling is blocked for disposed assets to maintain consistency with the asset disposals feature.


Key Changes

New Entity and Table

  • Table: asset_maintenance
  • Columns:
    • id, assetId, scheduledDate, completedDate, maintenanceType, notes, createdAt, updatedAt
  • Index: (assetId + scheduledDate)
  • File: asset-maintenance.entity.ts
    • AssetMaintenance entity

Module, Service, and Controller

  • Module: asset-maintenance.module.tsAssetMaintenanceModule
  • Service: asset-maintenance.service.tsAssetMaintenanceService
  • Controller: asset-maintenance.controller.tsAssetMaintenanceController

DTOs

  • schedule-maintenance.dto.tsScheduleMaintenanceDto
  • complete-maintenance.dto.tsCompleteMaintenanceDto

App Integration

  • Updated: app.module.ts → Registered AssetMaintenanceModule

API Endpoints

1. Schedule Maintenance

POST /asset-maintenance/schedule

Body:

{
  "assetId": "uuid-string",
  "scheduledDate": "2025-10-05T00:00:00.000Z",
  "maintenanceType": "REPAIR",
  "notes": "Optional notes about maintenance"
}

@vercel
Copy link

vercel bot commented Sep 29, 2025

@Big-cedar is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola yusuftomilola merged commit 2045f83 into DistinctCodes:main Oct 1, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants