<?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::table('invoices', function (Blueprint $table) {
            $table->decimal('month_revenue', 15, 2)->nullable()->after('allocation_month');
            $table->decimal('month_expenses', 15, 2)->nullable()->after('month_revenue');
            $table->decimal('month_net_profit', 15, 2)->nullable()->after('month_expenses');
            $table->decimal('sweep_percentage', 5, 2)->nullable()->after('month_net_profit');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('invoices', function (Blueprint $table) {
            $table->dropColumn(['month_revenue', 'month_expenses', 'month_net_profit', 'sweep_percentage']);
        });
    }
};
