/**
 * Types for Alerts Monitoring Admin Page
 */

export interface AlertItem {
  id: string
  title: string
  url: string
  snippet: string
  topic_name: string
  relevance_score: number | null
  relevance_decision: string | null
  status: string
  fetched_at: string
  published_at: string | null
  matched_rule: string | null
  tags: string[]
}

export interface Topic {
  id: string
  name: string
  feed_url: string
  feed_type: string
  is_active: boolean
  fetch_interval_minutes: number
  last_fetched_at: string | null
  alert_count: number
}

export interface Rule {
  id: string
  name: string
  topic_id: string | null
  conditions: Array<{
    field: string
    operator: string
    value: string | number
  }>
  action_type: string
  action_config: Record<string, unknown>
  priority: number
  is_active: boolean
}

export interface Profile {
  priorities: string[]
  exclusions: string[]
  positive_examples: Array<{ title: string; url: string }>
  negative_examples: Array<{ title: string; url: string }>
  policies: {
    keep_threshold: number
    drop_threshold: number
  }
}

export interface Stats {
  total_alerts: number
  new_alerts: number
  kept_alerts: number
  review_alerts: number
  dropped_alerts: number
  total_topics: number
  active_topics: number
  total_rules: number
}

export type TabId = 'dashboard' | 'inbox' | 'topics' | 'rules' | 'profile' | 'audit' | 'documentation'
