<?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('quotes', function (Blueprint $table) {
            $table->id(); $table->string('quote_number')->unique(); $table->foreignId('customer_id')->nullable()->constrained()->nullOnDelete(); $table->string('customer_name')->nullable(); $table->string('customer_phone')->nullable(); $table->decimal('total',14,2)->default(0); $table->string('currency_code',8)->default('AFN'); $table->date('quote_date'); $table->date('valid_until')->nullable(); $table->enum('status',['draft','sent','accepted','expired'])->default('draft'); $table->text('notes')->nullable(); $table->timestamps();
        });
    }

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