<?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::create('payment_configs', function (Blueprint $table) {
            $table->id();
            $table->string('payment_code', 50)->unique();
            $table->string('payment_name');
            $table->string('provider', 50);
            $table->string('status', 30)->default('disabled')->index();
            $table->boolean('is_sandbox')->default(true);
            $table->boolean('supports_refund')->default(false);
            $table->json('settings')->nullable();
            $table->string('remark')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('payment_configs');
    }
};
