aktueller Stand

This commit is contained in:
Meik
2026-01-28 12:08:39 +01:00
parent 1283750829
commit ee1f54675e
104 changed files with 6797 additions and 1867 deletions

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace FasdCockpitCommunication.TicketOverview
{
internal sealed class TicketOverviewCountsResponse
{
[JsonProperty("counts")]
public Dictionary<string, int> Counts { get; set; } = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
public Dictionary<string, int> ToDictionary(IEnumerable<string> expectedKeys)
{
var comparer = StringComparer.OrdinalIgnoreCase;
var output = new Dictionary<string, int>(comparer);
if (expectedKeys != null)
{
foreach (var key in expectedKeys)
{
if (string.IsNullOrWhiteSpace(key))
continue;
if (Counts != null && Counts.TryGetValue(key, out var count))
output[key] = count;
else
output[key] = 0;
}
return output;
}
if (Counts != null)
{
foreach (var kvp in Counts)
{
if (string.IsNullOrWhiteSpace(kvp.Key))
continue;
output[kvp.Key] = kvp.Value;
}
}
return output;
}
}
}