// ==========================================
// INTERFACES - FINDINGS
// ==========================================

import type { LocalizedText } from './common'
import type { FindingType, FindingCategory, FindingSeverity, FindingStatus } from './enums'

export interface Citation {
  documentId: string
  versionId?: string
  page: number
  startChar: number
  endChar: number
  quotedText: string
  quoteHash: string // SHA-256 zur Verifizierung
}

export interface Finding {
  id: string
  tenantId: string
  contractId: string
  vendorId: string

  // Klassifikation
  type: FindingType
  category: FindingCategory
  severity: FindingSeverity

  // Inhalt
  title: LocalizedText
  description: LocalizedText
  recommendation?: LocalizedText

  // Citations (Textstellen-Belege)
  citations: Citation[]

  // Verknuepfung
  affectedRequirement?: string // z.B. "Art. 28 Abs. 3 lit. a DSGVO"
  triggeredControls: string[] // Control-IDs

  // Workflow
  status: FindingStatus
  assignee?: string
  dueDate?: Date
  resolution?: string
  resolvedAt?: Date

  createdAt: Date
  updatedAt: Date
}
