using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using FinlyticCore.Models.Analyzer; namespace FinlyticAnalyzer.Entities; /// /// Persisted raw news, market context, AI prompt payload & response in PostgreSQL. /// [Table("analyses")] public class AnalysisEntity { [Key] public Guid Id { get; set; } = Guid.NewGuid(); [Required] [MaxLength(100)] public string AnalysisId { get; set; } = string.Empty; [Required] [MaxLength(100)] public string EventId { get; set; } = string.Empty; [Required] [MaxLength(50)] public string Sector { get; set; } = string.Empty; [Required] [MaxLength(30)] public string Symbol { get; set; } = string.Empty; [Required] [MaxLength(30)] public string Isin { get; set; } = string.Empty; public VixMarketRegime VixRegime { get; set; } public decimal VixValue { get; set; } public double ImpactScore { get; set; } public double WinRate { get; set; } [Column(TypeName = "jsonb")] public string RawDataJson { get; set; } = "{}"; [Column(TypeName = "jsonb")] public string AiOutputJson { get; set; } = "{}"; [Column(TypeName = "jsonb")] public string N8nResponseJson { get; set; } = "{}"; public double N8nEvalScore { get; set; } [MaxLength(30)] public string N8nDecision { get; set; } = string.Empty; public bool IsTradeProposed { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; }