feat(Analyzer): refactor analyzer and implement auto mode

This commit is contained in:
2026-08-09 21:01:38 +02:00
parent 5475c3ac51
commit b57cc9894c
31 changed files with 3425 additions and 0 deletions
@@ -0,0 +1,33 @@
using FinlyticAnalyzer.Entities;
using Microsoft.EntityFrameworkCore;
namespace FinlyticAnalyzer.Database;
public class AnalyzerDbContext : DbContext
{
public AnalyzerDbContext(DbContextOptions<AnalyzerDbContext> options) : base(options) { }
public DbSet<AnalysisEntity> Analyses => Set<AnalysisEntity>();
public DbSet<AnalyzerSettingsEntity> Settings => Set<AnalyzerSettingsEntity>();
public DbSet<TradeProposalEntity> TradeProposals => Set<TradeProposalEntity>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<AnalysisEntity>(entity =>
{
entity.HasIndex(e => e.AnalysisId).IsUnique();
entity.HasIndex(e => e.EventId);
entity.HasIndex(e => e.Isin);
entity.HasIndex(e => e.Sector);
entity.HasIndex(e => e.CreatedAt);
});
modelBuilder.Entity<TradeProposalEntity>(entity =>
{
entity.HasIndex(e => e.Isin);
entity.HasIndex(e => e.ExpiresAt);
});
}
}