export interface ServiceModule {
  id: string;
  name: string;
  display_name: string;
  description: string | null;
  service_type: string;
  port: number | null;
  technology_stack: string[];
  repository_path: string | null;
  docker_image: string | null;
  data_categories: string[];
  processes_pii: boolean;
  processes_health_data: boolean;
  ai_components: boolean;
  criticality: string;
  owner_team: string | null;
  is_active: boolean;
  compliance_score: number | null;
  regulation_count: number;
  risk_count: number;
  created_at: string;
  regulations?: Array<{
    code: string;
    name: string;
    relevance_level: string;
    notes: string | null;
  }>;
}

export interface ModulesOverview {
  total_modules: number;
  modules_by_type: Record<string, number>;
  modules_by_criticality: Record<string, number>;
  modules_processing_pii: number;
  modules_with_ai: number;
  average_compliance_score: number | null;
  regulations_coverage: Record<string, number>;
}

export interface RiskAssessment {
  overall_risk: string;
  risk_factors: Array<{ factor: string; severity: string; likelihood: string }>;
  recommendations: string[];
  compliance_gaps: string[];
  confidence_score: number;
}

export const SERVICE_TYPE_CONFIG: Record<string, { icon: string; color: string; bgColor: string }> = {
  backend: { icon: '⚙️', color: 'text-blue-700', bgColor: 'bg-blue-100' },
  database: { icon: '🗄️', color: 'text-purple-700', bgColor: 'bg-purple-100' },
  ai: { icon: '🤖', color: 'text-pink-700', bgColor: 'bg-pink-100' },
  communication: { icon: '💬', color: 'text-green-700', bgColor: 'bg-green-100' },
  storage: { icon: '📦', color: 'text-orange-700', bgColor: 'bg-orange-100' },
  infrastructure: { icon: '🌐', color: 'text-gray-700', bgColor: 'bg-gray-100' },
  monitoring: { icon: '📊', color: 'text-cyan-700', bgColor: 'bg-cyan-100' },
  security: { icon: '🔒', color: 'text-red-700', bgColor: 'bg-red-100' },
};

export const CRITICALITY_CONFIG: Record<string, { color: string; bgColor: string }> = {
  critical: { color: 'text-red-700', bgColor: 'bg-red-100' },
  high: { color: 'text-orange-700', bgColor: 'bg-orange-100' },
  medium: { color: 'text-yellow-700', bgColor: 'bg-yellow-100' },
  low: { color: 'text-green-700', bgColor: 'bg-green-100' },
};

export const RELEVANCE_CONFIG: Record<string, { color: string; bgColor: string }> = {
  critical: { color: 'text-red-700', bgColor: 'bg-red-100' },
  high: { color: 'text-orange-700', bgColor: 'bg-orange-100' },
  medium: { color: 'text-yellow-700', bgColor: 'bg-yellow-100' },
  low: { color: 'text-green-700', bgColor: 'bg-green-100' },
};
