using Predictalytics.Domain.Enums;

namespace Predictalytics.Domain.Entities;

/// <summary>
/// An alert triggered by the system based on configurable rules.
/// </summary>
public class Alert
{
    public int Id { get; set; }

    /// <summary>Type of alert.</summary>
    public AlertType Type { get; set; }

    /// <summary>Platform where the triggering event occurred.</summary>
    public PlatformType Platform { get; set; }

    /// <summary>Optional reference to the trader who triggered this alert.</summary>
    public int? TraderId { get; set; }

    /// <summary>Alert title / headline.</summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>Detailed message describing the alert.</summary>
    public string Message { get; set; } = string.Empty;

    /// <summary>Severity: 1=Low, 2=Medium, 3=High, 4=Critical.</summary>
    public int Severity { get; set; } = 1;

    /// <summary>Whether the alert has been read/acknowledged.</summary>
    public bool IsRead { get; set; }

    /// <summary>When the alert was created.</summary>
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    // Navigation
    public Trader? Trader { get; set; }
}
