<?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('owner_master', function (Blueprint $table) {
            $table->id('Owner_ID');
            $table->string('Owner_Code', 30)->unique();

            $table->enum('Owner_Type', [
                'Individual',
                'Company',
                'Trust',
                'Government',
                'Society'
            ])->default('Individual');

            $table->string('Full_Name', 200);
            $table->string('Father_Spouse', 200)->nullable();

            $table->enum('Gender', [
                'Male',
                'Female',
                'Other',
                'NA'
            ])->default('NA');

            $table->date('DOB')->nullable();

            $table->string('Mobile_1', 15);
            $table->string('Mobile_2', 15)->nullable();
            $table->string('Email', 150)->nullable();

            $table->string('Aadhar_No', 20)->nullable();
            $table->string('PAN_No', 15)->nullable();
            $table->string('GST_No', 20)->nullable();

            $table->string('Address_Line1', 255);
            $table->string('Address_Line2', 255)->nullable();

            $table->string('City', 100)->nullable();
            $table->string('State', 100)->nullable();
            $table->string('Pincode', 10)->nullable();

            $table->boolean('Is_Senior')->default(0);
            $table->boolean('Is_Disabled')->default(0);
            $table->boolean('Is_ExServiceman')->default(0);
            $table->boolean('Is_Woman_Owner')->default(0);

            $table->enum('KYC_Status', [
                'Pending',
                'Verified',
                'Rejected'
            ])->default('Pending');

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

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