<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Alert extends Model
{
    protected $table = 'alerts';

    protected $fillable = [
        'feeder_id',
        'type',
        'message',
        'severity',
        'is_resolved'
    ];

    public function feeder()
    {
        return $this->belongsTo(Feeder::class, 'feeder_id');
    }

    public function logs()
    {
        return $this->hasMany(AlertLog::class, 'alert_id');
    }
}