<?php

namespace App\Models;

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

class Alert extends Model
{
    use HasFactory;

    protected $table = 'alerts';

    protected $fillable = [
        'user_id',
        'external_id',
        'dedupe_key',
        'source',
        'type',
        'severity',
        'status',
        'title',
        'message',
        'event_date',
        'entity',
        'actions',
        'meta',
        'notes',
        'mute_until',
    ];

    protected $casts = [
        'event_date' => 'date:Y-m-d',
        'mute_until' => 'datetime',
        'entity' => 'array',
        'actions' => 'array',
        'meta' => 'array',
        'notes' => 'array',
    ];
}
