<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
      public function up()
    {
        Schema::create('appointments', function (Blueprint $table) {
            $table->id();
            $table->string('first_name');
            $table->string('last_name');
            $table->string('email')->nullable(); // facultatif si tu veux
            $table->string('subject');
            $table->text('message')->nullable();
            $table->datetime('requested_at')->nullable(); // date choisie par l'user
            $table->integer('duration_minutes')->default(30); // durée par défaut
            $table->enum('status', ['pending','confirmed','rejected'])->default('pending');
            $table->datetime('scheduled_at')->nullable(); // date finale fixée par admin
            $table->text('admin_note')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('appointments');
    }
};
