<?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('enquiries', function (Blueprint $table) {
            $table->id();
            $table->string('name', 255);
            $table->string('phone', 30);
            $table->string('email', 255)->nullable();
            $table->string('subject', 500)->nullable();
            $table->text('message');
            $table->enum('buyer_type', ['retail','wholesale','nepal_export','other']);
            $table->string('company_name', 255)->nullable();
            $table->string('city_district', 255)->nullable();
            $table->text('product_interest')->nullable();
            $table->string('monthly_quantity', 100)->nullable();
            $table->string('heard_from', 100)->nullable();
            $table->string('source_page', 100)->nullable();
            $table->string('language', 10)->default('en');
            $table->timestamp('read_at')->nullable();
            $table->timestamp('replied_at')->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('enquiries'); }
};
