Skip to main content

Introduction

This page documents the maintenance data model in GIMA, including preventive, corrective, and predictive maintenance activities. Maintenance records track work performed on assets throughout their lifecycle.
API Endpoints Not Yet Implemented: The current version of GIMA does not expose RESTful CRUD endpoints for maintenance operations. The documented structure below represents the underlying data model. Maintenance management is performed through Eloquent ORM at the application layer.

Maintenance Model

Maintenance records (mantenimientos) represent work orders and activities performed on assets. Each maintenance:
  • Is associated with a specific activo (asset)
  • Has a supervisor who oversees the work
  • Includes a tecnico_principal (lead technician) responsible for execution
  • Contains multiple sesiones (work sessions) tracking actual work performed
  • Can be linked to a reporte (failure report) for corrective maintenance
  • Tracks tipo (maintenance type), estado (status), and costo_total (total cost)

Maintenance Types

preventivo
string
Scheduled preventive maintenance to avoid failures
correctivo
string
Corrective maintenance to fix reported failures
predictivo
string
Predictive maintenance based on condition monitoring

Maintenance States

pendiente
string
Maintenance is scheduled but not yet started
en_proceso
string
Maintenance is currently in progress
completado
string
Maintenance work has been completed
cancelado
string
Maintenance was cancelled

Maintenance Workflow

1. Preventive Maintenance

2. Corrective Maintenance

Authentication & Authorization

All maintenance endpoints require authentication:
Authorization: Bearer {token}

Role Requirements

  • View maintenance: tecnico, supervisor, admin
  • Create maintenance: supervisor, admin
  • Assign technicians: supervisor, admin
  • Update work sessions: tecnico, supervisor, admin
  • Validate completion: supervisor, admin
  • Cancel maintenance: supervisor, admin
Technicians can only view and update maintenance assigned to them

Maintenance Structure

Complete Maintenance Record

{
  "id": 1,
  "activo_id": 5,
  "supervisor_id": 2,
  "tecnico_principal_id": 3,
  "tipo": "correctivo",
  "reporte_id": 10,
  "fecha_apertura": "2026-03-06T08:00:00Z",
  "fecha_cierre": "2026-03-07T17:00:00Z",
  "estado": "completado",
  "descripcion": "Reparación de falla en sistema de enfriamiento",
  "validado": true,
  "costo_total": 2500.00,
  "activo": {
    "id": 5,
    "articulo": {
      "marca": "Dell",
      "modelo": "PowerEdge R740"
    },
    "ubicacion": {
      "edificio": "Data Center",
      "piso": "1",
      "salon": "Server Room A"
    }
  },
  "supervisor": {
    "id": 2,
    "name": "Carlos Supervisor",
    "email": "[email protected]"
  },
  "tecnico_principal": {
    "id": 3,
    "name": "Ana Técnico",
    "email": "[email protected]"
  },
  "sesiones": [
    {
      "id": 1,
      "tecnico_id": 3,
      "fecha": "2026-03-06T09:00:00Z",
      "horas_trabajadas": 4.5,
      "descripcion_trabajo": "Diagnóstico inicial y desmontaje",
      "observaciones": "Sistema de ventilación obstruido",
      "costo_total": 1200.00
    },
    {
      "id": 2,
      "tecnico_id": 3,
      "fecha": "2026-03-07T10:00:00Z",
      "horas_trabajadas": 3.0,
      "descripcion_trabajo": "Limpieza y reinstalación",
      "observaciones": "Sistema funcionando correctamente",
      "costo_total": 1300.00
    }
  ],
  "reporte": {
    "id": 10,
    "descripcion": "Equipo presenta sobrecalentamiento",
    "prioridad": "alta"
  }
}

Key Concepts

Work Sessions

Maintenance work is tracked through sessions (sesiones_mantenimiento):
  • Each session records actual work performed by a technician
  • Tracks hours worked, costs, and detailed observations
  • Multiple technicians can contribute to the same maintenance
  • Total maintenance cost is the sum of all session costs

Validation Process

1

Completion

Technician marks work as complete with estado=“completado”
2

Review

Supervisor reviews work sessions and quality
3

Validation

Supervisor sets validado=true if work meets standards
4

Closure

System updates fecha_cierre and linked reports

Cost Tracking

Costs are accumulated at two levels:
  1. Session Level: Each work session has its own costo_total
  2. Maintenance Level: Total cost aggregates all session costs

Common Patterns

Creating Corrective Maintenance from Report

{
  "activo_id": 5,
  "supervisor_id": 2,
  "tecnico_principal_id": 3,
  "tipo": "correctivo",
  "reporte_id": 10,
  "fecha_apertura": "2026-03-06T08:00:00Z",
  "fecha_cierre": "2026-03-08T18:00:00Z",
  "descripcion": "Repair based on failure report #10"
}

Creating Preventive Maintenance

{
  "activo_id": 5,
  "supervisor_id": 2,
  "tecnico_principal_id": 3,
  "tipo": "preventivo",
  "reporte_id": null,
  "fecha_apertura": "2026-03-15T08:00:00Z",
  "fecha_cierre": "2026-03-15T17:00:00Z",
  "descripcion": "Quarterly preventive maintenance"
}
Preventive maintenance does not require a reporte_id (it’s nullable)

Base URL

All maintenance endpoints use the technical zone prefix:
/api/tecnica/

Maintenance Sessions

Track work sessions and technician time

Assets API

Manage the assets being maintained

Reports API

Handle failure reports that trigger maintenance

Build docs developers (and LLMs) love