export interface Regulation {
  id: string
  code: string
  name: string
  full_name: string
  regulation_type: string
  source_url: string | null
  local_pdf_path: string | null
  requirement_count: number
}

export interface Requirement {
  id: string
  regulation_id: string
  regulation_code?: string
  article: string
  paragraph: string | null
  title: string
  description: string | null
  requirement_text: string | null
  breakpilot_interpretation: string | null
  implementation_status: string
  implementation_details: string | null
  code_references: Array<{ file: string; line?: number; description: string }> | null
  evidence_description: string | null
  audit_status: string
  auditor_notes: string | null
  is_applicable: boolean
  applicability_reason: string | null
  priority: number
  source_page: number | null
  source_section: string | null
}

export interface RequirementUpdate {
  implementation_status?: string
  implementation_details?: string
  code_references?: Array<{ file: string; line?: number; description: string }>
  evidence_description?: string
  audit_status?: string
  auditor_notes?: string
  is_applicable?: boolean
  applicability_reason?: string
}

export interface AIInterpretation {
  summary: string
  applicability: string
  technical_measures: string[]
  affected_modules: string[]
  risk_level: string
  implementation_hints: string[]
  confidence_score: number
  error?: string
}

export interface Category {
  id: string
  name: string
  requirement_count: number
}

export const IMPLEMENTATION_STATUS = {
  not_started: { label: 'Nicht gestartet', color: 'bg-slate-400' },
  in_progress: { label: 'In Arbeit', color: 'bg-yellow-500' },
  implemented: { label: 'Implementiert', color: 'bg-blue-500' },
  verified: { label: 'Verifiziert', color: 'bg-green-500' },
}

export const AUDIT_STATUS = {
  pending: { label: 'Ausstehend', color: 'bg-slate-400' },
  in_review: { label: 'In Pruefung', color: 'bg-yellow-500' },
  approved: { label: 'Genehmigt', color: 'bg-green-500' },
  rejected: { label: 'Abgelehnt', color: 'bg-red-500' },
}

export const PRIORITY_LABELS: Record<number, { label: string; color: string }> = {
  1: { label: 'Kritisch', color: 'text-red-600' },
  2: { label: 'Hoch', color: 'text-orange-600' },
  3: { label: 'Mittel', color: 'text-yellow-600' },
}
