<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->decimal('margin_percentage', 5, 2)->default(10.00)->after('base_price');
            // selling_price will be calculated: base_price + (base_price * margin_percentage / 100)
        });
    }

    public function down()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn('margin_percentage');
        });
    }
};
