<?php

namespace App\Models;
use App\Enums\RecordStatusEnum;
use App\Models\Traits\HasLocalizedName;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Support\Facades\Session;
use App\Traits\AuditLogTrait;

class Pathogen extends BaseModel
{
    public $timestamps = false;
    use HasFactory;
    use HasLocalizedName;
    use AuditLogTrait;
    /**
     * The table associated with the model.
     *
     * @var string
     */

    protected $appends = ['name'];

    protected $primaryKey = 'id';

    protected $fillable = [
        'pathogen_category_concept_id','scientific_name', 'common_name', 'risk_group_concept_id',
        'biosafety_level_concept_id', 'infectious_dose', 'transmission_mode', 'storage_requirement', 'min_temp', 'max_temp',
        BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
        BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
    ];

    public static function boot()
    {
        parent::boot();
    }

    public function pathogenType(){
        return $this->belongsTo(Concept::class, 'pathogen_category_concept_id', 'id');
    }

    public function riskGroup(){
        return $this->belongsTo(Concept::class, 'risk_group_concept_id', 'id');
    }

    public function bsl(){
        return $this->belongsTo(Concept::class, 'biosafety_level_concept_id', 'id');
    }


}
