/**
 * Quality Dashboard - Types & Constants
 */

// Types
export interface TestResult {
  test_id: string
  test_name: string
  passed: boolean
  composite_score: number
  intent_accuracy: number
  faithfulness: number
  relevance: number
  coherence: number
  safety: string
  reasoning: string
  expected_intent: string
  detected_intent: string
}

export interface TestRun {
  id: number
  timestamp: string
  git_commit: string
  golden_score: number
  synthetic_score: number
  total_tests: number
  passed_tests: number
  failed_tests: number
  duration_seconds: number
}

export interface BQASMetrics {
  total_tests: number
  passed_tests: number
  failed_tests: number
  avg_intent_accuracy: number
  avg_faithfulness: number
  avg_relevance: number
  avg_coherence: number
  safety_pass_rate: number
  avg_composite_score: number
  scores_by_intent: Record<string, number>
  failed_test_ids: string[]
}

export interface TrendData {
  dates: string[]
  scores: number[]
  trend: 'improving' | 'stable' | 'declining' | 'insufficient_data'
}

export type TabId = 'overview' | 'golden' | 'rag' | 'synthetic' | 'history' | 'scheduler'

// API Configuration
export const VOICE_SERVICE_URL = process.env.NEXT_PUBLIC_VOICE_SERVICE_URL || 'http://localhost:8091'
