first commit
This commit is contained in:
14
services/teams_service.py
Normal file
14
services/teams_service.py
Normal 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),
|
||||
)
|
||||
Reference in New Issue
Block a user