<?php

namespace Modules\VetAdmission\Entities;

use Illuminate\Database\Eloquent\Model;

class VaMedicationAdministration extends Model
{
    protected $table = 'va_medication_administrations';
    protected $guarded = ['id'];

    protected $casts = [
        'due_at'          => 'datetime',
        'administered_at' => 'datetime',
    ];

    public function medication()
    {
        return $this->belongsTo(VaAdmissionMedication::class, 'admission_medication_id');
    }

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