<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class VehicleDocumentRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'car_id' => 'required|exists:cars,id',
            'registration_expiry_date' => 'required|date',
            'inspection_date' => 'required|date',
            'inspection_expiry_date' => 'required|date|after_or_equal:inspection_date',
            'registration_document' => 'nullable|file|mimes:jpg,jpeg,png,pdf|max:5120',
            'inspection_document' => 'nullable|file|mimes:jpg,jpeg,png,pdf|max:5120',
            'notes' => 'nullable|string',
        ];
    }
}
