<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Paciente extends Model
{
    protected $fillable = [
        'nombres',
        'apellidos',
        'sexo',
        'activo',
    ];

    protected $casts = [
        'activo' => 'boolean',
    ];

    public function mediciones(): HasMany
    {
        return $this->hasMany(Medicion::class);
    }

    public function getNombreCompletoAttribute(): string
    {
        return "{$this->nombres} {$this->apellidos}";
    }
}
