feat(fundamentals): refactor entities, add Yahoo modules scraper, 52W metrics and migrations
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
|
||||
public class AssetDataEntity
|
||||
{
|
||||
[Key] public string Isin { get; set; } = string.Empty;
|
||||
|
||||
[Key] public string Isin { get; set; } = "";
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public string Description { get; set; } = "";
|
||||
public TickerEntity PrimaryTicker { get; set; } = new();
|
||||
public List<TickerEntity> AvailableTickers { get; set; } = new();
|
||||
|
||||
public ICollection<KeyExecutiveEntity> KeyExecutives { get; set; }
|
||||
|
||||
public ICollection<AssetEventEntity> AssetEvents { get; set; }
|
||||
public ICollection<KeyExecutiveEntity> KeyExecutives { get; set; } = new List<KeyExecutiveEntity>();
|
||||
public ICollection<AssetEventEntity> AssetEvents { get; set; } = new List<AssetEventEntity>();
|
||||
public ICollection<FundamentalDataEntity> FundamentalData { get; set; } = new List<FundamentalDataEntity>();
|
||||
}
|
||||
@@ -1,6 +1,23 @@
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
|
||||
public class AssetEventEntity
|
||||
{
|
||||
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
public TickerEntity Ticker { get; set; } = new();
|
||||
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
[Required]
|
||||
public string AssetDataIsin { get; set; } = string.Empty;
|
||||
|
||||
[ForeignKey(nameof(AssetDataIsin))]
|
||||
public AssetDataEntity AssetData { get; set; } = null!;
|
||||
}
|
||||
@@ -1,6 +1,69 @@
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
|
||||
public class FundamentalDataEntity
|
||||
{
|
||||
[Key]
|
||||
public string Isin { get; set; } = string.Empty;
|
||||
|
||||
public TickerEntity Ticker { get; set; } = new();
|
||||
|
||||
// --- Valuation & Multiples ---
|
||||
public decimal? MarketCap { get; set; }
|
||||
public decimal? EnterpriseValue { get; set; }
|
||||
public decimal? TrailingPe { get; set; }
|
||||
public decimal? ForwardPe { get; set; }
|
||||
public decimal? PegRatio { get; set; }
|
||||
public decimal? PriceToSales { get; set; }
|
||||
public decimal? PriceToBook { get; set; }
|
||||
public decimal? EvToEbitda { get; set; }
|
||||
|
||||
// --- Income Statement (TTM) ---
|
||||
public decimal? TotalRevenue { get; set; }
|
||||
public decimal? RevenueGrowthYoY { get; set; }
|
||||
public decimal? GrossProfit { get; set; }
|
||||
public decimal? OperatingIncome { get; set; } // EBIT
|
||||
public decimal? Ebitda { get; set; }
|
||||
public decimal? NetIncome { get; set; }
|
||||
public decimal? DilutedEps { get; set; }
|
||||
|
||||
// --- Balance Sheet & Cash Flow (MRQ / TTM) ---
|
||||
public decimal? TotalCash { get; set; }
|
||||
public decimal? TotalDebt { get; set; }
|
||||
public decimal? DebtToEquity { get; set; }
|
||||
public decimal? CurrentRatio { get; set; }
|
||||
public decimal? OperatingCashFlow { get; set; }
|
||||
public decimal? FreeCashFlow { get; set; }
|
||||
|
||||
// --- Dividenden & Profitabilität ---
|
||||
public decimal? ReturnOnEquity { get; set; }
|
||||
public decimal? ReturnOnAssets { get; set; }
|
||||
public decimal? ForwardDividendYield { get; set; }
|
||||
public decimal? PayoutRatio { get; set; }
|
||||
|
||||
// --- 52-Wochen-Spannbreite ---
|
||||
public decimal? FiftyTwoWeekHigh { get; set; }
|
||||
public decimal? FiftyTwoWeekLow { get; set; }
|
||||
|
||||
// --- Analysten-Ratings & Kursziele ---
|
||||
public string? ConsensusRating { get; set; }
|
||||
public decimal? PriceTargetLow { get; set; }
|
||||
public decimal? PriceTargetMean { get; set; }
|
||||
public decimal? PriceTargetHigh { get; set; }
|
||||
|
||||
// --- Aktionärsstruktur & Short-Interesse ---
|
||||
public decimal? PercentHeldByInstitutions { get; set; }
|
||||
public decimal? PercentHeldByInsiders { get; set; }
|
||||
public decimal? ShortPercentOfFloat { get; set; }
|
||||
public decimal? ShortRatio { get; set; }
|
||||
|
||||
public DateTime LastUpdatedUtc { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Required]
|
||||
public string AssetDataIsin { get; set; } = string.Empty;
|
||||
|
||||
[ForeignKey(nameof(AssetDataIsin))]
|
||||
public AssetDataEntity AssetData { get; set; } = null!;
|
||||
}
|
||||
@@ -1,6 +1,17 @@
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
|
||||
public class KeyExecutiveEntity
|
||||
{
|
||||
|
||||
[Key] public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Payment { get; set; } = string.Empty;
|
||||
|
||||
[Required] public string AssetDataIsin { get; set; } = string.Empty;
|
||||
|
||||
[ForeignKey(nameof(AssetDataIsin))] public AssetDataEntity AssetData { get; set; } = null!;
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FinlyticFundamentals.Entities;
|
||||
|
||||
[Owned]
|
||||
public class TickerEntity
|
||||
{
|
||||
|
||||
public string Ticker { get; set; } = string.Empty;
|
||||
public string Exchange { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user