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

namespace Managing.Infrastructure.Databases.PostgreSql.Entities;

[Table("Indicators")]
public class IndicatorEntity
{
    [Key]
    public int Id { get; set; }
    
    [Required]
    [MaxLength(255)]
    public string Name { get; set; }
    
    public IndicatorType Type { get; set; }
    public Timeframe Timeframe { get; set; }
    public SignalType SignalType { get; set; }
    
    public int MinimumHistory { get; set; }
    public int? Period { get; set; }
    public int? FastPeriods { get; set; }
    public int? SlowPeriods { get; set; }
    public int? SignalPeriods { get; set; }
    public double? Multiplier { get; set; }
    public int? StochPeriods { get; set; }
    public int? SmoothPeriods { get; set; }
    public int? CyclePeriods { get; set; }
    
    public int? UserId { get; set; }
    
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
    
    // Navigation properties
    public UserEntity? User { get; set; }
    
    // Navigation property for the many-to-many relationship with scenarios
    public virtual ICollection<ScenarioIndicatorEntity> ScenarioIndicators { get; set; } = new List<ScenarioIndicatorEntity>();
} 