diff --git a/src/beaky/datamodels/ticket.py b/src/beaky/datamodels/ticket.py index 82745ed..e11286a 100644 --- a/src/beaky/datamodels/ticket.py +++ b/src/beaky/datamodels/ticket.py @@ -20,7 +20,7 @@ class BetType(str, Enum): class BetOutcome(str, Enum): WIN = "win" LOSE = "lose" - VOID = "void" # stake returned (e.g. WinLose on draw, integer goal line hit) + VOID = "void" # stake returned (e.g. WinLose on draw, integer goal line hit) UNKNOWN = "unknown" # fixture not found or unclassified bet @@ -49,6 +49,7 @@ class Bet(ABC): @dataclass class WinDrawLose(Bet): """Výsledek zápasu 1X2""" + betType: Literal["X", "0", "1", "2"] = "0" def resolve(self, match: MatchInfo) -> BetOutcome: @@ -71,6 +72,7 @@ class Advance(Bet): @dataclass class WinDrawLoseDouble(Bet): """Výsledek zápasu - double""" + betType: Literal["01", "12", "02"] = "01" def resolve(self, match: MatchInfo) -> BetOutcome: @@ -82,6 +84,7 @@ class WinDrawLoseDouble(Bet): @dataclass class WinLose(Bet): """Výsledek zápasu bez remízy""" + betType: Literal["1", "2"] = "1" def resolve(self, match: MatchInfo) -> BetOutcome: @@ -101,8 +104,9 @@ class BothTeamScored(Bet): @dataclass class GoalAmount(Bet): """Počet gólů v zápasu — over/under total goals""" - line: float = 0.0 # goal line, e.g. 2.5 - over: bool = True # True = more than line, False = less than line + + line: float = 0.0 # goal line, e.g. 2.5 + over: bool = True # True = more than line, False = less than line def resolve(self, match: MatchInfo) -> BetOutcome: total = match.goals_home + match.goals_away @@ -115,8 +119,9 @@ class GoalAmount(Bet): @dataclass class GoalHandicap(Bet): """Goal handicap for a specific team — add handicap_amount to team's score, team wins = you win""" + team_bet: Literal["1", "2"] = "1" # which team the handicap is applied to - handicap_amount: float = 0.0 # e.g. +1.5 or -0.5 + handicap_amount: float = 0.0 # e.g. +1.5 or -0.5 def resolve(self, match: MatchInfo) -> BetOutcome: home = match.goals_home + (self.handicap_amount if self.team_bet == "1" else 0.0) @@ -128,8 +133,9 @@ class GoalHandicap(Bet): @dataclass -class UnknownTicket(Bet): +class UnknownBet(Bet): """Bet type that could not be classified""" + raw_text: str = "" def resolve(self, match: MatchInfo) -> BetOutcome: