<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Altek\Accountant\Contracts\Recordable;

class RequestLogBenefit extends Model
{
    use HasFactory;

    protected $table = 'request_log_benefits';

    public $fillable = [
        'request_log_id',
        'benefit_id',
        'amount_incurred',
        'amount_approved',
        'amount_not_approved',
        'excess_paid',
        'keterangan',
        'created_by',
        'updated_by',
        'deleted_by',
    ];

    public function benefit()
    {
        return $this->belongsTo(Benefit::class, 'benefit_id', 'id');
    }

    public function requestLog()
    {
        return $this->belongsTo(RequestLog::class);
    }
}
