Files
Finlytic/FinlyticCore/Dtos/Sentiment/SectorSentimentSummaryDto.cs

113 lines
3.4 KiB
C#

using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Sentiment;
/// <summary>
/// Individual analysis entry inside a Sector sentiment summary file.
/// </summary>
public record SectorAnalysisEntry
{
/// <summary>
/// Gets or sets the unique analysis ID.
/// </summary>
[JsonPropertyName("analysisId")]
public string AnalysisId { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the timestamp in ISO-8601 format.
/// </summary>
[JsonPropertyName("timestamp")]
public string Timestamp { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the related asset ISIN.
/// </summary>
[JsonPropertyName("relatedIsin")]
public string RelatedIsin { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the article ID.
/// </summary>
[JsonPropertyName("articleId")]
public string ArticleId { get; init; } = string.Empty;
/// <summary>
/// Gets or sets the FinBERT analysis result.
/// </summary>
[JsonPropertyName("finbertResult")]
public FinBertResultDto FinbertResult { get; init; } = new();
}
/// <summary>
/// Current summary aggregate header inside a Sector sentiment summary file.
/// </summary>
public record SectorCurrentSummary
{
/// <summary>
/// Gets or sets the sector compound score (-1.0 to +1.0).
/// </summary>
[JsonPropertyName("compoundScore")]
public double CompoundScore { get; init; }
/// <summary>
/// Gets or sets the overall sector sentiment label ("POSITIVE", "NEGATIVE", "NEUTRAL").
/// </summary>
[JsonPropertyName("sentimentLabel")]
public string SentimentLabel { get; init; } = "NEUTRAL";
/// <summary>
/// Gets or sets the total number of articles analyzed for this sector.
/// </summary>
[JsonPropertyName("totalArticlesAnalyzed")]
public int TotalArticlesAnalyzed { get; init; }
/// <summary>
/// Gets or sets the total number of distinct companies in this sector.
/// </summary>
[JsonPropertyName("totalCompanies")]
public int TotalCompanies { get; init; }
/// <summary>
/// Gets or sets the list of active asset ISINs influencing the sector.
/// </summary>
[JsonPropertyName("activeIsins")]
public List<string> ActiveIsins { get; init; } = [];
/// <summary>
/// Gets or sets the overview text for the sector.
/// </summary>
[JsonPropertyName("text")]
public string Text { get; init; } = string.Empty;
}
/// <summary>
/// Data transfer object for a Sector sentiment summary file.
/// </summary>
public record SectorSentimentSummaryDto
{
/// <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 sector summary metrics and overview.
/// </summary>
[JsonPropertyName("currentSummary")]
public SectorCurrentSummary CurrentSummary { get; init; } = new();
/// <summary>
/// Gets or sets the list of historical sector analysis entries.
/// </summary>
[JsonPropertyName("analyses")]
public List<SectorAnalysisEntry> Analyses { get; init; } = [];
}