<?php

namespace App\Models;

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

class Booking extends Model
{
    protected $fillable = [
        'name',
        'email',
        'phone',
        'pickup_date',
        'pickup_time',
        'dropoff_date',
        'dropoff_time',
        'special_requests',
        'status',
        'vehicle_id'
    ];

    protected $casts = [
        'pickup_date' => 'date',
        'dropoff_date' => 'date',
        'pickup_time' => 'datetime:H:i',
        'dropoff_time' => 'datetime:H:i',
    ];

    public function vehicle(): BelongsTo
    {
        return $this->belongsTo(Vehicle::class);
    }
}
