namespace Predictalytics.Domain.Entities;

/// <summary>
/// System-level registry of wallets flagged with the <c>possible_insider</c> trait. This is a
/// global, system-owned list — deliberately separate from per-user <see cref="WatchlistEntry"/>
/// watchlists (which will become user-specific once the product is offered commercially). It backs
/// the dedicated "Insider" view and carries the high-water mark used to de-duplicate activity alerts.
/// </summary>
public class InsiderWatch
{
    public int Id { get; set; }

    /// <summary>Foreign key to the flagged trader (unique — one row per trader).</summary>
    public int TraderId { get; set; }

    /// <summary>When this wallet was first detected as a possible insider.</summary>
    public DateTime FirstDetectedAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// High-water mark for activity alerts: the ExecutedAt of the newest trade already alerted on.
    /// Seeded at detection time so historical (backfilled) trades never trigger a backlog of alerts.
    /// </summary>
    public DateTime LastAlertedTradeAt { get; set; }

    // Navigation
    public Trader Trader { get; set; } = null!;
}
