<?php

namespace App\Models;

use App\Traits\Blameable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ClaimItem extends Model
{
    use HasFactory, SoftDeletes, Blameable;

    protected $fillable = [
        'claim_id',
        'order',
        'currency',
        'nominal_ditagihkan',
        'nominal_dicover',
        'nominal_total',
    ];

    public function claim()
    {
        return $this->belongsTo(Claim::class, 'claim_id');
    }

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

    public function claim_itemable() 
    {
        return $this->morphTo();
    }
}
