<?php

namespace App\Http\Requests\Client;

use Illuminate\Foundation\Http\FormRequest;

class StoreClientRequest extends FormRequest
{
    public function authorize(): bool { return true; }

    public function rules(): array
    {
        return [
            'full_name'               => 'required|string|max:255',
            'phone'                   => 'required|string|max:20|unique:clients',
            'email'                   => 'nullable|email|unique:clients',
            'gender'                  => 'nullable|in:male,female,other',
            'date_of_birth'           => 'nullable|date|before:today',
            'address'                 => 'nullable|string',
            'nid_passport'            => 'nullable|string|max:100|unique:clients',
            'emergency_contact_name'  => 'nullable|string|max:255',
            'emergency_contact_phone' => 'nullable|string|max:20',
            'tags'                    => 'nullable|array',
            'tags.*'                  => 'string',
            'notes'                   => 'nullable|string',
            'referred_by'             => 'nullable|string|max:255',
            'photo_path'              => 'nullable|string',
            'nid_photo_path'          => 'nullable|string',
        ];
    }
}
