namespace KArtSell.Modules.ModelOperations.Observability;

public interface IObservabilityService
{
    Task<ObservabilityMetricsDto> GetMetricsAsync(CancellationToken cancellationToken);
}

public class ObservabilityMetricsDto
{
    public BatchSlaMetrics? BatchSla { get; set; }
    public DataQualityMetrics? DataQuality { get; set; }
    public DuplicateDetectionMetrics? DuplicateDetection { get; set; }
    public ReconciliationMetrics? Reconciliation { get; set; }
    public ModelDriftMetrics? ModelDrift { get; set; }
}

public class BatchSlaMetrics
{
    public int QueueDepth { get; set; }
    public double AverageCompletionTimeSeconds { get; set; }
    public double RetryRate { get; set; }
}

public class DataQualityMetrics
{
    public int QuarantineCount { get; set; }
    public int AgeMinutes { get; set; }
    public List<string> TopFailureReasons { get; set; } = new();
}

public class DuplicateDetectionMetrics
{
    public int ConstraintViolationCount { get; set; }
    public DateTime LastDetected { get; set; }
}

public class ReconciliationMetrics
{
    public double CompletenessPercentage { get; set; }
    public int AuditRecordsCount { get; set; }
}

public class ModelDriftMetrics
{
    public double OosPerformanceValue { get; set; }
    public double BaselineComparison { get; set; }
    public bool DegradationFlag { get; set; }
}
