<?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::table('sales', function (Blueprint $table) {
            // Fee que cobra la plataforma origen (ej. Upwork 10%)
            // Se resta del gross_amount para obtener el neto esperado
            $table->decimal('platform_fee', 10, 2)->default(0)->after('gross_amount');
        });
    }

    public function down(): void
    {
        Schema::table('sales', function (Blueprint $table) {
            $table->dropColumn('platform_fee');
        });
    }
};
