<?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('loan_deposits', function (Blueprint $table) {
            $table->id();
            $table->foreignId('loan_id')->constrained('loans')->onDelete('cascade');

            $table->string('method');          // nagad, bkash, rocket
            $table->integer('amount');         // 500 etc
            $table->string('transaction_id');  // trx id
            $table->string('status')->default('pending'); // pending, approved, rejected

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

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