feat(Core): update DTOs and shared models

This commit is contained in:
2026-08-09 21:01:38 +02:00
parent 6337e63a77
commit 5475c3ac51
58 changed files with 3418 additions and 30 deletions
+66
View File
@@ -0,0 +1,66 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Yahoo;
/// <summary>
/// Response object for Yahoo Finance chart API (/v8/finance/chart/{symbol}).
/// </summary>
public record YahooChartResponseDto(
[property: JsonPropertyName("chart")] YahooChartResultWrapperDto? Chart
);
public record YahooChartResultWrapperDto(
[property: JsonPropertyName("result")] List<YahooChartResultDto>? Result,
[property: JsonPropertyName("error")] object? Error
);
public record YahooChartResultDto(
[property: JsonPropertyName("meta")] YahooChartMetaDto? Meta,
[property: JsonPropertyName("timestamp")] List<long>? Timestamp,
[property: JsonPropertyName("indicators")] YahooChartIndicatorsDto? Indicators
);
public record YahooChartMetaDto(
[property: JsonPropertyName("currency")] string? Currency,
[property: JsonPropertyName("symbol")] string? Symbol,
[property: JsonPropertyName("exchangeName")] string? ExchangeName,
[property: JsonPropertyName("fullExchangeName")] string? FullExchangeName,
[property: JsonPropertyName("instrumentType")] string? InstrumentType,
[property: JsonPropertyName("firstTradeDate")] long? FirstTradeDate,
[property: JsonPropertyName("regularMarketTime")] long? RegularMarketTime,
[property: JsonPropertyName("hasPrePostMarketData")] bool? HasPrePostMarketData,
[property: JsonPropertyName("gmtoffset")] int? GmtOffset,
[property: JsonPropertyName("timezone")] string? Timezone,
[property: JsonPropertyName("exchangeTimezoneName")] string? ExchangeTimezoneName,
[property: JsonPropertyName("regularMarketPrice")] double? RegularMarketPrice,
[property: JsonPropertyName("fiftyTwoWeekHigh")] double? FiftyTwoWeekHigh,
[property: JsonPropertyName("fiftyTwoWeekLow")] double? FiftyTwoWeekLow,
[property: JsonPropertyName("regularMarketDayHigh")] double? RegularMarketDayHigh,
[property: JsonPropertyName("regularMarketDayLow")] double? RegularMarketDayLow,
[property: JsonPropertyName("regularMarketVolume")] long? RegularMarketVolume,
[property: JsonPropertyName("chartPreviousClose")] double? ChartPreviousClose,
[property: JsonPropertyName("previousClose")] double? PreviousClose,
[property: JsonPropertyName("scale")] int? Scale,
[property: JsonPropertyName("priceHint")] int? PriceHint,
[property: JsonPropertyName("dataGranularity")] string? DataGranularity,
[property: JsonPropertyName("range")] string? Range,
[property: JsonPropertyName("validRanges")] List<string>? ValidRanges
);
public record YahooChartIndicatorsDto(
[property: JsonPropertyName("quote")] List<YahooChartQuoteDto>? Quote,
[property: JsonPropertyName("adjclose")] List<YahooChartAdjCloseDto>? AdjClose
);
public record YahooChartQuoteDto(
[property: JsonPropertyName("open")] List<double?>? Open,
[property: JsonPropertyName("high")] List<double?>? High,
[property: JsonPropertyName("low")] List<double?>? Low,
[property: JsonPropertyName("close")] List<double?>? Close,
[property: JsonPropertyName("volume")] List<long?>? Volume
);
public record YahooChartAdjCloseDto(
[property: JsonPropertyName("adjclose")] List<double?>? AdjClose
);
+64
View File
@@ -0,0 +1,64 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Yahoo;
/// <summary>
/// Response object for Yahoo Finance quick quotes API (/v7/finance/quote?symbols=...).
/// </summary>
public record YahooQuoteResponseDto(
[property: JsonPropertyName("quoteResponse")] YahooQuoteResultWrapperDto? QuoteResponse
);
public record YahooQuoteResultWrapperDto(
[property: JsonPropertyName("result")] List<YahooQuoteItemDto>? Result,
[property: JsonPropertyName("error")] object? Error
);
public record YahooQuoteItemDto(
[property: JsonPropertyName("language")] string? Language,
[property: JsonPropertyName("region")] string? Region,
[property: JsonPropertyName("quoteType")] string? QuoteType,
[property: JsonPropertyName("typeDisp")] string? TypeDisp,
[property: JsonPropertyName("quoteSourceName")] string? QuoteSourceName,
[property: JsonPropertyName("triggerable")] bool? Triggerable,
[property: JsonPropertyName("customPriceAlertConfidence")] string? CustomPriceAlertConfidence,
[property: JsonPropertyName("currency")] string? Currency,
[property: JsonPropertyName("marketState")] string? MarketState,
[property: JsonPropertyName("exchange")] string? Exchange,
[property: JsonPropertyName("shortName")] string? ShortName,
[property: JsonPropertyName("longName")] string? LongName,
[property: JsonPropertyName("messageBoardId")] string? MessageBoardId,
[property: JsonPropertyName("exchangeTimezoneName")] string? ExchangeTimezoneName,
[property: JsonPropertyName("exchangeTimezoneShortName")] string? ExchangeTimezoneShortName,
[property: JsonPropertyName("gmtOffSetMilliseconds")] long? GmtOffSetMilliseconds,
[property: JsonPropertyName("market")] string? Market,
[property: JsonPropertyName("esgPopulated")] bool? EsgPopulated,
[property: JsonPropertyName("regularMarketChangePercent")] double? RegularMarketChangePercent,
[property: JsonPropertyName("regularMarketPrice")] double? RegularMarketPrice,
[property: JsonPropertyName("regularMarketChange")] double? RegularMarketChange,
[property: JsonPropertyName("regularMarketTime")] long? RegularMarketTime,
[property: JsonPropertyName("regularMarketDayHigh")] double? RegularMarketDayHigh,
[property: JsonPropertyName("regularMarketDayRange")] string? RegularMarketDayRange,
[property: JsonPropertyName("regularMarketDayLow")] double? RegularMarketDayLow,
[property: JsonPropertyName("regularMarketVolume")] long? RegularMarketVolume,
[property: JsonPropertyName("regularMarketPreviousClose")] double? RegularMarketPreviousClose,
[property: JsonPropertyName("bid")] double? Bid,
[property: JsonPropertyName("ask")] double? Ask,
[property: JsonPropertyName("bidSize")] long? BidSize,
[property: JsonPropertyName("askSize")] long? AskSize,
[property: JsonPropertyName("fullExchangeName")] string? FullExchangeName,
[property: JsonPropertyName("financialCurrency")] string? FinancialCurrency,
[property: JsonPropertyName("regularMarketOpen")] double? RegularMarketOpen,
[property: JsonPropertyName("averageDailyVolume3Month")] long? AverageDailyVolume3Month,
[property: JsonPropertyName("averageDailyVolume10Day")] long? AverageDailyVolume10Day,
[property: JsonPropertyName("fiftyTwoWeekLowChange")] double? FiftyTwoWeekLowChange,
[property: JsonPropertyName("fiftyTwoWeekLowChangePercent")] double? FiftyTwoWeekLowChangePercent,
[property: JsonPropertyName("fiftyTwoWeekRange")] string? FiftyTwoWeekRange,
[property: JsonPropertyName("fiftyTwoWeekHighChange")] double? FiftyTwoWeekHighChange,
[property: JsonPropertyName("fiftyTwoWeekHighChangePercent")] double? FiftyTwoWeekHighChangePercent,
[property: JsonPropertyName("fiftyTwoWeekLow")] double? FiftyTwoWeekLow,
[property: JsonPropertyName("fiftyTwoWeekHigh")] double? FiftyTwoWeekHigh,
[property: JsonPropertyName("marketCap")] double? MarketCap,
[property: JsonPropertyName("symbol")] string Symbol = ""
);
@@ -0,0 +1,282 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Yahoo;
/// <summary>
/// Root response object for Yahoo Finance quoteSummary API (/v10/finance/quoteSummary/{symbol}).
/// </summary>
public record YahooQuoteSummaryResponseDto(
[property: JsonPropertyName("quoteSummary")] YahooQuoteSummaryResultDto? QuoteSummary
);
public record YahooQuoteSummaryResultDto(
[property: JsonPropertyName("result")] List<YahooQuoteSummaryModulesDto>? Result,
[property: JsonPropertyName("error")] object? Error
);
/// <summary>
/// Contains module blocks requested via the modules query parameter.
/// </summary>
public record YahooQuoteSummaryModulesDto(
[property: JsonPropertyName("assetProfile")] YahooAssetProfileDto? AssetProfile,
[property: JsonPropertyName("financialData")] YahooFinancialDataDto? FinancialData,
[property: JsonPropertyName("defaultKeyStatistics")] YahooDefaultKeyStatisticsDto? DefaultKeyStatistics,
[property: JsonPropertyName("summaryDetail")] YahooSummaryDetailDto? SummaryDetail,
[property: JsonPropertyName("incomeStatementHistory")] YahooFinancialStatementHistoryDto? IncomeStatementHistory,
[property: JsonPropertyName("incomeStatementHistoryQuarterly")] YahooFinancialStatementHistoryDto? IncomeStatementHistoryQuarterly,
[property: JsonPropertyName("balanceSheetHistory")] YahooFinancialStatementHistoryDto? BalanceSheetHistory,
[property: JsonPropertyName("balanceSheetHistoryQuarterly")] YahooFinancialStatementHistoryDto? BalanceSheetHistoryQuarterly,
[property: JsonPropertyName("cashflowStatementHistory")] YahooFinancialStatementHistoryDto? CashflowStatementHistory,
[property: JsonPropertyName("cashflowStatementHistoryQuarterly")] YahooFinancialStatementHistoryDto? CashflowStatementHistoryQuarterly,
[property: JsonPropertyName("calendarEvents")] YahooCalendarEventsDto? CalendarEvents
);
#region Module DTOs
/// <summary>
/// Asset profile details including address, industry, sector, officers, and corporate governance risks.
/// </summary>
public record YahooAssetProfileDto(
[property: JsonPropertyName("address1")] string? Address1,
[property: JsonPropertyName("address2")] string? Address2,
[property: JsonPropertyName("city")] string? City,
[property: JsonPropertyName("state")] string? State,
[property: JsonPropertyName("zip")] string? Zip,
[property: JsonPropertyName("country")] string? Country,
[property: JsonPropertyName("phone")] string? Phone,
[property: JsonPropertyName("website")] string? Website,
[property: JsonPropertyName("industry")] string? Industry,
[property: JsonPropertyName("industryKey")] string? IndustryKey,
[property: JsonPropertyName("industryDisp")] string? IndustryDisp,
[property: JsonPropertyName("sector")] string? Sector,
[property: JsonPropertyName("sectorKey")] string? SectorKey,
[property: JsonPropertyName("sectorDisp")] string? SectorDisp,
[property: JsonPropertyName("longBusinessSummary")] string? LongBusinessSummary,
[property: JsonPropertyName("fullTimeEmployees")] int? FullTimeEmployees,
[property: JsonPropertyName("companyOfficers")] List<YahooCompanyOfficerDto>? CompanyOfficers,
[property: JsonPropertyName("auditRisk")] int? AuditRisk,
[property: JsonPropertyName("boardRisk")] int? BoardRisk,
[property: JsonPropertyName("compensationRisk")] int? CompensationRisk,
[property: JsonPropertyName("shareHolderRightsRisk")] int? ShareHolderRightsRisk,
[property: JsonPropertyName("overallRisk")] int? OverallRisk,
[property: JsonPropertyName("governanceEpochDate")] long? GovernanceEpochDate,
[property: JsonPropertyName("compensationAsOfEpochDate")] long? CompensationAsOfEpochDate
);
public record YahooCompanyOfficerDto(
[property: JsonPropertyName("name")] string? Name,
[property: JsonPropertyName("age")] int? Age,
[property: JsonPropertyName("title")] string? Title,
[property: JsonPropertyName("yearBorn")] int? YearBorn,
[property: JsonPropertyName("fiscalYear")] int? FiscalYear,
[property: JsonPropertyName("totalPay")] YahooValueDto? TotalPay,
[property: JsonPropertyName("exercisedValue")] YahooValueDto? ExercisedValue,
[property: JsonPropertyName("unexercisedValue")] YahooValueDto? UnexercisedValue
);
/// <summary>
/// Financial metrics including target prices, debt to equity, margins, and cash flow indicators.
/// </summary>
public record YahooFinancialDataDto(
[property: JsonPropertyName("currentPrice")] YahooValueDto? CurrentPrice,
[property: JsonPropertyName("targetHighPrice")] YahooValueDto? TargetHighPrice,
[property: JsonPropertyName("targetLowPrice")] YahooValueDto? TargetLowPrice,
[property: JsonPropertyName("targetMeanPrice")] YahooValueDto? TargetMeanPrice,
[property: JsonPropertyName("targetMedianPrice")] YahooValueDto? TargetMedianPrice,
[property: JsonPropertyName("recommendationMean")] YahooValueDto? RecommendationMean,
[property: JsonPropertyName("recommendationKey")] string? RecommendationKey,
[property: JsonPropertyName("numberOfAnalystOpinions")] YahooValueDto? NumberOfAnalystOpinions,
[property: JsonPropertyName("totalCash")] YahooValueDto? TotalCash,
[property: JsonPropertyName("totalCashPerShare")] YahooValueDto? TotalCashPerShare,
[property: JsonPropertyName("ebitda")] YahooValueDto? Ebitda,
[property: JsonPropertyName("totalDebt")] YahooValueDto? TotalDebt,
[property: JsonPropertyName("quickRatio")] YahooValueDto? QuickRatio,
[property: JsonPropertyName("currentRatio")] YahooValueDto? CurrentRatio,
[property: JsonPropertyName("totalRevenue")] YahooValueDto? TotalRevenue,
[property: JsonPropertyName("debtToEquity")] YahooValueDto? DebtToEquity,
[property: JsonPropertyName("revenuePerShare")] YahooValueDto? RevenuePerShare,
[property: JsonPropertyName("returnOnAssets")] YahooValueDto? ReturnOnAssets,
[property: JsonPropertyName("returnOnEquity")] YahooValueDto? ReturnOnEquity,
[property: JsonPropertyName("grossProfits")] YahooValueDto? GrossProfits,
[property: JsonPropertyName("freeCashflow")] YahooValueDto? FreeCashflow,
[property: JsonPropertyName("operatingCashflow")] YahooValueDto? OperatingCashflow,
[property: JsonPropertyName("revenueGrowth")] YahooValueDto? RevenueGrowth,
[property: JsonPropertyName("grossMargins")] YahooValueDto? GrossMargins,
[property: JsonPropertyName("ebitdaMargins")] YahooValueDto? EbitdaMargins,
[property: JsonPropertyName("operatingMargins")] YahooValueDto? OperatingMargins,
[property: JsonPropertyName("profitMargins")] YahooValueDto? ProfitMargins,
[property: JsonPropertyName("financialCurrency")] string? FinancialCurrency
);
/// <summary>
/// Key statistics including valuation ratios (P/E, Enterprise Value, Short Ratio, Shares Outstanding).
/// </summary>
public record YahooDefaultKeyStatisticsDto(
[property: JsonPropertyName("priceToBook")] YahooValueDto? PriceToBook,
[property: JsonPropertyName("enterpriseValue")] YahooValueDto? EnterpriseValue,
[property: JsonPropertyName("forwardPE")] YahooValueDto? ForwardPE,
[property: JsonPropertyName("profitMargins")] YahooValueDto? ProfitMargins,
[property: JsonPropertyName("floatShares")] YahooValueDto? FloatShares,
[property: JsonPropertyName("sharesOutstanding")] YahooValueDto? SharesOutstanding,
[property: JsonPropertyName("sharesShort")] YahooValueDto? SharesShort,
[property: JsonPropertyName("sharesShortPriorMonth")] YahooValueDto? SharesShortPriorMonth,
[property: JsonPropertyName("sharesShortPreviousMonthDate")] YahooValueDto? SharesShortPreviousMonthDate,
[property: JsonPropertyName("dateShortInterest")] YahooValueDto? DateShortInterest,
[property: JsonPropertyName("sharesPercentSharesOut")] YahooValueDto? SharesPercentSharesOut,
[property: JsonPropertyName("heldPercentInsiders")] YahooValueDto? HeldPercentInsiders,
[property: JsonPropertyName("heldPercentInstitutions")] YahooValueDto? HeldPercentInstitutions,
[property: JsonPropertyName("shortRatio")] YahooValueDto? ShortRatio,
[property: JsonPropertyName("shortPercentOfFloat")] YahooValueDto? ShortPercentOfFloat,
[property: JsonPropertyName("beta")] YahooValueDto? Beta,
[property: JsonPropertyName("category")] string? Category,
[property: JsonPropertyName("bookValue")] YahooValueDto? BookValue,
[property: JsonPropertyName("priceToSalesTrailing12Months")] YahooValueDto? PriceToSalesTrailing12Months,
[property: JsonPropertyName("lastFiscalYearEnd")] YahooValueDto? LastFiscalYearEnd,
[property: JsonPropertyName("nextFiscalYearEnd")] YahooValueDto? NextFiscalYearEnd,
[property: JsonPropertyName("mostRecentQuarter")] YahooValueDto? MostRecentQuarter,
[property: JsonPropertyName("earningsQuarterlyGrowth")] YahooValueDto? EarningsQuarterlyGrowth,
[property: JsonPropertyName("netIncomeToCommon")] YahooValueDto? NetIncomeToCommon,
[property: JsonPropertyName("trailingEps")] YahooValueDto? TrailingEps,
[property: JsonPropertyName("forwardEps")] YahooValueDto? ForwardEps,
[property: JsonPropertyName("pegRatio")] YahooValueDto? PegRatio,
[property: JsonPropertyName("enterpriseToRevenue")] YahooValueDto? EnterpriseToRevenue,
[property: JsonPropertyName("enterpriseToEbitda")] YahooValueDto? EnterpriseToEbitda,
[property: JsonPropertyName("52WeekChange")] YahooValueDto? FiftyTwoWeekChange,
[property: JsonPropertyName("SandP52WeekChange")] YahooValueDto? SandP52WeekChange
);
/// <summary>
/// Summary details including dividends, 52-week ranges, and market capitalization.
/// </summary>
public record YahooSummaryDetailDto(
[property: JsonPropertyName("maxAge")] long? MaxAge,
[property: JsonPropertyName("priceHint")] YahooValueDto? PriceHint,
[property: JsonPropertyName("previousClose")] YahooValueDto? PreviousClose,
[property: JsonPropertyName("open")] YahooValueDto? Open,
[property: JsonPropertyName("dayLow")] YahooValueDto? DayLow,
[property: JsonPropertyName("dayHigh")] YahooValueDto? DayHigh,
[property: JsonPropertyName("regularMarketPreviousClose")] YahooValueDto? RegularMarketPreviousClose,
[property: JsonPropertyName("regularMarketOpen")] YahooValueDto? RegularMarketOpen,
[property: JsonPropertyName("regularMarketDayLow")] YahooValueDto? RegularMarketDayLow,
[property: JsonPropertyName("regularMarketDayHigh")] YahooValueDto? RegularMarketDayHigh,
[property: JsonPropertyName("dividendRate")] YahooValueDto? DividendRate,
[property: JsonPropertyName("dividendYield")] YahooValueDto? DividendYield,
[property: JsonPropertyName("exDividendDate")] YahooValueDto? ExDividendDate,
[property: JsonPropertyName("payoutRatio")] YahooValueDto? PayoutRatio,
[property: JsonPropertyName("fiveYearAvgDividendYield")] YahooValueDto? FiveYearAvgDividendYield,
[property: JsonPropertyName("beta")] YahooValueDto? Beta,
[property: JsonPropertyName("trailingPE")] YahooValueDto? TrailingPE,
[property: JsonPropertyName("forwardPE")] YahooValueDto? ForwardPE,
[property: JsonPropertyName("volume")] YahooValueDto? Volume,
[property: JsonPropertyName("regularMarketVolume")] YahooValueDto? RegularMarketVolume,
[property: JsonPropertyName("averageVolume")] YahooValueDto? AverageVolume,
[property: JsonPropertyName("averageVolume10days")] YahooValueDto? AverageVolume10days,
[property: JsonPropertyName("averageDailyVolume10Day")] YahooValueDto? AverageDailyVolume10Day,
[property: JsonPropertyName("bid")] YahooValueDto? Bid,
[property: JsonPropertyName("ask")] YahooValueDto? Ask,
[property: JsonPropertyName("bidSize")] YahooValueDto? BidSize,
[property: JsonPropertyName("askSize")] YahooValueDto? AskSize,
[property: JsonPropertyName("marketCap")] YahooValueDto? MarketCap,
[property: JsonPropertyName("fiftyTwoWeekLow")] YahooValueDto? FiftyTwoWeekLow,
[property: JsonPropertyName("fiftyTwoWeekHigh")] YahooValueDto? FiftyTwoWeekHigh,
[property: JsonPropertyName("priceToSalesTrailing12Months")] YahooValueDto? PriceToSalesTrailing12Months,
[property: JsonPropertyName("currency")] string? Currency
);
/// <summary>
/// Historical financial statements container.
/// </summary>
public record YahooFinancialStatementHistoryDto(
[property: JsonPropertyName("incomeStatementHistory")] List<YahooIncomeStatementDto>? IncomeStatementHistory,
[property: JsonPropertyName("balanceSheetStatements")] List<YahooBalanceSheetStatementDto>? BalanceSheetStatements,
[property: JsonPropertyName("cashflowStatements")] List<YahooCashflowStatementDto>? CashflowStatements
);
public record YahooIncomeStatementDto(
[property: JsonPropertyName("endDate")] YahooValueDto? EndDate,
[property: JsonPropertyName("totalRevenue")] YahooValueDto? TotalRevenue,
[property: JsonPropertyName("costOfRevenue")] YahooValueDto? CostOfRevenue,
[property: JsonPropertyName("grossProfit")] YahooValueDto? GrossProfit,
[property: JsonPropertyName("researchDevelopment")] YahooValueDto? ResearchDevelopment,
[property: JsonPropertyName("sellingGeneralAdministrative")] YahooValueDto? SellingGeneralAdministrative,
[property: JsonPropertyName("totalOperatingExpenses")] YahooValueDto? TotalOperatingExpenses,
[property: JsonPropertyName("operatingIncome")] YahooValueDto? OperatingIncome,
[property: JsonPropertyName("totalOtherIncomeExpenseNet")] YahooValueDto? TotalOtherIncomeExpenseNet,
[property: JsonPropertyName("ebit")] YahooValueDto? Ebit,
[property: JsonPropertyName("interestExpense")] YahooValueDto? InterestExpense,
[property: JsonPropertyName("incomeBeforeTax")] YahooValueDto? IncomeBeforeTax,
[property: JsonPropertyName("incomeTaxExpense")] YahooValueDto? IncomeTaxExpense,
[property: JsonPropertyName("netIncome")] YahooValueDto? NetIncome,
[property: JsonPropertyName("netIncomeApplicableToCommonShares")] YahooValueDto? NetIncomeApplicableToCommonShares
);
public record YahooBalanceSheetStatementDto(
[property: JsonPropertyName("endDate")] YahooValueDto? EndDate,
[property: JsonPropertyName("cash")] YahooValueDto? Cash,
[property: JsonPropertyName("shortTermInvestments")] YahooValueDto? ShortTermInvestments,
[property: JsonPropertyName("netReceivables")] YahooValueDto? NetReceivables,
[property: JsonPropertyName("inventory")] YahooValueDto? Inventory,
[property: JsonPropertyName("otherCurrentAssets")] YahooValueDto? OtherCurrentAssets,
[property: JsonPropertyName("totalCurrentAssets")] YahooValueDto? TotalCurrentAssets,
[property: JsonPropertyName("longTermInvestments")] YahooValueDto? LongTermInvestments,
[property: JsonPropertyName("propertyPlantEquipment")] YahooValueDto? PropertyPlantEquipment,
[property: JsonPropertyName("goodWill")] YahooValueDto? GoodWill,
[property: JsonPropertyName("intangibleAssets")] YahooValueDto? IntangibleAssets,
[property: JsonPropertyName("otherAssets")] YahooValueDto? OtherAssets,
[property: JsonPropertyName("totalAssets")] YahooValueDto? TotalAssets,
[property: JsonPropertyName("accountsPayable")] YahooValueDto? AccountsPayable,
[property: JsonPropertyName("shortLongTermDebt")] YahooValueDto? ShortLongTermDebt,
[property: JsonPropertyName("otherCurrentLiabilities")] YahooValueDto? OtherCurrentLiabilities,
[property: JsonPropertyName("totalCurrentLiabilities")] YahooValueDto? TotalCurrentLiabilities,
[property: JsonPropertyName("longTermDebt")] YahooValueDto? LongTermDebt,
[property: JsonPropertyName("otherLiabilities")] YahooValueDto? OtherLiabilities,
[property: JsonPropertyName("totalLiab")] YahooValueDto? TotalLiab,
[property: JsonPropertyName("commonStock")] YahooValueDto? CommonStock,
[property: JsonPropertyName("retainedEarnings")] YahooValueDto? RetainedEarnings,
[property: JsonPropertyName("treasuryStock")] YahooValueDto? TreasuryStock,
[property: JsonPropertyName("otherStockholderEquity")] YahooValueDto? OtherStockholderEquity,
[property: JsonPropertyName("totalStockholderEquity")] YahooValueDto? TotalStockholderEquity
);
public record YahooCashflowStatementDto(
[property: JsonPropertyName("endDate")] YahooValueDto? EndDate,
[property: JsonPropertyName("netIncome")] YahooValueDto? NetIncome,
[property: JsonPropertyName("depreciation")] YahooValueDto? Depreciation,
[property: JsonPropertyName("changeToNetincome")] YahooValueDto? ChangeToNetincome,
[property: JsonPropertyName("changeToAccountReceivables")] YahooValueDto? ChangeToAccountReceivables,
[property: JsonPropertyName("changeToLiabilities")] YahooValueDto? ChangeToLiabilities,
[property: JsonPropertyName("changeToInventory")] YahooValueDto? ChangeToInventory,
[property: JsonPropertyName("changeToOperatingActivities")] YahooValueDto? ChangeToOperatingActivities,
[property: JsonPropertyName("totalCashFromOperatingActivities")] YahooValueDto? TotalCashFromOperatingActivities,
[property: JsonPropertyName("capitalExpenditures")] YahooValueDto? CapitalExpenditures,
[property: JsonPropertyName("investments")] YahooValueDto? Investments,
[property: JsonPropertyName("otherCashflowsFromInvestingActivities")] YahooValueDto? OtherCashflowsFromInvestingActivities,
[property: JsonPropertyName("totalCashflowsFromInvestingActivities")] YahooValueDto? TotalCashflowsFromInvestingActivities,
[property: JsonPropertyName("dividendsPaid")] YahooValueDto? DividendsPaid,
[property: JsonPropertyName("netBorrowings")] YahooValueDto? NetBorrowings,
[property: JsonPropertyName("otherCashflowsFromFinancingActivities")] YahooValueDto? OtherCashflowsFromFinancingActivities,
[property: JsonPropertyName("totalCashFromFinancingActivities")] YahooValueDto? TotalCashFromFinancingActivities,
[property: JsonPropertyName("changeInCashAndCashEquivalents")] YahooValueDto? ChangeInCashAndCashEquivalents
);
/// <summary>
/// Corporate calendar dates including upcoming earnings calls and ex-dividend dates.
/// </summary>
public record YahooCalendarEventsDto(
[property: JsonPropertyName("earnings")] YahooEarningsCalendarDto? Earnings,
[property: JsonPropertyName("exDividendDate")] YahooValueDto? ExDividendDate,
[property: JsonPropertyName("dividendDate")] YahooValueDto? DividendDate
);
public record YahooEarningsCalendarDto(
[property: JsonPropertyName("earningsDate")] List<YahooValueDto>? EarningsDate,
[property: JsonPropertyName("earningsAverage")] YahooValueDto? EarningsAverage,
[property: JsonPropertyName("earningsLow")] YahooValueDto? EarningsLow,
[property: JsonPropertyName("earningsHigh")] YahooValueDto? EarningsHigh,
[property: JsonPropertyName("revenueAverage")] YahooValueDto? RevenueAverage,
[property: JsonPropertyName("revenueLow")] YahooValueDto? RevenueLow,
[property: JsonPropertyName("revenueHigh")] YahooValueDto? RevenueHigh
);
#endregion
@@ -0,0 +1,73 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Yahoo;
/// <summary>
/// Root DTO response returned by https://query2.finance.yahoo.com/v1/finance/search
/// </summary>
public class YahooSearchResponseDto
{
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("quotes")]
public List<YahooSearchQuoteDto> Quotes { get; set; } = new();
[JsonPropertyName("totalTime")]
public int TotalTime { get; set; }
[JsonPropertyName("timeTakenForQuotes")]
public int TimeTakenForQuotes { get; set; }
}
/// <summary>
/// Represents an individual quote item returned within the Yahoo Finance search results.
/// </summary>
public class YahooSearchQuoteDto
{
[JsonPropertyName("symbol")]
public string Symbol { get; set; } = string.Empty;
[JsonPropertyName("shortname")]
public string? ShortName { get; set; }
[JsonPropertyName("longname")]
public string? LongName { get; set; }
[JsonPropertyName("exchange")]
public string? Exchange { get; set; }
[JsonPropertyName("exchDisp")]
public string? ExchDisp { get; set; }
[JsonPropertyName("quoteType")]
public string? QuoteType { get; set; }
[JsonPropertyName("typeDisp")]
public string? TypeDisp { get; set; }
[JsonPropertyName("index")]
public string? Index { get; set; }
[JsonPropertyName("score")]
public double Score { get; set; }
[JsonPropertyName("sector")]
public string? Sector { get; set; }
[JsonPropertyName("sectorDisp")]
public string? SectorDisp { get; set; }
[JsonPropertyName("industry")]
public string? Industry { get; set; }
[JsonPropertyName("industryDisp")]
public string? IndustryDisp { get; set; }
[JsonPropertyName("dispSecIndFlag")]
public bool DispSecIndFlag { get; set; }
[JsonPropertyName("isYahooFinance")]
public bool IsYahooFinance { get; set; }
}
+36
View File
@@ -0,0 +1,36 @@
using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Yahoo;
/// <summary>
/// Represents a Yahoo Finance value wrapper containing raw numerical data alongside formatted strings.
/// </summary>
public record YahooValueDto
{
[JsonPropertyName("raw")]
public double? Raw { get; init; }
[JsonPropertyName("fmt")]
public string? Fmt { get; init; }
[JsonPropertyName("longFmt")]
public string? LongFmt { get; init; }
/// <summary>
/// Helper property to retrieve Raw as double (or fallback 0.0).
/// </summary>
[JsonIgnore]
public double DoubleValue => Raw ?? 0.0;
/// <summary>
/// Helper property to retrieve Raw as decimal (or fallback 0m).
/// </summary>
[JsonIgnore]
public decimal DecimalValue => Raw.HasValue ? (decimal)Raw.Value : 0m;
/// <summary>
/// Helper property to retrieve Raw as long (or fallback 0L).
/// </summary>
[JsonIgnore]
public long LongValue => Raw.HasValue ? (long)Raw.Value : 0L;
}