export interface PitchCompany {
  id: number
  name: string
  legal_form: string
  founding_date: string
  tagline_de: string
  tagline_en: string
  mission_de: string
  mission_en: string
  website: string
  hq_city: string
}

export interface PitchTeamMember {
  id: number
  name: string
  role_de: string
  role_en: string
  bio_de: string
  bio_en: string
  equity_pct: number
  expertise: string[]
  linkedin_url: string
  photo_url: string
}

export interface PitchFinancial {
  id: number
  year: number
  revenue_eur: number
  costs_eur: number
  mrr_eur: number
  burn_rate_eur: number
  customers_count: number
  employees_count: number
  arr_eur: number
}

export interface PitchMarket {
  id: number
  market_segment: string
  label: string
  value_eur: number
  growth_rate_pct: number
  source: string
}

export interface PitchCompetitor {
  id: number
  name: string
  customers_count: number
  pricing_range: string
  strengths: string[]
  weaknesses: string[]
  website: string
}

export interface PitchFeature {
  id: number
  feature_name_de: string
  feature_name_en: string
  category: string
  breakpilot: boolean
  proliance: boolean
  dataguard: boolean
  heydata: boolean
  is_differentiator: boolean
}

export interface PitchMilestone {
  id: number
  milestone_date: string
  title_de: string
  title_en: string
  description_de: string
  description_en: string
  status: 'completed' | 'in_progress' | 'planned'
  category: string
}

export interface PitchMetric {
  id: number
  metric_name: string
  label_de: string
  label_en: string
  value: string
  unit: string
  is_live: boolean
}

export interface PitchFunding {
  id: number
  round_name: string
  amount_eur: number
  use_of_funds: { category: string; percentage: number; label_de: string; label_en: string }[]
  instrument: string
  target_date: string
  status: string
}

export interface PitchProduct {
  id: number
  name: string
  hardware: string
  hardware_cost_eur: number
  monthly_price_eur: number
  llm_model: string
  llm_size: string
  llm_capability_de: string
  llm_capability_en: string
  features_de: string[]
  features_en: string[]
  is_popular: boolean
  operating_cost_eur: number
}

export interface FpScenarioRef {
  id: string
  name: string
  is_default?: boolean
  color?: string
  description?: string
}

export interface PitchData {
  company: PitchCompany
  team: PitchTeamMember[]
  financials: PitchFinancial[]
  market: PitchMarket[]
  competitors: PitchCompetitor[]
  features: PitchFeature[]
  milestones: PitchMilestone[]
  metrics: PitchMetric[]
  funding: PitchFunding
  products: PitchProduct[]
  fp_scenarios?: FpScenarioRef[]
}

// Financial Model Types
export interface FMScenario {
  id: string
  name: string
  description: string
  is_default: boolean
  color: string
  assumptions: FMAssumption[]
}

export interface FMAssumption {
  id: string
  scenario_id: string
  key: string
  label_de: string
  label_en: string
  value: number | number[]
  value_type: 'scalar' | 'step' | 'timeseries'
  unit: string
  min_value: number | null
  max_value: number | null
  step_size: number | null
  category: string
  sort_order: number
}

export interface FMResult {
  month: number
  year: number
  month_in_year: number
  new_customers: number
  churned_customers: number
  total_customers: number
  mrr_eur: number
  arr_eur: number
  revenue_eur: number
  cogs_eur: number
  personnel_eur: number
  infra_eur: number
  marketing_eur: number
  total_costs_eur: number
  employees_count: number
  gross_margin_pct: number
  burn_rate_eur: number
  runway_months: number
  cac_eur: number
  ltv_eur: number
  ltv_cac_ratio: number
  cash_balance_eur: number
  cumulative_revenue_eur: number
}

export interface FMComputeResponse {
  scenario_id: string
  results: FMResult[]
  summary: {
    final_arr: number
    final_customers: number
    break_even_month: number | null
    final_runway: number
    final_ltv_cac: number
    peak_burn: number
    total_funding_needed: number
  }
}

// Investor Auth Types
export interface Investor {
  id: string
  email: string
  name: string | null
  company: string | null
  status: 'invited' | 'active' | 'revoked'
  last_login_at: string | null
  login_count: number
  created_at: string
}

export interface InvestorSnapshot {
  id: string
  scenario_id: string
  assumptions: Record<string, number | number[]>
  label: string | null
  is_latest: boolean
  created_at: string
}

export type Language = 'de' | 'en'

export interface ChatMessage {
  role: 'user' | 'assistant'
  content: string
}

export type SlideId =
  | 'intro-presenter'
  | 'executive-summary'
  | 'cover'
  | 'problem'
  | 'solution'
  | 'usp'
  | 'regulatory-landscape'
  | 'product'
  | 'how-it-works'
  | 'market'
  | 'business-model'
  | 'traction'
  | 'competition'
  | 'team'
  | 'financials'
  | 'the-ask'
  | 'cap-table'
  | 'customer-savings'
  | 'ai-qa'
  | 'annex-assumptions'
  | 'annex-architecture'
  | 'annex-gtm'
  | 'annex-regulatory'
  | 'annex-engineering'
  | 'annex-aipipeline'
  | 'annex-sdk-demo'
  | 'annex-strategy'
  | 'annex-finanzplan'
  | 'annex-glossary'
  | 'risks'
  | 'legal-disclaimer'
