/**
 * SBA Schedule Types
 *
 * Types for schedule data from SBA production API.
 */

/**
 * Current season and week from /current endpoint
 */
export interface SbaCurrent {
  id: number
  season: number
  week: number
  freeze: boolean
  transcount: number
  bstatcount: number
  pstatcount: number
  bet_week: number
  trade_deadline: number
  pick_trade_start: number
  pick_trade_end: number
  playoffs_begin: number
  injury_count: number
}

/**
 * Team info nested in scheduled game
 */
export interface SbaScheduledTeam {
  id: number
  abbrev: string
  sname: string  // Short name e.g., "Cardinals"
  lname: string  // Long name e.g., "St. Louis Cardinals"
  thumbnail?: string
  color?: string
}

/**
 * Scheduled game from /games endpoint
 *
 * Games are returned with nested away_team and home_team objects.
 */
export interface SbaScheduledGame {
  // Game identity
  id: number
  season: number
  week: number
  game_num: number | null  // Game number within the week
  season_type: string      // 'regular', 'playoff', etc.

  // Nested team objects
  away_team: SbaScheduledTeam
  home_team: SbaScheduledTeam

  // Scores (null if not played)
  away_score: number | null
  home_score: number | null

  // Other fields
  scorecard_url: string | null

  // Computed helper properties (for backward compatibility with simpler interface)
  // These are accessed via getter functions in the component
}

/**
 * Schedule API response types
 */
export interface GetCurrentResponse extends SbaCurrent {}

export interface GetScheduleGamesResponse {
  games: SbaScheduledGame[]
  count?: number
}
