export type DashboardSection = 'cls' | 'opinions' | 'input'
export type Sentiment = '看多' | '看空' | '中性'

export interface Account {
  id: string
  name: string
  description: string
}

export interface DailyInputAccount {
  account_id: string
  account_name: string
  links: string[]
}

export interface DailyInputDocument {
  date: string
  updated_at: string
  accounts: DailyInputAccount[]
}

export interface DailyInputUpsertPayload {
  accounts: Array<{
    account_id: string
    links: string[]
  }>
}

export interface OpinionArticle {
  id: string
  account_id: string
  account_name: string
  title: string
  published_at: string
  summary: string
  source_url: string
  sectors: string[]
  sentiment: Sentiment
  article_type: string
}

export interface ReportDocument {
  date: string
  generated_at: string
  summary: string
  focus_sectors: string[]
  article_count: number
  account_count: number
  articles: OpinionArticle[]
}

export interface ReportListItem {
  date: string
  generated_at: string
  summary: string
  article_count: number
  focus_sectors: string[]
}

export interface ClsNewsItem {
  id: string
  title: string
  published_at: string
  source: string
  summary: string
  reference_url: string
  sectors: string[]
  sentiment: Sentiment
}

export interface ClsNewsSummary {
  overview: string
  hot_topics: string
  watch_list: string[]
}

export interface ClsSectorImpact {
  sector: string
  sentiment: Sentiment
  reason: string
  related_titles: string[]
}

export interface ClsNewsDocument {
  date: string
  updated_at: string
  window_label: string
  summary: ClsNewsSummary
  sector_impacts: ClsSectorImpact[]
  items: ClsNewsItem[]
}
