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
+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;
}