namespace CMSMicroservice.Application.HealthCQ.Queries.GetSystemHealth;

public class GetSystemHealthResponseDto
{
    public bool OverallHealthy { get; set; }
    public List<ServiceHealthDto> Services { get; set; } = new();
    public DateTime CheckedAt { get; set; }
    public string Version { get; set; } = string.Empty;
    public string Environment { get; set; } = string.Empty;
}

public class ServiceHealthDto
{
    public string ServiceName { get; set; } = string.Empty;
    public HealthStatusDto Status { get; set; }
    public string Description { get; set; } = string.Empty;
    public long ResponseTimeMs { get; set; }
    public DateTime LastCheck { get; set; }
    public List<HealthDetailDto> Details { get; set; } = new();
}

public class HealthDetailDto
{
    public string Key { get; set; } = string.Empty;
    public string Value { get; set; } = string.Empty;
    public HealthStatusDto Status { get; set; }
}

public enum HealthStatusDto
{
    Unknown = 0,
    Healthy = 1,
    Degraded = 2,
    Unhealthy = 3
}