export interface Export {
  id: string
  export_type: string
  export_name: string
  status: string
  requested_by: string
  requested_at: string
  completed_at: string | null
  file_path: string | null
  file_hash: string | null
  file_size_bytes: number | null
  total_controls: number | null
  total_evidence: number | null
  compliance_score: number | null
  error_message: string | null
}

export interface Regulation {
  code: string
  name: string
}

export const EXPORT_TYPES = [
  { value: 'full', label: 'Vollstaendiger Export', description: 'Alle Daten inkl. Regulations, Controls, Evidence, Risks' },
  { value: 'controls_only', label: 'Nur Controls', description: 'Control Catalogue mit Mappings' },
  { value: 'evidence_only', label: 'Nur Nachweise', description: 'Evidence-Dateien und Metadaten' },
]

export const DOMAIN_OPTIONS = [
  { value: 'gov', label: 'Governance' },
  { value: 'priv', label: 'Datenschutz' },
  { value: 'iam', label: 'Identity & Access' },
  { value: 'crypto', label: 'Kryptografie' },
  { value: 'sdlc', label: 'Secure Dev' },
  { value: 'ops', label: 'Operations' },
  { value: 'ai', label: 'KI-spezifisch' },
  { value: 'cra', label: 'Supply Chain' },
  { value: 'aud', label: 'Audit' },
]

export function formatFileSize(bytes: number | null): string {
  if (!bytes) return '-'
  if (bytes < 1024) return `${bytes} B`
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
  return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
}
