// =============================================================================
// API TYPES
// =============================================================================

import type { DocumentType } from './enums'
import type { AIDocumentAnalysis, EvidenceDocument } from './evidence'
import type { GapAnalysisResult } from './gap-analysis'
import type { TOMGeneratorState, RulesEngineEvaluationContext, RulesEngineResult } from './state'

export interface TOMGeneratorStateRequest {
  tenantId: string
}

export interface TOMGeneratorStateResponse {
  success: boolean
  state: TOMGeneratorState | null
  error?: string
}

export interface ControlsEvaluationRequest {
  tenantId: string
  context: RulesEngineEvaluationContext
}

export interface ControlsEvaluationResponse {
  success: boolean
  results: RulesEngineResult[]
  evaluatedAt: string
}

export interface EvidenceUploadRequest {
  tenantId: string
  documentType: DocumentType
  validFrom?: string
  validUntil?: string
}

export interface EvidenceUploadResponse {
  success: boolean
  document: EvidenceDocument | null
  error?: string
}

export interface EvidenceAnalyzeRequest {
  documentId: string
  tenantId: string
}

export interface EvidenceAnalyzeResponse {
  success: boolean
  analysis: AIDocumentAnalysis | null
  error?: string
}

export interface ExportRequest {
  tenantId: string
  format: 'DOCX' | 'PDF' | 'JSON' | 'ZIP'
  language: 'de' | 'en'
}

export interface ExportResponse {
  success: boolean
  exportId: string
  filename: string
  downloadUrl?: string
  error?: string
}

export interface GapAnalysisRequest {
  tenantId: string
}

export interface GapAnalysisResponse {
  success: boolean
  result: GapAnalysisResult | null
  error?: string
}
