<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('bank_data', function (Blueprint $table) {
            $table->id();
            $table->text('address')->nullable();
            $table->string('village_code')->nullable();
            $table->string('district_code')->nullable();
            $table->string('city_code')->nullable();
            $table->string('province_code')->nullable();
            $table->integer('tahun')->nullable();
            $table->decimal('luas_tanah', 15, 2)->nullable();
            $table->decimal('luas_bangunan', 15, 2)->nullable();
            $table->integer('tahun_bangunan')->nullable();
            $table->string('status_nara_sumber')->nullable();
            $table->decimal('harga', 15, 2)->nullable();
            $table->decimal('harga_diskon', 15, 2)->nullable();
            $table->decimal('diskon', 5, 2)->nullable();
            $table->decimal('total', 15, 2)->nullable();
            $table->string('nama_nara_sumber')->nullable();
            $table->string('peruntukan')->nullable();
            $table->string('penawaran')->nullable();
            $table->string('telepon')->nullable();
            $table->string('hak_properti')->nullable();
            $table->decimal('kordinat_lat', 10, 8)->nullable();
            $table->decimal('kordinat_lng', 11, 8)->nullable();
            $table->string('jenis_aset')->nullable();
            $table->string('foto_objek')->nullable();
            $table->date('tanggal')->nullable();
            $table->decimal('harga_penawaran', 15, 2)->nullable();
            $table->string('nomor_laporan')->nullable();
            $table->date('tgl_final_laporan')->nullable();
            $table->decimal('nilai_pasar', 15, 2)->nullable();
            $table->decimal('indikasi_nilai_likuidasi', 15, 2)->nullable();
            $table->decimal('indikasi_nilai_pasar_tanah', 15, 2)->nullable();
            $table->decimal('estimasi_harga_tanah', 15, 2)->nullable();
            $table->decimal('estimasi_harga_bangunan', 15, 2)->nullable();
            $table->decimal('indikasi_nilai_pasar_bangunan', 15, 2)->nullable();
            $table->decimal('indikasi_nilai_pasar_sarana_pelengkap', 15, 2)->nullable();
            $table->decimal('indikasi_nilai_pasar_mesin', 15, 2)->nullable();
            $table->decimal('indikasi_nilai_pasar_kendaraan_alat_berat', 15, 2)->nullable();
            $table->json('photos')->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('bank_data');
    }
};
