<?php

namespace Modules\ClinicCore\Entities;

use Illuminate\Database\Eloquent\Model;
use App\Contact;

class ClcBirthDeathRecord extends Model
{
    protected $table = 'clc_birth_death_records';
    protected $guarded = ['id'];

    protected $casts = [
        'event_date' => 'date',
    ];

    public function pet()
    {
        return $this->belongsTo(ClcPatient::class, 'patient_id');
    }

    public function owner()
    {
        return $this->belongsTo(Contact::class, 'contact_id');
    }

    public function doctor()
    {
        return $this->belongsTo(ClcDoctor::class, 'doctor_id');
    }
}
