<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SecurityEvent extends Model
{
    public $timestamps = false;
    public $updatedAt = false;

    protected $fillable = [
        'severity', 'event_type', 'license_key', 'license_id', 'ip_address',
        'domain', 'description', 'payload', 'is_resolved', 'resolved_at', 'created_at',
    ];

    protected $casts = [
        'payload' => 'array',
        'is_resolved' => 'boolean',
        'resolved_at' => 'datetime',
        'created_at' => 'datetime',
    ];

    public function license()
    {
        return $this->belongsTo(License::class);
    }
}
