Files
Finlytic/FinlyticCore/Dtos/Sentiment/IsinSentimentSummaryDto.cs
T

148 lines
4.4 KiB
C#

using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Sentiment;
/// <summary>
/// Article metadata referenced inside an ISIN analysis event.
/// </summary>
public record IsinAnalysisArticleRef
{
/// <summary>
/// Gets or sets the article identifier.
/// </summary>
[JsonPropertyName("articleId")]
public string ArticleId { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the article title.
/// </summary>
[JsonPropertyName("title")]
public string Title { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the article source name.
/// </summary>
[JsonPropertyName("source")]
public string Source { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the publication timestamp in ISO-8601 format.
/// </summary>
[JsonPropertyName("publishedAt")]
public string PublishedAt { get; init; } = string.Empty;
}
/// <summary>
/// Individual chronological analysis entry inside an ISIN summary file.
/// </summary>
public record IsinAnalysisEntry
{
/// <summary>
/// Gets or sets the unique analysis ID (e.g. "sent_20260722_001").
/// </summary>
[JsonPropertyName("analysisId")]
public string AnalysisId { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the analysis timestamp in ISO-8601 format.
/// </summary>
[JsonPropertyName("timestamp")]
public string Timestamp { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the referenced article details.
/// </summary>
[JsonPropertyName("article")]
public IsinAnalysisArticleRef Article { get; init; } = new();
/// <summary>
/// Gets or sets the FinBERT analysis result.
/// </summary>
[JsonPropertyName("finbertResult")]
public FinBertResultDto FinbertResult { get; init; } = new();
/// <summary>
/// Gets or sets the summary snippet.
/// </summary>
[JsonPropertyName("summarySnippet")]
public string SummarySnippet { get; init; } = string.Empty;
}
/// <summary>
/// Current summary aggregate header inside an ISIN sentiment summary file.
/// </summary>
public record IsinCurrentSummary
{
/// <summary>
/// Gets or sets the average compound score (-1.0 to +1.0).
/// </summary>
[JsonPropertyName("compoundScore")]
public double CompoundScore { get; init; }
/// <summary>
/// Gets or sets the overall sentiment label ("POSITIVE", "NEGATIVE", "NEUTRAL").
/// </summary>
[JsonPropertyName("sentimentLabel")]
public string SentimentLabel { get; init; } = "NEUTRAL";
/// <summary>
/// Gets or sets the average confidence across analyzed articles.
/// </summary>
[JsonPropertyName("avgConfidence")]
public double AvgConfidence { get; init; }
/// <summary>
/// Gets or sets the total number of articles analyzed for this ISIN.
/// </summary>
[JsonPropertyName("totalArticlesAnalyzed")]
public int TotalArticlesAnalyzed { get; init; }
/// <summary>
/// Gets or sets the overall synthesized sentiment text overview.
/// </summary>
[JsonPropertyName("text")]
public string Text { get; init; } = string.Empty;
}
/// <summary>
/// Data transfer object for an ISIN sentiment summary file (stored in data/summaries/isin/ISIN.json).
/// </summary>
public record IsinSentimentSummaryDto
{
/// <summary>
/// Gets or sets the ISIN code.
/// </summary>
[JsonPropertyName("isin")]
public string Isin { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the company name.
/// </summary>
[JsonPropertyName("companyName")]
public string CompanyName { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the sector name.
/// </summary>
[JsonPropertyName("sector")]
public string Sector { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the last updated timestamp in ISO-8601 format.
/// </summary>
[JsonPropertyName("lastUpdated")]
public string LastUpdated { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the current summary metrics and overview.
/// </summary>
[JsonPropertyName("currentSummary")]
public IsinCurrentSummary CurrentSummary { get; init; } = new();
/// <summary>
/// Gets or sets the list of historical analysis entries.
/// </summary>
[JsonPropertyName("analyses")]
public List<IsinAnalysisEntry> Analyses { get; init; } = [];
}