<?php

namespace Modules\VetAdmission\Entities;

use Illuminate\Database\Eloquent\Model;

class VaCareLog extends Model
{
    protected $table = 'va_care_logs';
    protected $guarded = ['id'];

    protected $casts = [
        'care_date' => 'date',
        'done_at'   => 'datetime',
    ];

    public function admission()
    {
        return $this->belongsTo(VaAdmission::class, 'admission_id');
    }

    public function carePlan()
    {
        return $this->belongsTo(VaAdmissionCarePlan::class, 'care_plan_id');
    }

    public function taskType()
    {
        return $this->belongsTo(VaCareTaskType::class, 'care_task_type_id');
    }

    public function doneBy()
    {
        return $this->belongsTo(\App\User::class, 'done_by');
    }
}
