<?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('bank_withdrawals', function (Blueprint $table) {
            $table->id();
            $table->date('withdrawal_date');
            $table->decimal('amount', 15, 2);
            $table->foreignId('currency_id')->nullable()->constrained()->nullOnDelete();
            $table->string('bank_account')->nullable(); // e.g. "Card Sales Account", "Main Account"
            $table->string('reference')->nullable();
            $table->text('notes')->nullable();
            $table->timestamps();
        });
    }

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