<?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::create('withdraw_methods', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('slug')->unique();
            $table->string('image')->nullable();
            $table->string('min')->default(0);
            $table->string('max')->default(0);
            $table->string('percent_charge')->default(0);
            $table->string('fixed_charge')->default(0);
            $table->string('currency', 10)->default('USD');
            $table->text('instructions')->nullable();
            $table->string('description')->nullable();
            $table->longText('fields')->nullable()->comment('json encoded fields and options array');
            $table->enum('status', ['active', 'inactive'])->default('active');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('withdraw_methods');
    }
};
