<?php

namespace Modules\MedBilling\Entities;

use Illuminate\Database\Eloquent\Model;

/**
 * An item-level claim line (SIFA P4-T1). Mirrors a medbill_charge_item with its
 * claimed and, once adjudicated, approved amount.
 */
class MedbillClaimItem extends Model
{
    protected $table = 'medbill_claim_items';

    protected $guarded = ['id'];

    protected $casts = [
        'claimed_amount'  => 'decimal:4',
        'approved_amount' => 'decimal:4',
    ];

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

    public function chargeItem()
    {
        return $this->belongsTo(MedbillChargeItem::class, 'charge_item_id');
    }
}
