using System; using System.Collections.Generic; namespace FasdDesktopUi.Basics.Services.Models { public sealed class TicketOverviewCountsChangedEventArgs : EventArgs { public TicketOverviewCountsChangedEventArgs(IReadOnlyList changes, IReadOnlyDictionary currentCounts, TileScope? initializedScope = null) { Changes = changes ?? Array.Empty(); CurrentCounts = currentCounts; InitializedScope = initializedScope; } public IReadOnlyList Changes { get; } public IReadOnlyDictionary CurrentCounts { get; } public TileScope? InitializedScope { get; } } public readonly struct TileCountChange { public TileCountChange(string key, TileScope scope, int oldCount, int newCount) { Key = key; Scope = scope; OldCount = oldCount; NewCount = newCount; } public string Key { get; } public TileScope Scope { get; } public int OldCount { get; } public int NewCount { get; } public int Delta => NewCount - OldCount; } public readonly struct TileCounts { public static TileCounts Empty => new TileCounts(0, 0); public TileCounts(int personal, int role) { Personal = personal; Role = role; } public int Personal { get; } public int Role { get; } } public enum TileScope { Personal, Role } }