using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Managing.Infrastructure.Databases.PostgreSql.Entities;

[Table("Traders")]
public class TraderEntity
{
    [Key]
    public int Id { get; set; }
    
    [Required]
    [MaxLength(255)]
    public string Address { get; set; }
    
    public int Winrate { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal Pnl { get; set; }
    
    public int TradeCount { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal AverageWin { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal AverageLoss { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal Roi { get; set; }
    
    /// <summary>
    /// Indicates whether this is a best trader (true) or bad trader (false)
    /// This allows us to use one table for both types
    /// </summary>
    public bool IsBestTrader { get; set; }
    
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
} 