<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Client extends Model
{
    use HasFactory;
    protected $guarded = [];
    protected $fillable = ['name', 'phone', 'email', 'address'];

    // Un usuario (cliente) realiza muchas compras (ventas)
    public function sales()
    {
        return $this->hasMany(Sale::class);
    }


    // Relación: Un cliente tiene muchos turnos
    public function appointments()
    {
        return $this->hasMany(Appointment::class);
    }
}
