40 lines
895 B
C#
40 lines
895 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Backend.MarketDataRequest
|
|
{
|
|
public sealed class LiveEquitySnapshot
|
|
{
|
|
public string Symbol { get; init; } = string.Empty;
|
|
|
|
public double? LastPrice { get; set; }
|
|
public long? Volume { get; set; }
|
|
public double? PreviousClose { get; set; }
|
|
|
|
[JsonPropertyName("openPrice")]
|
|
public double? Open { get; set; }
|
|
public bool MarketOpen { get; set; } = true;
|
|
|
|
[JsonIgnore]
|
|
public bool IsComplete =>
|
|
LastPrice.HasValue &&
|
|
Volume.HasValue &&
|
|
PreviousClose.HasValue &&
|
|
Open.HasValue;
|
|
|
|
[JsonIgnore]
|
|
public bool HasMinimumData =>
|
|
LastPrice.HasValue &&
|
|
PreviousClose.HasValue;
|
|
|
|
public override string ToString()
|
|
{
|
|
return
|
|
$"Symbol={Symbol}, " +
|
|
$"LastPrice={LastPrice}, " +
|
|
$"Volume={Volume}, " +
|
|
$"PreviousClose={PreviousClose}, " +
|
|
$"Open={Open}, " +
|
|
$"MarketOpen={MarketOpen}";
|
|
}
|
|
}
|
|
} |