<?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 ContainerType 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 = [
        'container_type_concept_id','sample_type_concept_id', 'additive', 'cap_color', 'volume_ml', 'storage_temp', 'sterile',
        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 sampleType(){
        return $this->belongsTo(Concept::class, 'sample_type_concept_id', 'id');
    }

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


}
