<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class LoanLossProvision extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'id',
        'branch_id',
        'currency_id',
        'client_id',
        'co_id',
        'loan_id',
        'installment_date',
        'loan_out',
        'loan_balance',
        'date_late',
        'loss_provision_date',
        'count_day_date',
        'amount_late',
        'amount_loss_provision',
        'type_loan_loss_provision',
    ];

    public function client()
    {
      return $this->belongsTo(Client::class, 'client_id');
    }
    public function co()
    {
        return $this->belongsTo(User::class, 'co_id');
    }

    public function loan()
    {
      return $this->belongsTo(Loan::class, 'loan_id');
    }
}