namespace TrafagSalesExporter.Services; public interface IPurchasingDashboardService { Task LoadAsync(PurchasingDashboardFilter? filter = null, CancellationToken cancellationToken = default); } public sealed record PurchasingDashboardFilter(DateTime FromDate, DateTime ToDate) { public string Label => $"{FromDate:yyyy-MM-dd} bis {ToDate:yyyy-MM-dd}"; } public sealed class PurchasingDashboardLiveState { public bool SapReachable { get; set; } public bool EkkoLoaded { get; set; } public bool EkpoLoaded { get; set; } public bool EketLoaded { get; set; } public int PurchaseOrderCount { get; set; } public int SupplierCount { get; set; } public DateTime? LatestOrderDate { get; set; } public int PositionSampleCount { get; set; } public int ScheduleSampleCount { get; set; } public bool UsesCache { get; set; } public string CacheStatus { get; set; } = string.Empty; public DateTime? CacheCompletedAtUtc { get; set; } public DateTime? PeriodFrom { get; set; } public DateTime? PeriodTo { get; set; } public decimal SpendChfSample { get; set; } public decimal OpenQuantitySample { get; set; } public decimal OpenValueSample { get; set; } public decimal ContractValueSample { get; set; } public string TopSupplierLabel { get; set; } = string.Empty; public string TopMaterialGroupLabel { get; set; } = string.Empty; public string TopArticleLabel { get; set; } = string.Empty; public List SpendChartRows { get; set; } = []; public List OpenValueChartRows { get; set; } = []; public List ContractChartRows { get; set; } = []; public List DeliveryRiskChartRows { get; set; } = []; public List PriceVarianceChartRows { get; set; } = []; public List SpendConcentrationChartRows { get; set; } = []; public List DataQualityChartRows { get; set; } = []; public List DeliveryRiskRows { get; set; } = []; public List PriceVarianceRows { get; set; } = []; public List SpendConcentrationRows { get; set; } = []; public List DataQualityRows { get; set; } = []; public string Message { get; set; } = string.Empty; } public sealed record PurchasingLiveChartPoint(string Label, decimal Value); public sealed record PurchasingIdeaAnalysisRow(string Label, string Value, string Detail, string Severity);