179 lines
5.3 KiB
C#
179 lines
5.3 KiB
C#
using System.Collections.Generic;
|
|
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 number of positive articles.
|
|
/// </summary>
|
|
[JsonPropertyName("positiveArticles")]
|
|
public int PositiveArticles { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the number of negative articles.
|
|
/// </summary>
|
|
[JsonPropertyName("negativeArticles")]
|
|
public int NegativeArticles { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the number of neutral articles.
|
|
/// </summary>
|
|
[JsonPropertyName("neutralArticles")]
|
|
public int NeutralArticles { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the sentiment trend ("IMPROVING", "DETERIORATING", "STABLE").
|
|
/// </summary>
|
|
[JsonPropertyName("trend")]
|
|
public string? Trend { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the key highlight summary.
|
|
/// </summary>
|
|
[JsonPropertyName("keyHighlight")]
|
|
public string? KeyHighlight { 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.
|
|
/// </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; } = [];
|
|
}
|