export enum SportType {
  FOOTBALL = "football",
  BASKETBALL = "basketball",
  BASEBALL = "baseball",
  HOCKEY = "hockey",
  SOCCER = "soccer",
}

export enum EventStatus {
  UPCOMING = "upcoming",
  LIVE = "live",
  COMPLETED = "completed",
  CANCELLED = "cancelled",
}

export interface SportEvent {
  id: number;
  sport: SportType;
  home_team: string;
  away_team: string;
  official_spread: number;
  game_time: string;
  venue: string | null;
  league: string | null;
  min_spread: number;
  max_spread: number;
  min_bet_amount: number;
  max_bet_amount: number;
  status: EventStatus;
  final_score_home: number | null;
  final_score_away: number | null;
  created_by: number;
  created_at: string;
  updated_at: string;
}

export interface SpreadGridBet {
  bet_id: number;
  creator_id: number;
  creator_username: string;
  stake: number;
  status: string;
  team: string;
  can_take: boolean;
  created_at?: string;
  matched_at?: string | null;
}

export type SpreadGrid = {
  [spread: string]: SpreadGridBet[];
};

export interface SportEventWithBets extends SportEvent {
  spread_grid: SpreadGrid;
}

export interface EventComment {
  id: number;
  event_id: number;
  user_id: number;
  username: string;
  content: string;
  created_at: string;
}

export interface EventCommentsResponse {
  comments: EventComment[];
  total: number;
}
