<?php

namespace App\Models\Claim;

use App\Models\Institution\Institution;
use App\Models\Institution\InstitutionRecordType;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\Pivot;

class ClaimInstitution extends Pivot {
    protected $table = 'claim_institution';

    public $fillable = [
        'claim_id',
        'institution_id',
        'record_type_id',
        'dates',
    ];

    public function recordType(): BelongsTo {
        return $this->belongsTo(InstitutionRecordType::class);
    }

    public function institution(): BelongsTo {
        return $this->belongsTo(Institution::class);
    }

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