<?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('payments', function (Blueprint $table) {
            $table->enum('payment_method', ['card', 'bank_transfer', 'mobile_money'])->default('card')->after('status');
            $table->foreignId('manual_proof_id')->nullable()->constrained('payment_proofs')->cascadeOnDelete()->after('payment_method');
        });
    }

    public function down(): void
    {
        Schema::table('payments', function (Blueprint $table) {
            $table->dropColumn(['payment_method', 'manual_proof_id']);
        });
    }
};
