API Endpoints Not Yet Implemented: The current version of GIMA does not expose RESTful CRUD endpoints for assets. This page documents the underlying data model for reference. Asset management is performed through the Eloquent ORM in the application layer.
The Activo model has the following relationships defined:
App/Models/Activo.php
// Belongs to an article definitionpublic function articulo(): BelongsTo{ return $this->belongsTo(Articulos::class, 'articulo_id');}// Belongs to a locationpublic function ubicacion(): BelongsTo{ return $this->belongsTo(Ubicacion::class, 'ubicacion_id');}// Has many maintenance calendar entriespublic function calendarioMantenimientos(): HasMany{ return $this->hasMany(CalendarioMantenimiento::class, 'activo_id');}// Has many maintenance recordspublic function mantenimientos(): HasMany{ return $this->hasMany(Mantenimiento::class, 'activo_id');}// Has many failure reportspublic function reportes(): HasMany{ return $this->hasMany(Reporte::class, 'activo_id');}
use App\Models\Activo;use App\Enums\EstadoActivo;// Get all operational assets$operationalAssets = Activo::where('estado', EstadoActivo::OPERATIVO)->get();// Get assets with their article info$assetsWithArticles = Activo::with('articulo')->get();// Find asset by ID with all relationships$asset = Activo::with([ 'articulo', 'ubicacion', 'mantenimientos', 'reportes', 'calendarioMantenimientos'])->findOrFail($id);// Filter by location$buildingAssets = Activo::whereHas('ubicacion', function($query) { $query->where('edificio', 'Edificio A');})->get();