<?php

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

return new class extends Migration
{
    /**
     * Add the missing amount_due column to training_registrations.
     * This column is referenced in ReportController but was absent from the original migration.
     */
    public function up(): void
    {
        Schema::table('training_registrations', function (Blueprint $table) {
            $table->decimal('amount_due', 10, 2)->default(0.00)->after('amount_paid');
        });
    }

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