export interface ChunkDetail {
  id: string
  text: string
  regulation_code: string
  regulation_name: string
  article: string | null
  paragraph: string | null
  chunk_index: number
  chunk_position: 'beginning' | 'middle' | 'end'
  source_url: string
  score?: number
}

export interface Requirement {
  id: string
  text: string
  category: string
  source_chunk_id: string
  regulation_code: string
}

export interface Control {
  id: string
  name: string
  description: string
  source_requirement_ids: string[]
  regulation_codes: string[]
}

export interface TraceabilityResult {
  chunk: ChunkDetail
  requirements: Requirement[]
  controls: Control[]
}

export const API_PROXY = '/api/legal-corpus'

export const REGULATIONS = [
  { code: 'GDPR', name: 'DSGVO' },
  { code: 'EPRIVACY', name: 'ePrivacy' },
  { code: 'TDDDG', name: 'TDDDG' },
  { code: 'SCC', name: 'Standardvertragsklauseln' },
  { code: 'DPF', name: 'EU-US DPF' },
  { code: 'AIACT', name: 'EU AI Act' },
  { code: 'CRA', name: 'Cyber Resilience Act' },
  { code: 'NIS2', name: 'NIS2' },
  { code: 'EUCSA', name: 'EU Cybersecurity Act' },
  { code: 'DATAACT', name: 'Data Act' },
  { code: 'DGA', name: 'Data Governance Act' },
  { code: 'DSA', name: 'Digital Services Act' },
  { code: 'EAA', name: 'Accessibility Act' },
  { code: 'DSM', name: 'DSM-Urheberrecht' },
  { code: 'PLD', name: 'Produkthaftung' },
  { code: 'GPSR', name: 'Product Safety' },
  { code: 'BSI-TR-03161-1', name: 'BSI-TR Teil 1' },
  { code: 'BSI-TR-03161-2', name: 'BSI-TR Teil 2' },
  { code: 'BSI-TR-03161-3', name: 'BSI-TR Teil 3' },
]

export const SAMPLE_QUERIES = [
  { label: 'Art. 17 DSGVO (Recht auf Loeschung)', query: 'Recht auf Löschung Artikel 17', reg: 'GDPR' },
  { label: 'Einwilligung TDDDG', query: 'Einwilligung Endeinrichtung speichern', reg: 'TDDDG' },
  { label: 'AI Act Hochrisiko', query: 'Hochrisiko-KI-System Anforderungen', reg: 'AIACT' },
  { label: 'NIS2 Sicherheitsmaßnahmen', query: 'Cybersicherheitsrisikomanagement Maßnahmen', reg: 'NIS2' },
  { label: 'BSI Authentifizierung', query: 'Authentifizierung Zwei-Faktor mobile', reg: 'BSI-TR-03161-1' },
]
