Preparation: add ticket type

This commit is contained in:
2026-03-14 09:28:51 +01:00
parent ed599e7d49
commit 5704329f04
3 changed files with 27 additions and 14 deletions

View File

@@ -1,9 +1,9 @@
from datetime import datetime
from pydantic.dataclasses import dataclass
from datetime import datetime
@dataclass
class Scan:
id: int
date: datetime
event_name: str

View File

@@ -0,0 +1,21 @@
from abc import ABC
from enum import Enum
from pydantic.dataclasses import dataclass
from typing import Callable
class TicketType(str, Enum):
WIN_DRAW_LOSE = "win_draw_lose"
# postup?
WIN_DRAW_LOSE_DOUBLE = "win_draw_lose_double"
WIN_LOSE = "win_lose"
BOTH_TEAM_SCORED = "both_team_scored"
GOAL_AMOUNT = "goal_amount"
...
# Classes that inherit from this are defined in resolution file, so the deciding function can be used
@dataclass
class Ticket(ABC):
ticketType: TicketType
decidingFunction: Callable

View File

@@ -5,7 +5,7 @@ from openpyxl import load_workbook
from pydantic.dataclasses import dataclass
from beaky.config import Config
from beaky.datamodels.scan import Scan
from beaky.datamodels.ticket import Scan
@dataclass
@@ -27,13 +27,6 @@ class Scanner:
@dataclass
class Link:
"""Represents a single link row from an Excel sheet.
Attributes:
id: identifier from the sheet (kept as string)
url: link to the web page
date: optional creation date (datetime or None)
"""
id: str
url: str
date: Optional[datetime] = None
@@ -45,7 +38,6 @@ class Links:
self._path = path.path
else:
self._path = path
self.links: List[Link] = []
def ret_links(self) -> List[Link]: