This commit is contained in:
2024-10-13 16:34:46 +02:00
parent b6755ae77f
commit d7d7db8dd4
12 changed files with 140 additions and 85 deletions

View File

@@ -2,9 +2,9 @@
namespace Jugenddienst_Stunden.Types;
public class Base {
public Collection<Projekt> Projekte { get; set; }
public Collection<Gemeinde> Gemeinden { get; set; }
public Collection<Freistellung> Freistellungen { get; set; }
public Collection<Projekt>? Projekte { get; set; }
public Collection<Gemeinde>? Gemeinden { get; set; }
public Collection<Freistellung>? Freistellungen { get; set; }
public int EmployeeId { get; set; }
public Hours Hours { get; set; }

View File

@@ -7,35 +7,38 @@ namespace Jugenddienst_Stunden.Types;
/// </summary>
public class DayTime {
public int? id { get; set; }
public int EmployeeId { get; set; }
public int? EmployeeId { get; set; }
public DateTime day { get; set; }
public int wday { get; set; }
public int? wday { get; set; }
public TimeOnly begin { get; set; }
public TimeOnly end { get; set; }
public string description { get; set; }
public string? description { get; set; }
public string? free { get; set; }
public bool? approved { get; set; }
public int? type { get; set; }
public int? projekt { get; set; }
public int? gemeinde { get; set; }
public TimeOnly night { get; set; }
public Dictionary<string, TimeOnly> total { get; set; }
public TimeOnly end_print { get; set; }
public TimeSpan TimeSpanVon { get; set; }
public TimeSpan TimeSpanBis { get; set; }
public Collection<Projekt> Projekte { get; set; }
public Collection<Gemeinde> Gemeinden { get; set; }
public Collection<Freistellung> Freistellungen { get; set; }
public TimeOnly? night { get; set; }
public Dictionary<string, TimeOnly>? total { get; set; }
public TimeOnly? end_print { get; set; }
public TimeSpan? TimeSpanVon { get; set; }
public TimeSpan? TimeSpanBis { get; set; }
public Collection<Projekt>? Projekte { get; set; }
public Collection<Gemeinde>? Gemeinden { get; set; }
public Collection<Freistellung>? Freistellungen { get; set; }
/// <summary>
/// Gets the active Gemeinde based on the gemeinde ID.
/// </summary>
public Gemeinde GemeindeAktiv { get; set; }
public Gemeinde? GemeindeAktiv { get; set; }
/// <summary>
/// Gets the active Projekt based on the projekt ID.
/// </summary>
public Projekt ProjektAktiv { get; set; }
public Projekt? ProjektAktiv { get; set; }
public Freistellung FreistellungAktiv { get; set; }
/// <summary>
/// Gets the active Freistellung based on the Freistellung ID
/// </summary>
public Freistellung? FreistellungAktiv { get; set; }
}

View File

@@ -6,6 +6,6 @@ using System.Threading.Tasks;
namespace Jugenddienst_Stunden.Types;
public class Freistellung {
public string Id { get; set; }
public string Name { get; set; }
public string? Id { get; set; }
public string? Name { get; set; }
}

View File

@@ -18,5 +18,5 @@ public class Gemeinde {
/// <summary>
/// Name der Gemeinde.
/// </summary>
public string Name { get; set; }
public string? Name { get; set; }
}

View File

@@ -6,14 +6,14 @@ using System.Collections.ObjectModel;
namespace Jugenddienst_Stunden.Types;
public class Hours : ObservableObject {
public string zeit;
public string nominal;
public string? zeit;
public string? nominal;
//public Dictionary<DateOnly,NominalDay> nominal_day_api;
public List<NominalDay> nominal_day_api;
public List<NominalDay>? nominal_day_api;
//public Dictionary<int,NominalWeek> nominal_week_api;
public List<NominalWeek> nominal_week_api;
public List<NominalWeek>? nominal_week_api;
//public List<string> time_line;
public string zeit_total;
public string? zeit_total;
//https://stackoverflow.com/questions/29449641/deserialize-json-when-a-value-can-be-an-object-or-an-empty-array/29450279#29450279
//[JsonConverter(typeof(JsonSingleOrEmptyArrayConverter<Hours>))]