using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace Managing.Infrastructure.Databases.PostgreSql.Entities;

[Table("AgentSummaries")]
[Index(nameof(AgentName), IsUnique = true)]
[Index(nameof(UserId), IsUnique = true)]
public class AgentSummaryEntity
{
    [Key]
    [Required] public int Id { get; set; }
    [Required] public required int UserId { get; set; }
    [Required] [MaxLength(255)] public required string AgentName { get; set; }
    public decimal TotalPnL { get; set; }
    public decimal TotalROI { get; set; }
    public int Wins { get; set; }
    public int Losses { get; set; }
    public DateTime? Runtime { get; set; }
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
    public int ActiveStrategiesCount { get; set; }
    public decimal TotalVolume { get; set; }
    public decimal TotalBalance { get; set; }
    public decimal TotalFees { get; set; }
    public decimal NetPnL { get; set; }
    public int BacktestCount { get; set; }
    
    // Navigation property
    public UserEntity User { get; set; }
} 