export enum TeamSide {
  HOME = "home",
  AWAY = "away",
}

export enum SpreadBetStatus {
  OPEN = "open",
  MATCHED = "matched",
  COMPLETED = "completed",
  CANCELLED = "cancelled",
  DISPUTED = "disputed",
}

export interface SpreadBetCreate {
  event_id: number;
  spread: number;
  team: TeamSide;
  stake_amount: number;
}

export interface SpreadBet {
  id: number;
  event_id: number;
  spread: number;
  team: TeamSide;
  creator_id: number;
  taker_id: number | null;
  stake_amount: number;
  house_commission_percent: number;
  status: SpreadBetStatus;
  payout_amount: number | null;
  winner_id: number | null;
  created_at: string;
  matched_at: string | null;
  completed_at: string | null;
}

export interface SpreadBetDetail extends SpreadBet {
  creator_username: string;
  taker_username: string | null;
  event_home_team: string;
  event_away_team: string;
  event_official_spread: number;
  event_game_time: string;
}
