<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class LeasingRecord extends Model
{
    use \Illuminate\Database\Eloquent\Factories\HasFactory;

    protected $fillable = [
        'leasing_profile_id', 'branch_id', 'upload_id', 'tgl_data', 
        'nopol', 'rangka', 'mesin', 'model', 'kendaraan', 
        'customer_name', 'customer_phone', 'customer_address', 
        'overdue_days', 'sisa_saldo', 'legal_flag', 
        'member_warning', 'member_instruction', 'internal_note', 'record_status'
    ];

    public function leasingProfile()
    {
        return $this->belongsTo(LeasingProfile::class);
    }

    public function branch()
    {
        return $this->belongsTo(Branch::class);
    }

    public function upload()
    {
        return $this->belongsTo(LeasingDataUpload::class, 'upload_id');
    }
}
