"""
Common interface every bookmaker scraper follows, so the rest of the
pipeline (matcher, arb calculator) doesn't care which book the odds came from.
"""

from dataclasses import dataclass
from typing import List


@dataclass
class OddsEntry:
    bookmaker: str        # e.g. "sportpesa", "betika"
    sport: str             # e.g. "football"
    home_team: str
    away_team: str
    kickoff_utc: str       # ISO timestamp string, so events can be matched by time too
    market: str             # e.g. "match_winner", "over_under_2.5"
    outcome: str            # e.g. "home", "draw", "away", "over", "under"
    odds: float              # decimal odds, e.g. 2.10


class BaseScraper:
    """
    Subclass this for each bookmaker. Only fetch_odds() needs implementing.
    """

    name = "base"

    def fetch_odds(self, sport: str) -> List[OddsEntry]:
        raise NotImplementedError
