<?php

namespace App\Http\Requests\DataEntry;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'id' => ['required'],
            'districtid' => ['required'],
            'subcountyid' => ['required'],
            'parishid' => ['required'],
            'village' => ['nullable', 'string', 'max:100'],
            'incident_date' => ['required', 'date'],
            'incident_time' => ['required'],
            'reported_by' => ['required'],
            'reportedbycontact' => ['nullable', 'string', 'max:50'],
            'incidentid' => ['required', 'array', 'min:1'],
            'incidentid.*' => ['required'],
            'notes' => ['nullable', 'string'],
        ];
    }
}
