<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->uuid('uuid')->unique()->notNull();
            $table->string('email', 191)->unique()->notNull();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('telephone', 30)->nullable();
            $table->timestamp('telephone_verified_at')->nullable();
            $table->string('password')->notNull();
            $table->enum('role', ['client', 'candidat', 'admin', 'super_admin'])->notNull();
            $table->enum('statut', ['actif', 'suspendu', 'en_attente'])->default('en_attente');
            $table->string('avatar', 255)->nullable();
            $table->rememberToken();
            $table->timestamp('derniere_connexion_at')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('users');
    }
};
