import { MonitorTargetType } from './monitor-target.entity';

export type LogSeverity = 'info' | 'warning' | 'major' | 'critical';

export type LogAnalysisTemplate = {
  templateId: string;
  templateText: string;
  sampleCount: number;
  sampleMessages: string[];
  levels: string[];
  category: string;
  severity: LogSeverity;
};

export type LogAnalysisIssue = {
  id: string;
  title: string;
  category: string;
  severity: LogSeverity;
  confidence: 'low' | 'medium' | 'high';
  summary: string;
  evidence: string[];
  possibleCauses: string[];
  recommendedActions: string[];
  templateIds: string[];
};

export type LogAnalysisReport = {
  targetType: MonitorTargetType;
  source: {
    openobserve: 'configured' | 'fallback';
    drain3: 'configured' | 'fallback';
  };
  overview: string;
  severity: LogSeverity;
  templates: LogAnalysisTemplate[];
  issues: LogAnalysisIssue[];
  stats: {
    totalLogs: number;
    errorCount: number;
    warnCount: number;
    infoCount: number;
    matchedTemplateCount: number;
  };
};
