<?php

namespace App\Models;

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

class ServiceBooking extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'name',
        'phone',
        'bike_type',
        'problem_description',
        'preferred_date',
        'image_path',
        'pickup_required',
        'status',
        'additional_notes',
        'estimated_cost',
    ];

    protected $casts = [
        'preferred_date' => 'date',
        'pickup_required' => 'boolean',
        'estimated_cost' => 'decimal:2',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
