<?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('transactions', function (Blueprint $table) {
            $table->id();
            $table->string('order_id')->unique();
            $table->string('user_id');
            $table->string('zone_id')->nullable();
            $table->string('game');
            $table->string('nickname')->nullable();
            $table->string('product');
            $table->decimal('price', 10, 2);
            $table->string('payment_method');
            $table->string('status')->default('PENDING'); // PENDING, PAID, PROCESSING, SUCCESS, FAILED
            $table->string('customer_whatsapp')->nullable();
            $table->string('customer_email')->nullable();
            $table->timestamps();
        });
    }

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