<?php

namespace Modules\Lpj\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LaporanAdminKredit extends Base
{
    protected $table = 'laporan_admin_kredit';

    protected $fillable = [
        'debiture_id',
        'kode_register_t24',
        'jenis_agunan',
        'bukti_kepemilikan',
        'alamat_agunan',
        'nama_pemilik',
        'tanggal_kunjungan',
        'nilai_pasar_wajar',
        'nilai_likuidasi',
        'nama_penilai',
        'keterangan',
        'kolektibilitas'
    ];

    protected $casts = [
        'tanggal_kunjungan' => 'date',
        'nilai_pasar_wajar' => 'decimal:2',
        'nilai_likuidasi' => 'decimal:2',
    ];

    /**
     * Get the debiture that owns the laporan admin kredit.
     */
    public function debiture(): BelongsTo
    {
        return $this->belongsTo(Debiture::class);
    }
}
