using Predictalytics.Domain.Enums; namespace Predictalytics.Domain.Entities; /// /// Represents a trader on a prediction market platform. /// Identity is composite: PlatformType + PlatformUserId (e.g. wallet address on Polymarket). /// public class Trader { public int Id { get; set; } /// The platform this trader belongs to. public PlatformType Platform { get; set; } /// Platform-specific user identifier (e.g. Ethereum wallet address for Polymarket). public string PlatformUserId { get; set; } = string.Empty; /// Display name / alias (can be auto-discovered or manually set). public string DisplayName { get; set; } = string.Empty; /// Optional notes about the trader. public string? Notes { get; set; } /// Whether this trader was auto-discovered or manually added. public bool IsAutoDiscovered { get; set; } /// Current tier classification. public TraderTier Tier { get; set; } = TraderTier.Unknown; /// Classified strategy type from deep-dive analysis. public StrategyType Strategy { get; set; } = StrategyType.Unknown; /// Whether the trader shows bot-like behavior. public bool IsSuspectedBot { get; set; } /// Manual priority override (null = use calculated score). public int? ManualPriorityOverride { get; set; } /// When this trader was first tracked. public DateTime CreatedAt { get; set; } = DateTime.UtcNow; /// When data was last polled for this trader. public DateTime? LastPolledAt { get; set; } /// When the trader's trade history was last fully synced. Used for cooldown. public DateTime? LastTradesUpdatedAt { get; set; } /// Whether the initial full historical trade import is complete. public bool IsInitialImportComplete { get; set; } /// When the API first returned an error (e.g. 404 for deleted account). public DateTime? LastApiErrorAt { get; set; } /// Total estimated PnL across all resolved markets. public decimal TotalPnl { get; set; } /// Win rate as a percentage (0-100). public decimal WinRate { get; set; } /// AI-generated strategy summary based on trade history. public string? AiStrategySummary { get; set; } /// When the AI strategy summary was last updated. public DateTime? AiStrategyUpdatedAt { get; set; } /// When the TraderAnalyticsWorker last performed a deep dive on this trader. public DateTime? LastAnalyzedAt { get; set; } /// Total number of trades tracked. public int TotalTrades { get; set; } // Navigation properties public ICollection Trades { get; set; } = new List(); public TraderScore? CurrentScore { get; set; } public virtual TraderAnalytics? Analytics { get; set; } public ICollection WatchlistEntries { get; set; } = new List(); public ICollection Positions { get; set; } = new List(); public ICollection CategoryPerformances { get; set; } = new List(); }