first commit

This commit is contained in:
2026-04-20 11:56:11 +03:00
commit 8d80fadb56
103 changed files with 19756 additions and 0 deletions

14
services/teams_service.py Normal file
View File

@@ -0,0 +1,14 @@
from repositories.team_repository import upsert_team
def sync_teams(teams_data: list[dict]) -> None:
for team in teams_data:
upsert_team(
external_id=team["external_id"],
name=team["name"],
logo_url=team["logo_url"],
games=int(team.get("games", 0) or 0),
wins=int(team.get("wins", 0) or 0),
goals=int(team.get("goals", 0) or 0),
tournaments=int(team.get("tournaments", 0) or 0),
)