<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_refund_orders', function (Blueprint $table) {
            $table->id();
            $table->integer("admin_id")->unsigned()->comment("管理员id");
            $table->integer("order_id")->unsigned()->comment("订单id");
            $table->string('trade_no')->nullable()->comment("订单号");
            $table->string("refund_trade_no")->nullable()->comment("退款单号");
            $table->decimal("total_fee", 9)->default(0)->comment("订单金额");
            $table->decimal("refund_fee", 9)->default(0)->comment("退款金额");
            $table->boolean("is_hook")->default(0)->comment("0：失败，1：成功");
            $table->string("err_msg")->nullable()->comment("失败原因");
            $table->text('remark')->nullable()->comment("退款理由");
            $table->timestamps();
        });
    }

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