Overview
GIMA’s failure reporting system allows users to quickly document asset problems, prioritize issues, and automatically create corrective maintenance work orders.
Failure Report Model
Reporte Structure
Failure reports capture critical information about asset problems:
class Reporte extends Model
{
protected $table = 'reportes' ;
protected $fillable = [
'usuario_id' , // User who reported the issue
'activo_id' , // Affected asset
'descripcion' , // Problem description
'prioridad' , // Priority level (enum)
'estado' , // Report status (enum)
];
protected $casts = [
'prioridad' => 'string' ,
'estado' => 'string' ,
];
}
Report States
Failure reports progress through several states:
Abierto
Asignado
En Proceso
Resuelto
Cerrado
Estado: abierto
Description: Report has been submitted but not yet reviewed
Label: Abierto
Next actions:
- Supervisor reviews report
- Assign priority
- Assign to technician
Priority Levels
Assign appropriate priority to ensure critical issues receive immediate attention:
Prioridad: alta
Label: Alta
Use for:
- Safety hazards
- Complete asset failure
- Production-stopping issues
- Emergency situations
Response time: Immediate (within 1 hour)
Creating Failure Reports
Identify the asset
Locate the failing asset and obtain its activo_id.
Document the problem
Write a clear, detailed description of the failure symptoms and circumstances.
Assign priority
Evaluate the impact and urgency to set appropriate priority level.
Submit the report
Create the report with initial estado of “abierto”.
Notify supervisors
System should automatically notify supervisors of new high-priority reports.
API Example: Create Failure Report
Any authenticated user can create failure reports. This enables rapid response to asset problems discovered by any team member.
Endpoint
Bearer token from authentication
Request Body
Detailed description of the failure or problem
Priority level: “alta”, “media”, or “baja”
Example Requests
High Priority Report
Medium Priority Report
Low Priority Report
JavaScript Example
Python Example
curl -X POST http://127.0.0.1:8000/api/reportes \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"activo_id": 12,
"descripcion": "El aire acondicionado central no enciende. Se escucha un zumbido cuando se activa pero el compresor no arranca. Sala de servidores alcanzando temperatura crítica.",
"prioridad": "alta"
}'
Response
{
"estado" : "exito" ,
"mensaje" : "Reporte creado correctamente" ,
"data" : {
"id" : 47 ,
"usuario_id" : 5 ,
"activo_id" : 12 ,
"descripcion" : "El aire acondicionado central no enciende..." ,
"prioridad" : "alta" ,
"estado" : "abierto" ,
"created_at" : "2024-03-06T10:30:00.000000Z" ,
"updated_at" : "2024-03-06T10:30:00.000000Z"
}
}
Report Relationships
User Relationship
Access information about who reported the issue:
$reporte = Reporte :: find ( $id );
$usuario = $reporte -> usuario ;
echo "Reported by: { $usuario -> name }" ;
echo "Contact: { $usuario -> email }" ;
Asset Relationship
Get details about the affected asset:
$reporte = Reporte :: find ( $id );
$activo = $reporte -> activo ;
echo "Asset: { $activo -> articulo -> marca } { $activo -> articulo -> modelo }" ;
echo "Location: { $activo -> ubicacion -> edificio }, { $activo -> ubicacion -> salon }" ;
echo "Current status: { $activo -> estado -> label ()}" ;
Maintenance Work Orders
A report can spawn one or more maintenance work orders:
$reporte = Reporte :: find ( $id );
$mantenimientos = $reporte -> mantenimientos ;
foreach ( $mantenimientos as $mantenimiento ) {
echo "Work Order #{ $mantenimiento -> id }" ;
echo "Type: { $mantenimiento -> tipo }" ;
echo "Status: { $mantenimiento -> estado }" ;
}
Querying Reports
Get Open Reports
Get Reports by Asset
Get Reports by User
Get Reports by Priority
// Get all open reports
$abiertos = Reporte :: where ( 'estado' , 'abierto' )
-> orderBy ( 'prioridad' , 'desc' )
-> orderBy ( 'created_at' , 'asc' )
-> with ([ 'activo.articulo' , 'usuario' ])
-> get ();
// Get high-priority open reports
$urgentes = Reporte :: where ( 'estado' , 'abierto' )
-> where ( 'prioridad' , 'alta' )
-> get ();
Updating Report Status
Assign to Technician
When a supervisor assigns the report:
This typically happens when creating a Mantenimiento work order:
// Create maintenance work order from report
$reporte = Reporte :: find ( $reporte_id );
$mantenimiento = Mantenimiento :: create ([
'activo_id' => $reporte -> activo_id ,
'reporte_id' => $reporte -> id ,
'supervisor_id' => $supervisor_id ,
'tecnico_principal_id' => $tecnico_id ,
'tipo' => 'correctivo' ,
'fecha_apertura' => now (),
'estado' => 'abierto' ,
'descripcion' => $reporte -> descripcion ,
]);
// Update report status
$reporte -> estado = 'asignado' ;
$reporte -> save ();
// Update asset status
$reporte -> activo -> estado = EstadoActivo :: MANTENIMiENTO ;
$reporte -> activo -> save ();
Mark as In Progress
When technician starts work:
{
"estado" : "en_progreso"
}
Mark as Resolved
When technician completes repair:
Close Report
When supervisor verifies the fix:
Only supervisors or admins should be able to close reports. Implement proper authorization checks to prevent premature closure.
Report Workflow
Complete Failure-to-Fix Workflow
User reports failure
Any user discovers an asset problem and creates a Reporte with appropriate priority.
Supervisor reviews
Supervisor reviews new reports (especially high-priority) and validates priority level.
Create work order
Supervisor creates Mantenimiento work order, assigns technician, and updates report to “asignado”.
Technician accepts
Assigned technician reviews work order and updates report to “en_progreso” when starting work.
Perform repair
Technician diagnoses issue, orders parts if needed, performs repair, and documents work in SesionesMantenimiento.
Mark resolved
Technician completes work and updates report to “resuelto”.
Supervisor verifies
Supervisor inspects completed work and updates report to “cerrado” if satisfactory.
Asset returned to service
Asset estado is updated to “operativo” and returned to normal operation.
Writing Effective Failure Reports
Quality failure reports lead to faster diagnosis and repair. Include specific details that help technicians understand and resolve issues quickly.
Good Report Checklist
Specific symptoms observed
When the problem started
Frequency (constant, intermittent, only under certain conditions)
Any error messages or codes displayed
Environmental conditions (temperature, humidity, load)
What was happening when failure occurred
Any unusual sounds, smells, or visual indicators
Previous similar incidents
Examples
Poor Description
Good Description
"No funciona el aire"
Problems:
- Too vague
- No details about symptoms
- No context
Report Analytics
Common Queries for Analysis
Response Time Analysis
Failure Patterns by Asset
Reports by Time Period
// Calculate average response time by priority
$avgResponseTime = Reporte :: selectRaw ( '
prioridad,
AVG(TIMESTAMPDIFF(HOUR, created_at, updated_at)) as avg_hours
' )
-> where ( 'estado' , '!=' , 'abierto' )
-> groupBy ( 'prioridad' )
-> get ();
Best Practices
Report immediately
Encourage users to report problems as soon as they’re discovered. Early detection prevents minor issues from becoming major failures.
Be specific and detailed
Provide thorough descriptions with symptoms, context, and impact. Detailed reports enable faster diagnosis.
Set appropriate priority
Use priority levels consistently across the organization. Don’t mark everything as high priority.
Include photos when helpful
Implement photo upload capability for reports. Visual documentation can be invaluable for diagnosis.
Follow up on reports
Implement notifications to keep report creators informed of progress and resolution.
Analyze patterns
Regularly review failure reports to identify recurring problems and opportunities for preventive maintenance.