<?php

namespace App\Http\Requests\V3\RoadObservation;

use Illuminate\Foundation\Http\FormRequest;

class ReferRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return $this->roadObserved->rms_status == 0;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'edarate_shahri_id' => 'required|exists:edarate_shahri,id',
            'province_id' => 'required|exists:provinces,id',
            'refer_description' => 'required|string',
        ];
    }
}
