//
using System;
using FinlyticEngine.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticEngine.Migrations
{
[DbContext(typeof(EngineDbContext))]
partial class EngineDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("FinlyticCore.Entities.Settings.SettingEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Key")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property("LastUpdatedUtc")
.HasColumnType("timestamp with time zone");
b.Property("ServiceIdentifier")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property("ValueJson")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("DynamicSettings");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineEvaluationSnapshotEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AiThesisSummary")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.Property("CompositeOpportunityScore")
.HasColumnType("decimal(6,2)");
b.Property("DaysToNextEarnings")
.HasColumnType("integer");
b.Property("DaysToNextExDividend")
.HasColumnType("integer");
b.Property("EvaluatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("FundamentalScore")
.HasColumnType("decimal(6,2)");
b.Property("Isin")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("OutcomeReason")
.HasColumnType("integer");
b.Property("PassedAiValidation")
.HasColumnType("boolean");
b.Property("PassedDividendGate")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(true);
b.Property("PassedEarningsLockout")
.HasColumnType("boolean");
b.Property("PassedSimulationVeto")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(true);
b.Property("ProposalId")
.HasColumnType("uuid");
b.Property("ReliabilityBonus")
.HasColumnType("decimal(6,2)");
b.Property("SentimentScore")
.HasColumnType("decimal(6,2)");
b.Property("Symbol")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property("TechnicalScore")
.HasColumnType("decimal(6,2)");
b.Property("TriggerSource")
.HasColumnType("integer");
b.Property("TriggeredByUserId")
.HasColumnType("uuid");
b.Property("UniverseEnteredAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("UniverseSource")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CompositeOpportunityScore");
b.HasIndex("Isin", "EvaluatedAtUtc");
b.HasIndex("OutcomeReason", "EvaluatedAtUtc");
b.HasIndex("TriggerSource", "EvaluatedAtUtc");
b.ToTable("engine_evaluation_snapshots");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineScanCycleEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CandidateIsins")
.IsRequired()
.HasColumnType("jsonb");
b.Property("CandidatesReturnedCount")
.HasColumnType("integer");
b.Property("CycleStartedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("RequestedLimit")
.HasColumnType("integer");
b.Property("RequestedMinScore")
.HasColumnType("decimal(6,2)");
b.HasKey("Id");
b.HasIndex("CycleStartedAtUtc");
b.ToTable("engine_scan_cycles");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineTradeEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AverageBuyIn")
.HasColumnType("decimal(18,4)");
b.Property("ClosedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("CurrentPrice")
.HasColumnType("decimal(18,4)");
b.Property("CurrentStopLoss")
.HasColumnType("decimal(18,4)");
b.Property("DerivativeIsin")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("DerivativeWkn")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("Direction")
.HasColumnType("integer");
b.Property("ExecutionMode")
.HasColumnType("integer");
b.Property("ExitPlan")
.IsRequired()
.HasColumnType("jsonb");
b.Property("InitialStopLoss")
.HasColumnType("decimal(18,4)");
b.Property("InstrumentType")
.HasColumnType("integer");
b.Property("LastUpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("OpenedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("ProposalId")
.HasColumnType("uuid");
b.Property("RealizedPnlEur")
.HasColumnType("decimal(18,4)");
b.Property("ScoreBreakdownJson")
.IsRequired()
.HasColumnType("text");
b.Property("Status")
.HasColumnType("integer");
b.Property("Symbol")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property("TakeProfit1")
.HasColumnType("decimal(18,4)");
b.Property("TakeProfit2")
.HasColumnType("decimal(18,4)");
b.Property("TakeProfitRunner")
.HasColumnType("decimal(18,4)");
b.Property("TotalFeesEur")
.HasColumnType("decimal(18,4)");
b.Property("TotalQuantity")
.HasColumnType("decimal(18,4)");
b.Property("UnderlyingIsin")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("OpenedAtUtc");
b.HasIndex("Status", "UnderlyingIsin");
b.HasIndex("UserId", "ProposalId")
.IsUnique()
.HasFilter("\"ProposalId\" <> '00000000-0000-0000-0000-000000000000'");
b.HasIndex("UserId", "Status");
b.ToTable("engine_trades");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineTradeFillEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ExecutedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Fee")
.HasColumnType("decimal(18,4)");
b.Property("Note")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property("Price")
.HasColumnType("decimal(18,4)");
b.Property("Quantity")
.HasColumnType("decimal(18,4)");
b.Property("TradeId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("TradeId", "ExecutedAtUtc");
b.ToTable("engine_trade_fills");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineTradeProposalEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AiValidation")
.IsRequired()
.HasColumnType("jsonb");
b.Property("CompositeScore")
.HasColumnType("decimal(6,2)");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("CurrentPrice")
.HasColumnType("decimal(18,4)");
b.Property("Direction")
.HasColumnType("integer");
b.Property("EntryPrice")
.HasColumnType("decimal(18,4)");
b.Property("ExitPlan")
.IsRequired()
.HasColumnType("jsonb");
b.Property("ExpiresAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("IsActive")
.HasColumnType("boolean");
b.Property("QualityScore")
.HasColumnType("decimal(6,2)");
b.Property("RiskRewardRatio")
.HasColumnType("decimal(8,2)");
b.Property("SelectedDerivative")
.HasColumnType("jsonb");
b.Property("StopLoss")
.HasColumnType("decimal(18,4)");
b.Property("StrategyKey")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property("Symbol")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property("TakeProfit1")
.HasColumnType("decimal(18,4)");
b.Property("UnderlyingIsin")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.HasKey("Id");
b.HasIndex("CompositeScore");
b.HasIndex("CreatedAtUtc");
b.HasIndex("UnderlyingIsin", "IsActive", "ExpiresAtUtc");
b.ToTable("engine_trade_proposals");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineTradeFillEntity", b =>
{
b.HasOne("FinlyticEngine.Database.Entities.EngineTradeEntity", "Trade")
.WithMany("Fills")
.HasForeignKey("TradeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Trade");
});
modelBuilder.Entity("FinlyticEngine.Database.Entities.EngineTradeEntity", b =>
{
b.Navigation("Fills");
});
#pragma warning restore 612, 618
}
}
}