/**
 * Compliance types
 *
 * Service modules, requirements, controls, evidence,
 * and audit checklist items for compliance tracking.
 */

import type {
  RiskSeverity,
  RequirementStatus,
  ControlType,
  ImplementationStatus,
  EvidenceType,
} from './core'

// =============================================================================
// SERVICE MODULES
// =============================================================================

export interface ServiceModule {
  id: string
  name: string
  description: string
  regulations: string[]
  criticality: RiskSeverity
  processesPersonalData: boolean
  hasAIComponents: boolean
}

// =============================================================================
// REQUIREMENTS & CONTROLS
// =============================================================================

export interface Requirement {
  id: string
  regulation: string
  article: string
  title: string
  description: string
  criticality: RiskSeverity
  applicableModules: string[]
  status: RequirementStatus
  controls: string[]
}

export interface Control {
  id: string
  name: string
  description: string
  type: ControlType
  category: string
  implementationStatus: ImplementationStatus
  effectiveness: RiskSeverity
  evidence: string[]
  owner: string | null
  dueDate: Date | null
}

export interface Evidence {
  id: string
  controlId: string
  type: EvidenceType
  name: string
  description: string
  fileUrl: string | null
  validFrom: Date
  validUntil: Date | null
  uploadedBy: string
  uploadedAt: Date
}

// =============================================================================
// CHECKLIST
// =============================================================================

export interface ChecklistItem {
  id: string
  requirementId: string
  title: string
  description: string
  status: 'PENDING' | 'PASSED' | 'FAILED' | 'NOT_APPLICABLE'
  notes: string
  verifiedBy: string | null
  verifiedAt: Date | null
}
