<?php

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

/**
 * Add currency column to payment_configurations table.
 *
 * Allows super managers and managers to configure the payment currency
 * (SSP = South Sudanese Pound, USD = US Dollar) via the admin panel.
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('payment_configurations', function (Blueprint $table) {
            $table->enum('currency', ['SSP', 'USD'])
                ->default('SSP')
                ->after('environment')
                ->comment('Payment currency: SSP (South Sudanese Pound) or USD (US Dollar)');
        });
    }

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