<?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(): void
    {
        Schema::create('plans', function (Blueprint $table) {
            $table->id('plan_id');
            $table->string('plan_name', 100);
            $table->boolean('is_active')->default(true);
            $table->text('plan_description')->nullable();
            $table->enum('plan_applicable_for', ['individual', 'family', 'both'])->default('both');
            $table->string('plan_eful_code', 50)->unique()->nullable(); // External/EFUL reference code
            $table->timestamps(); // created_at and updated_at
        });
    }

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