<?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('businesses', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->cascadeOnDelete();
            $table->string('business_name');
            $table->string('business_short_name')->nullable();
            $table->string('document_inbox')->nullable();
            $table->string('business_type')->nullable();
            $table->string('organization_type')->nullable();
            $table->string('contact_number')->nullable();
            $table->string('registration_number')->nullable();
            $table->string('address')->nullable();
            $table->string('email')->nullable();
            $table->unsignedInteger('country_id')->nullable();
            $table->unsignedInteger('currency_id')->nullable();
            $table->unsignedInteger('state_id')->nullable();
            $table->boolean('is_organization')->default(false);
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });
    }

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