<?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('loan_type_master', function (Blueprint $table) {

            $table->bigIncrements('LT_Id');

            $table->string('LT_Code', 20)->nullable();
            $table->string('LT_Name', 50);

            $table->decimal('Max_Amount', 15, 2)->nullable();

            // IN / OUT
            $table->string('Loan_Mode', 10)->nullable();

            $table->decimal('Interest_Rate', 5, 2)->nullable();

            $table->integer('Tenure_Years')->nullable();

            $table->boolean('Is_Active')->default(1);

            $table->timestamps();
            $table->softDeletes();

            // Index
            $table->index('LT_Name');
        });
    }

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