<?php
namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'nom' => 'required|string|max:100',
            'prenom' => 'required|string|max:100',
            'email' => 'required|email|unique:users,email',
            'password' => 'required|string|min:8|confirmed',
            'date_naissance' => 'required|date|before:today',
            'sexe' => 'required|string|in:homme,femme',
            'nationalite' => 'required|string|max:100',
            'telephone' => 'required|string|max:20',
            'type_situation' => 'required|string|in:residente,non_residente',
            'disponibilite' => 'required|string|in:immediate,sous_2_semaines,sous_1_mois',
            'ville_id' => 'required|integer|exists:villes,id,actif,1',
            'quartier_id' => 'nullable|integer|exists:quartiers,id',
        ];
    }
}
