<?php

namespace App\Http\Requests\DataEntry;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'crb_number' => ['required', 'string', 'max:100'],
            'interview_date' => ['required', 'date'],
            'interview_time' => ['required', 'string', 'max:25'],
            'districtid' => ['required'],
            'subcountyid' => ['required'],
            'parishid' => ['required'],
            'village' => ['nullable', 'string', 'max:100'],
            'survivor_code' => ['required', 'string', 'max:100'],
            'sex' => ['required'],
            'nationality' => ['required'],
            'idtype' => ['nullable'],
            'id_number' => ['nullable', 'string', 'max:50'],
            'age' => ['required', 'numeric', 'min:0', 'max:130'],
            'national_status' => ['nullable'],
            'ns_categornsy' => ['nullable'],
            'number_children' => ['nullable', 'integer', 'min:0'],
            'religion' => ['required'],
            'marital_status' => ['required'],
            'separeted_children' => ['nullable'],
            'pwd' => ['nullable'],
            'disability' => ['nullable'],
            'education' => ['required'],
            'occupation' => ['nullable'],
            'emp_status' => ['nullable'],
            'previos_reporting' => ['nullable', 'string'],
            'reporter_sex' => ['required'],
            'reporter_phone' => ['nullable', 'string', 'max:50'],
            'reporter_email' => ['nullable', 'email', 'max:255'],
            'reporter_relation' => ['nullable', 'string', 'max:255'],
            'reporter_type' => ['required', 'string', 'max:255'],
            'reffered' => ['nullable'],
        ];
    }
}
