<?php

namespace Modules\ClinicCore\Entities;

use Illuminate\Database\Eloquent\Model;

/** One session within a patient's treatment plan. */
class ClcTreatmentSession extends Model
{
    protected $table = 'clc_treatment_plan_sessions';
    protected $guarded = ['id'];

    protected $casts = [
        'session_no'   => 'integer',
        'performed_at' => 'date',
    ];

    public function plan()
    {
        return $this->belongsTo(ClcPatientTreatmentPlan::class, 'plan_id');
    }

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