import logging
from fastapi import APIRouter
from typing import List
from pydantic import BaseModel

logger = logging.getLogger(f'{__name__}.games')

router = APIRouter()


class GameListItem(BaseModel):
    """Game list item model"""
    game_id: str
    league_id: str
    status: str
    home_team_id: int
    away_team_id: int


@router.get("/", response_model=List[GameListItem])
async def list_games():
    """
    List all games

    TODO Phase 2: Implement game listing with database query
    """
    logger.info("List games endpoint called (stub)")
    return []


@router.get("/{game_id}")
async def get_game(game_id: str):
    """
    Get game details

    TODO Phase 2: Implement game retrieval
    """
    logger.info(f"Get game {game_id} endpoint called (stub)")
    return {"game_id": game_id, "message": "Game retrieval stub"}


@router.post("/")
async def create_game():
    """
    Create new game

    TODO Phase 2: Implement game creation
    """
    logger.info("Create game endpoint called (stub)")
    return {"message": "Game creation stub"}
