import { Language } from '@/lib/compliance-i18n'

export interface AuditSession {
  id: string
  name: string
  description: string | null
  auditor_name: string
  auditor_email: string | null
  status: 'draft' | 'in_progress' | 'completed' | 'archived'
  regulation_ids: string[] | null
  total_items: number
  completed_items: number
  created_at: string
  started_at: string | null
  completed_at: string | null
}

export interface AuditChecklistItem {
  requirement_id: string
  regulation_code: string
  article: string
  title: string
  current_result: 'compliant' | 'compliant_notes' | 'non_compliant' | 'not_applicable' | 'pending'
  notes: string | null
  is_signed: boolean
  signed_at: string | null
  signed_by: string | null
  evidence_count: number
  controls_mapped: number
}

export interface AuditStatistics {
  total: number
  compliant: number
  compliant_with_notes: number
  non_compliant: number
  not_applicable: number
  pending: number
  completion_percentage: number
}

export interface Regulation {
  id: string
  code: string
  name: string
  requirement_count: number
}

export const RESULT_STATUS = {
  pending: { label: 'Ausstehend', labelEn: 'Pending', color: 'bg-slate-100 text-slate-700', icon: '○' },
  compliant: { label: 'Konform', labelEn: 'Compliant', color: 'bg-green-100 text-green-700', icon: '✓' },
  compliant_notes: { label: 'Konform (Anm.)', labelEn: 'Compliant w/ Notes', color: 'bg-yellow-100 text-yellow-700', icon: '⚠' },
  non_compliant: { label: 'Nicht konform', labelEn: 'Non-Compliant', color: 'bg-red-100 text-red-700', icon: '✗' },
  not_applicable: { label: 'N/A', labelEn: 'N/A', color: 'bg-slate-50 text-slate-500', icon: '−' },
}

export const SESSION_STATUS = {
  draft: { label: 'Entwurf', color: 'bg-slate-100 text-slate-700' },
  in_progress: { label: 'In Bearbeitung', color: 'bg-blue-100 text-blue-700' },
  completed: { label: 'Abgeschlossen', color: 'bg-green-100 text-green-700' },
  archived: { label: 'Archiviert', color: 'bg-slate-50 text-slate-500' },
}
