60 lines
2.3 KiB
C#
60 lines
2.3 KiB
C#
namespace LehrerApp.Core.Models;
|
|
|
|
/// <summary>Vom Nutzer eingegebene Schuladresse. Die Geocodierung erfolgt ausschließlich
|
|
/// serverseitig beim expliziten Speichern, nicht während der Eingabe.</summary>
|
|
public class SchoolLocationRequest
|
|
{
|
|
public string SchoolName { get; set; } = "";
|
|
public string Street { get; set; } = "";
|
|
public string PostalCode { get; set; } = "";
|
|
public string City { get; set; } = "";
|
|
public GermanState State { get; set; } = GermanState.NW;
|
|
}
|
|
|
|
/// <summary>Serverseitig gespeicherter Schulstandort einschließlich des bestätigbaren
|
|
/// Geocoding-Ergebnisses. Koordinaten werden nie an den DWD als Straßenadresse übertragen.</summary>
|
|
public sealed class SchoolLocationProfile : SchoolLocationRequest
|
|
{
|
|
public double Latitude { get; set; }
|
|
public double Longitude { get; set; }
|
|
public string ResolvedAddress { get; set; } = "";
|
|
public DateTime UpdatedAt { get; set; }
|
|
}
|
|
|
|
public sealed class WeatherSnapshot
|
|
{
|
|
public string StationId { get; set; } = "";
|
|
public string StationName { get; set; } = "";
|
|
public double StationDistanceKm { get; set; }
|
|
public DateTime? ForecastIssuedAt { get; set; }
|
|
public DateTime RetrievedAt { get; set; }
|
|
/// <summary>True, wenn der DWD vorübergehend nicht erreichbar war und der Server den zuletzt
|
|
/// erfolgreich gespeicherten Stand zurückgibt.</summary>
|
|
public bool IsStale { get; set; }
|
|
public List<WeatherForecastHour> Forecast { get; set; } = [];
|
|
public List<WeatherWarning> Warnings { get; set; } = [];
|
|
}
|
|
|
|
public sealed class WeatherForecastHour
|
|
{
|
|
public DateTime ValidAt { get; set; }
|
|
public double? TemperatureC { get; set; }
|
|
public double? WindSpeedKmh { get; set; }
|
|
public double? WindGustKmh { get; set; }
|
|
public double? PrecipitationMm { get; set; }
|
|
public double? CloudCoverPercent { get; set; }
|
|
public int? WeatherCode { get; set; }
|
|
}
|
|
|
|
public sealed class WeatherWarning
|
|
{
|
|
public string Identifier { get; set; } = "";
|
|
public string Event { get; set; } = "";
|
|
public string Headline { get; set; } = "";
|
|
public string Description { get; set; } = "";
|
|
public string Instruction { get; set; } = "";
|
|
public string Severity { get; set; } = "";
|
|
public DateTime? Onset { get; set; }
|
|
public DateTime? Expires { get; set; }
|
|
}
|