<?php

namespace Modules\VetAdmission\Entities;

use Illuminate\Database\Eloquent\Model;

class VaAdmissionCarePlan extends Model
{
    protected $table = 'va_admission_care_plan';
    protected $guarded = ['id'];

    protected $casts = [
        'schedule_times' => 'array',
        'active'         => 'boolean',
    ];

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

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

    public function logs()
    {
        return $this->hasMany(VaCareLog::class, 'care_plan_id');
    }
}
