<?php

namespace App\Models;

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

class Appointment extends Model
{
    use HasFactory;

    protected $fillable = [
        'client_id',
        'scheduled_at',
        'bike_model',
        'problem_description',
        'status',
        'notes'
    ];

    protected $casts = [
        'scheduled_at' => 'datetime', // Laravel lo convierte a objeto Carbon automáticamente
    ];

    // Relación: Un turno pertenece a un cliente
    public function client()
    {
        return $this->belongsTo(Client::class);
    }
}
