refactor(assets): update asset entity mappings, database migrations, and MQTT RPC handlers
This commit is contained in:
@@ -0,0 +1,298 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticAssets.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticAssets.Migrations
|
||||
{
|
||||
[DbContext(typeof(AssetsDbContext))]
|
||||
[Migration("20260818185753_Init")]
|
||||
partial class Init
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("AssetEntityTagEntity", b =>
|
||||
{
|
||||
b.Property<string>("TagsId")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AssetsIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AssetsInstrumentCategory")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("TagsId", "AssetsIsin", "AssetsInstrumentCategory");
|
||||
|
||||
b.HasIndex("AssetsIsin", "AssetsInstrumentCategory");
|
||||
|
||||
b.ToTable("AssetEntityTagEntity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticAssets.Entities.AssetEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("InstrumentCategory")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AssetType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(13)
|
||||
.HasColumnType("character varying(13)");
|
||||
|
||||
b.Property<bool>("HasCfd")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Isin", "InstrumentCategory");
|
||||
|
||||
b.HasIndex("LastUpdatedAt");
|
||||
|
||||
b.ToTable("TradeRepublicAssets");
|
||||
|
||||
b.HasDiscriminator<string>("AssetType").HasValue("AssetEntity");
|
||||
|
||||
b.UseTphMappingStrategy();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticAssets.Entities.DerivativeEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("character varying(12)");
|
||||
|
||||
b.Property<decimal>("Barrier")
|
||||
.HasColumnType("numeric(18,6)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Currency")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<decimal?>("Delta")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<string>("DerivativeProductCategories")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime?>("Expiry")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<decimal?>("Factor")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<string>("Issuer")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<string>("IssuerDisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<decimal>("Leverage")
|
||||
.HasColumnType("numeric(10,4)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NextGenProductCategoryName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<int>("OptionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("ProductCategoryName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<decimal?>("Size")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal>("Strike")
|
||||
.HasColumnType("numeric(18,6)");
|
||||
|
||||
b.Property<string>("UnderlyingIsin")
|
||||
.IsRequired()
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("character varying(12)");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.HasIndex("LastUpdatedAt");
|
||||
|
||||
b.HasIndex("Leverage");
|
||||
|
||||
b.HasIndex("OptionType");
|
||||
|
||||
b.HasIndex("UnderlyingIsin");
|
||||
|
||||
b.ToTable("Derivatives");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticAssets.Entities.TagEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TradeRepublicTags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticCore.Entities.Settings.SettingEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("ServiceIdentifier")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<string>("ValueJson")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticAssets.Entities.EtfEntity", b =>
|
||||
{
|
||||
b.HasBaseType("FinlyticAssets.Entities.AssetEntity");
|
||||
|
||||
b.Property<string>("DerivativeProductCategories")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EtfDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("MappedEtfIndexName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SearchSubtitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Subtitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasDiscriminator().HasValue("Etf");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticAssets.Entities.StockEntity", b =>
|
||||
{
|
||||
b.HasBaseType("FinlyticAssets.Entities.AssetEntity");
|
||||
|
||||
b.Property<string>("DerivativeProductCategories")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.ToTable("TradeRepublicAssets", t =>
|
||||
{
|
||||
t.Property("DerivativeProductCategories")
|
||||
.HasColumnName("StockEntity_DerivativeProductCategories");
|
||||
});
|
||||
|
||||
b.HasDiscriminator().HasValue("Stock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticAssets.Entities.SyntheticEntity", b =>
|
||||
{
|
||||
b.HasBaseType("FinlyticAssets.Entities.AssetEntity");
|
||||
|
||||
b.Property<string>("DerivativeProductCategories")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.ToTable("TradeRepublicAssets", t =>
|
||||
{
|
||||
t.Property("DerivativeProductCategories")
|
||||
.HasColumnName("SyntheticEntity_DerivativeProductCategories");
|
||||
});
|
||||
|
||||
b.HasDiscriminator().HasValue("Synthetic");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AssetEntityTagEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticAssets.Entities.TagEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("TagsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FinlyticAssets.Entities.AssetEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("AssetsIsin", "AssetsInstrumentCategory")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user