<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Concerns\HasUuids;

class TimeseriesAlertMessage extends Model
{
    use HasFactory, HasUuids;

    protected $table = 'timeseries_alert_messages';

    protected $primaryKey = 'id';
    public $incrementing = false;
    protected $keyType = 'string';

    protected $fillable = [
        'timeseries_key_master_xid',
        'min_value',
        'max_value',
        'color_code',
        'alert_msg',
    ];

    public function timeseriesKeyMaster()
    {
        return $this->belongsTo(TimeseriesKeyMaster::class, 'timeseries_key_master_xid', 'id');
    }
}