<?php

// database/migrations/2025_01_01_000010_create_withdraw_requests_table.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('withdraw_requests', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            // mobile:bkash, bank:ab-bank
            $table->string('method');
            // যেই একাউন্ট/ফোনে পাঠানো হবে
            $table->string('account_number');
            // শুধু bank method এর জন্য, mobile হলে null
            $table->string('account_holder')->nullable();
            $table->string('branch_name')->nullable();
            $table->integer('amount');
            $table->string('status')->default('pending'); // pending, approved, rejected
            $table->string('trx_id')->nullable();        // admin চাইলে দিবে
            $table->timestamps();
        });

    }

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