<?php


// database/migrations/2025_08_26_000000_create_commissions_table.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('commissions', function (Blueprint $table) {
            $table->id();
            $table->foreignId('car_sale_id')->constrained('car_sales')->onDelete('cascade');
            $table->date('date');
            $table->decimal('buyer_commission', 10, 2);
            $table->decimal('seller_commission', 10, 2);
            $table->string('receiver_name');
            $table->string('registration_no');
            $table->string('buyer_name');
            $table->string('seller_name');
            $table->string('owner_name');
            $table->timestamps();
        });
    }

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