<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
    use Modules\Lpj\Models\Debiture;

    return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('laporan_admin_kredit', function (Blueprint $table) {
            $table->id();
            $table->foreignIdFor(Debiture::class)->constrained()->cascadeOnDelete();
            $table->string('kode_register_t24')->nullable();
            $table->string('jenis_agunan')->nullable();
            $table->string('bukti_kepemilikan')->nullable();
            $table->text('alamat_agunan')->nullable();
            $table->string('nama_pemilik')->nullable();
            $table->date('tanggal_kunjungan')->nullable();
            $table->decimal('nilai_pasar_wajar', 15, 2)->nullable();
            $table->decimal('nilai_likuidasi', 15, 2)->nullable();
            $table->string('nama_penilai')->nullable();
            $table->timestamps();
            $table->softDeletes();

            $table->unsignedBigInteger('created_by')->nullable();
            $table->unsignedBigInteger('updated_by')->nullable();
            $table->unsignedBigInteger('deleted_by')->nullable();
        });
    }

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