<?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();
            $table->bigInteger('en_id');
            $table->enum('plan_type', ['normal', 'group'])->default('group');
            $table->enum('deposit_mode', ['monthly','annually'])->default('monthly');
            $table->string('effective_date')->nullable();
            $table->string('deposit_code')->nullable();
            $table->string('maturity_date')->nullable();
            $table->enum('quote_based', ['yes', 'no'])->default('no');
            $table->integer('no_of_unit');
            $table->double('deposit_amount', 8,2)->nullable();
            $table->enum('benificiary_insurance', ['yes','no'])->default('no');
            $table->enum('illness_insurance', ['yes','no'])->default('no');
            $table->enum('protection_insurance', ['yes','no'])->default('no');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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