<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Sistema extends Model
{
    use HasFactory;

    protected $table = 'sistemas';
    protected $fillable = ['area_id', 'codigo', 'nombre', 'descripcion', 'activo'];
    protected $casts = ['activo' => 'boolean'];

    public function area(): BelongsTo { return $this->belongsTo(Area::class); }
    public function equipos(): HasMany { return $this->hasMany(Equipo::class); }
}
