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

use Illuminate\Foundation\Http\FormRequest;

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

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