<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateVehicleRequest extends FormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'vehicle_name' => 'required|max:255',
            'type' => 'required|max:255',
            'year_model' => 'required|integer|min:1990|max:2100',
            'capacity' => 'required|integer|min:1',
            'fuel_type' => 'required|max:255',
            'status' => 'required|in:available,in_use,maintenance,pending_return',
            'image' => 'nullable|image|mimes:jpg,jpeg,png|max:2048'
        ];
    }
}