using System.ComponentModel.DataAnnotations.Schema;
using static Managing.Common.Enums;

namespace Managing.Infrastructure.Databases.PostgreSql.Entities;

[Table("GeneticRequests")]
public class GeneticRequestEntity
{
    public int Id { get; set; }
    public string RequestId { get; set; }
    public int? UserId { get; set; }
    public DateTime CreatedAt { get; set; }
    public DateTime? CompletedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }
    public string Status { get; set; } // GeneticRequestStatus as string
    public Ticker Ticker { get; set; }
    public Timeframe Timeframe { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public decimal Balance { get; set; }
    public int PopulationSize { get; set; }
    public int Generations { get; set; }
    public double MutationRate { get; set; }
    public GeneticSelectionMethod SelectionMethod { get; set; }
    public GeneticCrossoverMethod CrossoverMethod { get; set; }
    public GeneticMutationMethod MutationMethod { get; set; }
    public int ElitismPercentage { get; set; }
    public double MaxTakeProfit { get; set; }
    public string? EligibleIndicatorsJson { get; set; } // Store List<IndicatorType> as JSON
    public double? BestFitness { get; set; }
    public string? BestIndividual { get; set; }
    public string? ErrorMessage { get; set; }
    public string? ProgressInfo { get; set; }
    public string? BestChromosome { get; set; }
    public double? BestFitnessSoFar { get; set; }
    public int CurrentGeneration { get; set; }
    
    // Navigation properties
    public UserEntity? User { get; set; }
} 