/**
 * Health View Data Types
 *
 * Defines the UI model for health monitoring data.
 * This layer isolates the UI from API churn by providing a stable interface
 * between the API layer and the presentation layer.
 */

export interface HealthStatus {
  status: 'ok' | 'degraded' | 'error' | 'unknown';
  timestamp: string;
  formattedTimestamp: string;
  relativeTime: string;
  statusLabel: string;
  statusColor: string;
  statusIcon: string;
}

export interface HealthMetrics {
  uptime: string;
  responseTime: string;
  errorRate: string;
  lastCheck: string;
  formattedLastCheck: string;
  checksPassed: number;
  checksFailed: number;
  totalChecks: number;
  successRate: string;
}

export interface HealthComponent {
  name: string;
  status: 'ok' | 'degraded' | 'error' | 'unknown';
  statusLabel: string;
  statusColor: string;
  statusIcon: string;
  lastCheck: string;
  formattedLastCheck: string;
  responseTime: string;
  errorRate: string;
}

export interface HealthAlert {
  id: string;
  type: 'critical' | 'warning' | 'info';
  title: string;
  message: string;
  timestamp: string;
  formattedTimestamp: string;
  relativeTime: string;
  severity: string;
  severityColor: string;
}

export interface HealthViewData {
  overallStatus: HealthStatus;
  metrics: HealthMetrics;
  components: HealthComponent[];
  alerts: HealthAlert[];
  hasAlerts: boolean;
  hasDegradedComponents: boolean;
  hasErrorComponents: boolean;
  lastUpdated: string;
  formattedLastUpdated: string;
}
