feat(trades): add live execution cockpit, closing cockpit, calculation cards and precision trade settings

This commit is contained in:
2026-08-15 19:30:25 +02:00
parent 882d24a316
commit 34fa774cbf
31 changed files with 4235 additions and 630 deletions
@@ -23,6 +23,19 @@ public class TradesDbContext : DbContext
entity.HasIndex(e => e.Key);
});
var stringListConverter =
new Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter<List<string>, string>(
v => System.Text.Json.JsonSerializer.Serialize(v, (System.Text.Json.JsonSerializerOptions?)null),
v => System.Text.Json.JsonSerializer.Deserialize<List<string>>(v,
(System.Text.Json.JsonSerializerOptions?)null) ?? new List<string>()
);
var stringListComparer = new Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer<List<string>>(
(c1, c2) => c1 != null && c2 != null ? c1.SequenceEqual(c2) : c1 == c2,
c => c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())),
c => c.ToList()
);
modelBuilder.Entity<TradeEntity>(entity =>
{
entity.HasIndex(e => e.TradeId).IsUnique();
@@ -32,6 +45,9 @@ public class TradesDbContext : DbContext
entity.HasIndex(e => e.Sector);
entity.HasIndex(e => e.Isin);
entity.HasIndex(e => e.CreatedAt);
entity.Property(e => e.DerivativeProductCategories)
.HasConversion(stringListConverter, stringListComparer);
});
modelBuilder.Entity<TradeHourlyUpdateEntity>(entity =>