<?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_accounts', function (Blueprint $table) {
            $table->id();
            $table->foreignId('coach_id')->unique()->constrained('coaches')->cascadeOnDelete();

            $table->string('account_holder_name', 150);
            $table->string('card_number', 20); // فرمت 16 رقمی کارت بانکی ایران
            $table->string('bank_name', 100)->nullable();
            $table->string('payment_notes', 300)->nullable();

            $table->timestamps();
        });
    }

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