Skip to main content
The Maintenance section is split into two workflows: managing the catalogue of maintenance type categories, and assigning those types — or mandatory schedules — to individual vehicles.

Maintenance types

Maintenance types are named categories used to classify preventive maintenance work. Examples include “Oil Change”, “Tire Rotation”, and “Brake Inspection”. You must create at least one type before assigning preventive maintenance to a vehicle.

Creating a maintenance type

1

Open the Maintenance section

Click Maintenance in the left sidebar. The type form appears in the top-left area of the screen.
2

Enter the type details

FieldDescription
NombreName of the maintenance category (e.g., “Oil Change”)
DescripciónOptional description of the work involved
3

Save the type

Click Crear tipo. The new category appears in the types table below the form, with Activo set to .

Editing a maintenance type

Click Editar on the type row. The form switches to edit mode with the current values pre-filled. Make your changes and click Actualizar tipo. Click Cancelar to discard changes.

Deleting a maintenance type

Click Eliminar on the type row to permanently remove the category.
Deleting a maintenance type removes the category definition. Existing vehicle maintenance records that reference this type will lose their type association. Remove assignments referencing this type before deleting it.

Assigning maintenance to a vehicle

Preventive vs. mandatory maintenance

Understanding the distinction between the two maintenance modes is important before creating records:

Preventive maintenance

Scheduled by maintenance type. Each record is linked to a specific type (e.g., “Oil Change”) and tracks when the service was last performed and when it is next due — either by date or by odometer reading. Multiple preventive records can exist for the same vehicle, one per type.

Mandatory maintenance

Not linked to a named type. A mandatory record represents a vehicle-level service threshold based on the vehicle’s maintenanceInterval (default: 5,000 units). When the vehicle’s current mileage meets or exceeds the next due mileage, or the next due date has passed, the record’s isDue flag becomes true. Mandatory maintenance that is due blocks inspection submissions until it is completed.

Assigning preventive maintenance

1

Locate the assignment form

On the right side of the Maintenance screen, find the Asignar mantenimiento a vehículo form.
2

Select the vehicle

Choose the target vehicle from the Vehículo dropdown. Vehicles are listed by licence plate, brand, and model.
3

Select the maintenance type

Choose a category from the Tipo de mantenimiento dropdown. This links the record to a specific named service.
4

Set the schedule

FieldDescription
Último kilometrajeOdometer reading when the service was last performed (defaults to 0)
Próxima fechaDate when the service is next due, in YYYY-MM-DD format
Próximo kilometrajeOdometer reading at which the service is next due
5

Save the assignment

Click Asignar mantenimiento. The record is created with isPreventive set to true and appears in the maintenance calendar below.

Assigning mandatory maintenance

Mandatory maintenance is assigned via the API with isPreventive set to false. No maintenance type is required.
POST /api/admin/vehicles/:vehicleId/maintenance
{
  "isPreventive": false,
  "lastPerformedMileage": 42000,
  "lastPerformedDate": "2025-01-15",
  "nextDueDate": "2025-07-15",
  "nextDueMileage": 47000
}
If nextDueMileage is omitted, the system calculates it automatically as lastPerformedMileage + vehicle.maintenanceInterval.
Each vehicle should have at most one mandatory maintenance record active at a time. When you complete a mandatory record, update it rather than creating a new one.

Completing a maintenance record

When a technician finishes a service, record the completion so the system can recalculate the next due interval. Send a POST request to the maintenance completion endpoint:
POST /api/vehicles/:vehicleId/maintenance/complete
Include the following fields in the request body:
FieldRequiredDescription
completedDateYesDate the service was performed (YYYY-MM-DD)
completedMileageYesOdometer reading at completion
workshopSuggestedDateNoNext due date suggested by the workshop; overrides the stored nextDueDate
completionNotesNoFree-text notes about the work performed
How next due mileage is recalculated:
  • Preventive records: nextDueMileage retains its stored value (it was set when the record was assigned).
  • Mandatory records: nextDueMileage is recalculated as completedMileage + vehicle.maintenanceInterval.
This ensures mandatory maintenance always stays in sync with real-world odometer readings.

Removing a maintenance record

To delete a maintenance record, send a DELETE request to the record’s endpoint. This removes the schedule entirely; the vehicle’s maintenance history will no longer include this entry.

Viewing upcoming mandatory maintenance

The backend dashboard endpoint returns the 10 nearest upcoming mandatory maintenance events, ordered by nextDueDate ascending:
GET /api/admin/dashboard
The response includes an upcomingMandatory array. Each item contains the full vehicle record and the associated maintenance type (if any), giving you an at-a-glance view of which vehicles need attention soonest.
Set nextDueDate on mandatory records when you assign them. Without a date, the system can only evaluate due status by odometer reading, which requires an up-to-date mileage value from recent inspections.

Maintenance calendar

The right side of the Maintenance screen shows an operational calendar (Calendario operativo) that lists all VehicleMaintenance records associated with your vehicles. Each entry displays the vehicle and its next due date. Use this view to plan workshop schedules and avoid inspection blocks caused by overdue mandatory maintenance.

Build docs developers (and LLMs) love