feat(Fundamentals): add fundamentals service

This commit is contained in:
2026-08-09 21:01:39 +02:00
parent e0778b88ea
commit 605e41cfeb
21 changed files with 3122 additions and 0 deletions
@@ -0,0 +1,446 @@
// <auto-generated />
using System;
using FinlyticFundamentals.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 FinlyticFundamentals.Migrations
{
[DbContext(typeof(FundamentalsDbContext))]
[Migration("20260801073430_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("FinlyticFundamentals.Entities.AssetFundamentalsEntity", b =>
{
b.Property<string>("Isin")
.HasColumnType("text");
b.Property<string>("BusinessSummary")
.HasColumnType("text");
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ConsensusRating")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("Employees")
.HasColumnType("integer");
b.Property<DateTime?>("ExDividendDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Industry")
.HasColumnType("text");
b.Property<DateTime>("LastStaticUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("NextEarningsDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal?>("PercentHeldByInsiders")
.HasColumnType("numeric");
b.Property<decimal?>("PercentHeldByInstitutions")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetHigh")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetLow")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetMean")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetMedian")
.HasColumnType("numeric");
b.Property<string>("PrimaryTicker")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Sector")
.HasColumnType("text");
b.Property<decimal?>("ShortPercentOfFloat")
.HasColumnType("numeric");
b.Property<decimal?>("ShortRatio")
.HasColumnType("numeric");
b.HasKey("Isin");
b.HasIndex("PrimaryTicker")
.IsUnique();
b.ToTable("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.CompanyExecutiveEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int?>("Age")
.HasColumnType("integer");
b.Property<decimal?>("Compensation")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Isin");
b.ToTable("CompanyExecutives");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.FinancialStatementEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal?>("AccountsReceivable")
.HasColumnType("numeric");
b.Property<decimal?>("CapitalExpenditures")
.HasColumnType("numeric");
b.Property<decimal?>("CashAndCashEquivalents")
.HasColumnType("numeric");
b.Property<decimal?>("CostOfRevenue")
.HasColumnType("numeric");
b.Property<decimal?>("CurrentLiabilities")
.HasColumnType("numeric");
b.Property<decimal?>("Ebitda")
.HasColumnType("numeric");
b.Property<DateTime>("EndDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal?>("EpsBasic")
.HasColumnType("numeric");
b.Property<decimal?>("EpsDiluted")
.HasColumnType("numeric");
b.Property<decimal?>("FinancingCashFlow")
.HasColumnType("numeric");
b.Property<decimal?>("FreeCashFlow")
.HasColumnType("numeric");
b.Property<decimal?>("GrossProfit")
.HasColumnType("numeric");
b.Property<decimal?>("Inventory")
.HasColumnType("numeric");
b.Property<decimal?>("InvestingCashFlow")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<decimal?>("LongTermDebt")
.HasColumnType("numeric");
b.Property<decimal?>("NetIncome")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingCashFlow")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingExpenses")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingIncome")
.HasColumnType("numeric");
b.Property<string>("PeriodType")
.IsRequired()
.HasColumnType("text");
b.Property<decimal?>("TotalCurrentAssets")
.HasColumnType("numeric");
b.Property<decimal?>("TotalLiabilities")
.HasColumnType("numeric");
b.Property<decimal?>("TotalNonCurrentAssets")
.HasColumnType("numeric");
b.Property<decimal?>("TotalRevenue")
.HasColumnType("numeric");
b.Property<decimal?>("TotalStockholdersEquity")
.HasColumnType("numeric");
b.HasKey("Id");
b.HasIndex("Isin");
b.HasIndex("Isin", "PeriodType", "EndDate")
.IsUnique();
b.ToTable("FinancialStatements");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.ForwardEstimateEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal?>("ExpectedEps")
.HasColumnType("numeric");
b.Property<decimal?>("ExpectedGrowthRate")
.HasColumnType("numeric");
b.Property<decimal?>("ExpectedRevenue")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Period")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Isin");
b.HasIndex("Isin", "Period")
.IsUnique();
b.ToTable("ForwardEstimates");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalsSettingsEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("CacheTtlHours")
.HasColumnType("integer");
b.Property<bool>("EnableYahooFallback")
.HasColumnType("boolean");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Settings");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.TickerFundamentalsEntity", b =>
{
b.Property<string>("Ticker")
.HasColumnType("text");
b.Property<decimal>("CurrentPrice")
.HasColumnType("numeric");
b.Property<decimal?>("CurrentRatio")
.HasColumnType("numeric");
b.Property<decimal>("DayChangeAbsolute")
.HasColumnType("numeric");
b.Property<decimal>("DayChangePercent")
.HasColumnType("numeric");
b.Property<decimal?>("DebtToEquity")
.HasColumnType("numeric");
b.Property<decimal?>("DividendYield")
.HasColumnType("numeric");
b.Property<decimal>("EnterpriseValue")
.HasColumnType("numeric");
b.Property<decimal?>("EvToEbitda")
.HasColumnType("numeric");
b.Property<decimal?>("EvToRevenue")
.HasColumnType("numeric");
b.Property<DateTime?>("ExDividendDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Exchange")
.HasColumnType("text");
b.Property<decimal>("FiftyTwoWeekHigh")
.HasColumnType("numeric");
b.Property<decimal>("FiftyTwoWeekLow")
.HasColumnType("numeric");
b.Property<decimal?>("GrossMargin")
.HasColumnType("numeric");
b.Property<decimal?>("InterestCoverage")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("MarketCapitalization")
.HasColumnType("numeric");
b.Property<decimal?>("NetProfitMargin")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingMargin")
.HasColumnType("numeric");
b.Property<decimal?>("PayoutRatio")
.HasColumnType("numeric");
b.Property<decimal?>("PbRatio")
.HasColumnType("numeric");
b.Property<decimal?>("PeRatioForward")
.HasColumnType("numeric");
b.Property<decimal?>("PeRatioTrailing")
.HasColumnType("numeric");
b.Property<decimal?>("PegRatio")
.HasColumnType("numeric");
b.Property<decimal?>("PsRatio")
.HasColumnType("numeric");
b.Property<decimal?>("QuickRatio")
.HasColumnType("numeric");
b.Property<decimal?>("ReturnOnAssets")
.HasColumnType("numeric");
b.Property<decimal?>("ReturnOnEquity")
.HasColumnType("numeric");
b.Property<decimal?>("ReturnOnInvestedCapital")
.HasColumnType("numeric");
b.Property<string>("TradingCurrency")
.HasColumnType("text");
b.HasKey("Ticker");
b.HasIndex("Isin");
b.ToTable("TickerFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.CompanyExecutiveEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("Executives")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.FinancialStatementEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("FinancialStatements")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.ForwardEstimateEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("Estimates")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.TickerFundamentalsEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("TickerFundamentals")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetFundamentalsEntity", b =>
{
b.Navigation("Estimates");
b.Navigation("Executives");
b.Navigation("FinancialStatements");
b.Navigation("TickerFundamentals");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,255 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FinlyticFundamentals.Migrations
{
/// <inheritdoc />
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AssetFundamentals",
columns: table => new
{
Isin = table.Column<string>(type: "text", nullable: false),
PrimaryTicker = table.Column<string>(type: "text", nullable: false),
CompanyName = table.Column<string>(type: "text", nullable: false),
BusinessSummary = table.Column<string>(type: "text", nullable: true),
Sector = table.Column<string>(type: "text", nullable: true),
Industry = table.Column<string>(type: "text", nullable: true),
Country = table.Column<string>(type: "text", nullable: true),
Employees = table.Column<int>(type: "integer", nullable: true),
PercentHeldByInstitutions = table.Column<decimal>(type: "numeric", nullable: true),
PercentHeldByInsiders = table.Column<decimal>(type: "numeric", nullable: true),
ShortRatio = table.Column<decimal>(type: "numeric", nullable: true),
ShortPercentOfFloat = table.Column<decimal>(type: "numeric", nullable: true),
ConsensusRating = table.Column<string>(type: "text", nullable: true),
PriceTargetLow = table.Column<decimal>(type: "numeric", nullable: true),
PriceTargetHigh = table.Column<decimal>(type: "numeric", nullable: true),
PriceTargetMedian = table.Column<decimal>(type: "numeric", nullable: true),
PriceTargetMean = table.Column<decimal>(type: "numeric", nullable: true),
ExDividendDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
NextEarningsDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastUpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LastStaticUpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AssetFundamentals", x => x.Isin);
});
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CacheTtlHours = table.Column<int>(type: "integer", nullable: false),
EnableYahooFallback = table.Column<bool>(type: "boolean", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Settings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CompanyExecutives",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Isin = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
Age = table.Column<int>(type: "integer", nullable: true),
Compensation = table.Column<decimal>(type: "numeric", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CompanyExecutives", x => x.Id);
table.ForeignKey(
name: "FK_CompanyExecutives_AssetFundamentals_Isin",
column: x => x.Isin,
principalTable: "AssetFundamentals",
principalColumn: "Isin",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FinancialStatements",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Isin = table.Column<string>(type: "text", nullable: false),
PeriodType = table.Column<string>(type: "text", nullable: false),
EndDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
TotalRevenue = table.Column<decimal>(type: "numeric", nullable: true),
CostOfRevenue = table.Column<decimal>(type: "numeric", nullable: true),
GrossProfit = table.Column<decimal>(type: "numeric", nullable: true),
OperatingExpenses = table.Column<decimal>(type: "numeric", nullable: true),
OperatingIncome = table.Column<decimal>(type: "numeric", nullable: true),
Ebitda = table.Column<decimal>(type: "numeric", nullable: true),
NetIncome = table.Column<decimal>(type: "numeric", nullable: true),
EpsBasic = table.Column<decimal>(type: "numeric", nullable: true),
EpsDiluted = table.Column<decimal>(type: "numeric", nullable: true),
CashAndCashEquivalents = table.Column<decimal>(type: "numeric", nullable: true),
AccountsReceivable = table.Column<decimal>(type: "numeric", nullable: true),
Inventory = table.Column<decimal>(type: "numeric", nullable: true),
TotalCurrentAssets = table.Column<decimal>(type: "numeric", nullable: true),
TotalNonCurrentAssets = table.Column<decimal>(type: "numeric", nullable: true),
CurrentLiabilities = table.Column<decimal>(type: "numeric", nullable: true),
LongTermDebt = table.Column<decimal>(type: "numeric", nullable: true),
TotalLiabilities = table.Column<decimal>(type: "numeric", nullable: true),
TotalStockholdersEquity = table.Column<decimal>(type: "numeric", nullable: true),
OperatingCashFlow = table.Column<decimal>(type: "numeric", nullable: true),
InvestingCashFlow = table.Column<decimal>(type: "numeric", nullable: true),
CapitalExpenditures = table.Column<decimal>(type: "numeric", nullable: true),
FinancingCashFlow = table.Column<decimal>(type: "numeric", nullable: true),
FreeCashFlow = table.Column<decimal>(type: "numeric", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FinancialStatements", x => x.Id);
table.ForeignKey(
name: "FK_FinancialStatements_AssetFundamentals_Isin",
column: x => x.Isin,
principalTable: "AssetFundamentals",
principalColumn: "Isin",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ForwardEstimates",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Isin = table.Column<string>(type: "text", nullable: false),
Period = table.Column<string>(type: "text", nullable: false),
ExpectedRevenue = table.Column<decimal>(type: "numeric", nullable: true),
ExpectedEps = table.Column<decimal>(type: "numeric", nullable: true),
ExpectedGrowthRate = table.Column<decimal>(type: "numeric", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ForwardEstimates", x => x.Id);
table.ForeignKey(
name: "FK_ForwardEstimates_AssetFundamentals_Isin",
column: x => x.Isin,
principalTable: "AssetFundamentals",
principalColumn: "Isin",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "TickerFundamentals",
columns: table => new
{
Ticker = table.Column<string>(type: "text", nullable: false),
Isin = table.Column<string>(type: "text", nullable: false),
Exchange = table.Column<string>(type: "text", nullable: true),
TradingCurrency = table.Column<string>(type: "text", nullable: true),
CurrentPrice = table.Column<decimal>(type: "numeric", nullable: false),
DayChangeAbsolute = table.Column<decimal>(type: "numeric", nullable: false),
DayChangePercent = table.Column<decimal>(type: "numeric", nullable: false),
FiftyTwoWeekHigh = table.Column<decimal>(type: "numeric", nullable: false),
FiftyTwoWeekLow = table.Column<decimal>(type: "numeric", nullable: false),
MarketCapitalization = table.Column<decimal>(type: "numeric", nullable: false),
EnterpriseValue = table.Column<decimal>(type: "numeric", nullable: false),
PeRatioTrailing = table.Column<decimal>(type: "numeric", nullable: true),
PeRatioForward = table.Column<decimal>(type: "numeric", nullable: true),
PegRatio = table.Column<decimal>(type: "numeric", nullable: true),
PbRatio = table.Column<decimal>(type: "numeric", nullable: true),
PsRatio = table.Column<decimal>(type: "numeric", nullable: true),
EvToEbitda = table.Column<decimal>(type: "numeric", nullable: true),
EvToRevenue = table.Column<decimal>(type: "numeric", nullable: true),
GrossMargin = table.Column<decimal>(type: "numeric", nullable: true),
OperatingMargin = table.Column<decimal>(type: "numeric", nullable: true),
NetProfitMargin = table.Column<decimal>(type: "numeric", nullable: true),
ReturnOnEquity = table.Column<decimal>(type: "numeric", nullable: true),
ReturnOnAssets = table.Column<decimal>(type: "numeric", nullable: true),
ReturnOnInvestedCapital = table.Column<decimal>(type: "numeric", nullable: true),
DebtToEquity = table.Column<decimal>(type: "numeric", nullable: true),
CurrentRatio = table.Column<decimal>(type: "numeric", nullable: true),
QuickRatio = table.Column<decimal>(type: "numeric", nullable: true),
InterestCoverage = table.Column<decimal>(type: "numeric", nullable: true),
DividendYield = table.Column<decimal>(type: "numeric", nullable: true),
PayoutRatio = table.Column<decimal>(type: "numeric", nullable: true),
ExDividendDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastUpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TickerFundamentals", x => x.Ticker);
table.ForeignKey(
name: "FK_TickerFundamentals_AssetFundamentals_Isin",
column: x => x.Isin,
principalTable: "AssetFundamentals",
principalColumn: "Isin",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AssetFundamentals_PrimaryTicker",
table: "AssetFundamentals",
column: "PrimaryTicker",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_CompanyExecutives_Isin",
table: "CompanyExecutives",
column: "Isin");
migrationBuilder.CreateIndex(
name: "IX_FinancialStatements_Isin",
table: "FinancialStatements",
column: "Isin");
migrationBuilder.CreateIndex(
name: "IX_FinancialStatements_Isin_PeriodType_EndDate",
table: "FinancialStatements",
columns: new[] { "Isin", "PeriodType", "EndDate" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ForwardEstimates_Isin",
table: "ForwardEstimates",
column: "Isin");
migrationBuilder.CreateIndex(
name: "IX_ForwardEstimates_Isin_Period",
table: "ForwardEstimates",
columns: new[] { "Isin", "Period" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_TickerFundamentals_Isin",
table: "TickerFundamentals",
column: "Isin");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CompanyExecutives");
migrationBuilder.DropTable(
name: "FinancialStatements");
migrationBuilder.DropTable(
name: "ForwardEstimates");
migrationBuilder.DropTable(
name: "Settings");
migrationBuilder.DropTable(
name: "TickerFundamentals");
migrationBuilder.DropTable(
name: "AssetFundamentals");
}
}
}
@@ -0,0 +1,443 @@
// <auto-generated />
using System;
using FinlyticFundamentals.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticFundamentals.Migrations
{
[DbContext(typeof(FundamentalsDbContext))]
partial class FundamentalsDbContextModelSnapshot : 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("FinlyticFundamentals.Entities.AssetFundamentalsEntity", b =>
{
b.Property<string>("Isin")
.HasColumnType("text");
b.Property<string>("BusinessSummary")
.HasColumnType("text");
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ConsensusRating")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("Employees")
.HasColumnType("integer");
b.Property<DateTime?>("ExDividendDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Industry")
.HasColumnType("text");
b.Property<DateTime>("LastStaticUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("NextEarningsDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal?>("PercentHeldByInsiders")
.HasColumnType("numeric");
b.Property<decimal?>("PercentHeldByInstitutions")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetHigh")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetLow")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetMean")
.HasColumnType("numeric");
b.Property<decimal?>("PriceTargetMedian")
.HasColumnType("numeric");
b.Property<string>("PrimaryTicker")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Sector")
.HasColumnType("text");
b.Property<decimal?>("ShortPercentOfFloat")
.HasColumnType("numeric");
b.Property<decimal?>("ShortRatio")
.HasColumnType("numeric");
b.HasKey("Isin");
b.HasIndex("PrimaryTicker")
.IsUnique();
b.ToTable("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.CompanyExecutiveEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int?>("Age")
.HasColumnType("integer");
b.Property<decimal?>("Compensation")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Isin");
b.ToTable("CompanyExecutives");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.FinancialStatementEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal?>("AccountsReceivable")
.HasColumnType("numeric");
b.Property<decimal?>("CapitalExpenditures")
.HasColumnType("numeric");
b.Property<decimal?>("CashAndCashEquivalents")
.HasColumnType("numeric");
b.Property<decimal?>("CostOfRevenue")
.HasColumnType("numeric");
b.Property<decimal?>("CurrentLiabilities")
.HasColumnType("numeric");
b.Property<decimal?>("Ebitda")
.HasColumnType("numeric");
b.Property<DateTime>("EndDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal?>("EpsBasic")
.HasColumnType("numeric");
b.Property<decimal?>("EpsDiluted")
.HasColumnType("numeric");
b.Property<decimal?>("FinancingCashFlow")
.HasColumnType("numeric");
b.Property<decimal?>("FreeCashFlow")
.HasColumnType("numeric");
b.Property<decimal?>("GrossProfit")
.HasColumnType("numeric");
b.Property<decimal?>("Inventory")
.HasColumnType("numeric");
b.Property<decimal?>("InvestingCashFlow")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<decimal?>("LongTermDebt")
.HasColumnType("numeric");
b.Property<decimal?>("NetIncome")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingCashFlow")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingExpenses")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingIncome")
.HasColumnType("numeric");
b.Property<string>("PeriodType")
.IsRequired()
.HasColumnType("text");
b.Property<decimal?>("TotalCurrentAssets")
.HasColumnType("numeric");
b.Property<decimal?>("TotalLiabilities")
.HasColumnType("numeric");
b.Property<decimal?>("TotalNonCurrentAssets")
.HasColumnType("numeric");
b.Property<decimal?>("TotalRevenue")
.HasColumnType("numeric");
b.Property<decimal?>("TotalStockholdersEquity")
.HasColumnType("numeric");
b.HasKey("Id");
b.HasIndex("Isin");
b.HasIndex("Isin", "PeriodType", "EndDate")
.IsUnique();
b.ToTable("FinancialStatements");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.ForwardEstimateEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal?>("ExpectedEps")
.HasColumnType("numeric");
b.Property<decimal?>("ExpectedGrowthRate")
.HasColumnType("numeric");
b.Property<decimal?>("ExpectedRevenue")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Period")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Isin");
b.HasIndex("Isin", "Period")
.IsUnique();
b.ToTable("ForwardEstimates");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalsSettingsEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("CacheTtlHours")
.HasColumnType("integer");
b.Property<bool>("EnableYahooFallback")
.HasColumnType("boolean");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Settings");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.TickerFundamentalsEntity", b =>
{
b.Property<string>("Ticker")
.HasColumnType("text");
b.Property<decimal>("CurrentPrice")
.HasColumnType("numeric");
b.Property<decimal?>("CurrentRatio")
.HasColumnType("numeric");
b.Property<decimal>("DayChangeAbsolute")
.HasColumnType("numeric");
b.Property<decimal>("DayChangePercent")
.HasColumnType("numeric");
b.Property<decimal?>("DebtToEquity")
.HasColumnType("numeric");
b.Property<decimal?>("DividendYield")
.HasColumnType("numeric");
b.Property<decimal>("EnterpriseValue")
.HasColumnType("numeric");
b.Property<decimal?>("EvToEbitda")
.HasColumnType("numeric");
b.Property<decimal?>("EvToRevenue")
.HasColumnType("numeric");
b.Property<DateTime?>("ExDividendDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Exchange")
.HasColumnType("text");
b.Property<decimal>("FiftyTwoWeekHigh")
.HasColumnType("numeric");
b.Property<decimal>("FiftyTwoWeekLow")
.HasColumnType("numeric");
b.Property<decimal?>("GrossMargin")
.HasColumnType("numeric");
b.Property<decimal?>("InterestCoverage")
.HasColumnType("numeric");
b.Property<string>("Isin")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("MarketCapitalization")
.HasColumnType("numeric");
b.Property<decimal?>("NetProfitMargin")
.HasColumnType("numeric");
b.Property<decimal?>("OperatingMargin")
.HasColumnType("numeric");
b.Property<decimal?>("PayoutRatio")
.HasColumnType("numeric");
b.Property<decimal?>("PbRatio")
.HasColumnType("numeric");
b.Property<decimal?>("PeRatioForward")
.HasColumnType("numeric");
b.Property<decimal?>("PeRatioTrailing")
.HasColumnType("numeric");
b.Property<decimal?>("PegRatio")
.HasColumnType("numeric");
b.Property<decimal?>("PsRatio")
.HasColumnType("numeric");
b.Property<decimal?>("QuickRatio")
.HasColumnType("numeric");
b.Property<decimal?>("ReturnOnAssets")
.HasColumnType("numeric");
b.Property<decimal?>("ReturnOnEquity")
.HasColumnType("numeric");
b.Property<decimal?>("ReturnOnInvestedCapital")
.HasColumnType("numeric");
b.Property<string>("TradingCurrency")
.HasColumnType("text");
b.HasKey("Ticker");
b.HasIndex("Isin");
b.ToTable("TickerFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.CompanyExecutiveEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("Executives")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.FinancialStatementEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("FinancialStatements")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.ForwardEstimateEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("Estimates")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.TickerFundamentalsEntity", b =>
{
b.HasOne("FinlyticFundamentals.Entities.AssetFundamentalsEntity", "AssetFundamentals")
.WithMany("TickerFundamentals")
.HasForeignKey("Isin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AssetFundamentals");
});
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetFundamentalsEntity", b =>
{
b.Navigation("Estimates");
b.Navigation("Executives");
b.Navigation("FinancialStatements");
b.Navigation("TickerFundamentals");
});
#pragma warning restore 612, 618
}
}
}