mirror of
https://github.com/evroon/bracket.git
synced 2026-02-05 12:01:35 -05:00
Create ranking for demo (#893)
This commit is contained in:
@@ -8,8 +8,10 @@ from pydantic import BaseModel
|
||||
|
||||
from bracket.models.db.account import UserAccountType
|
||||
from bracket.models.db.club import ClubCreateBody
|
||||
from bracket.models.db.ranking import RankingCreateBody
|
||||
from bracket.models.db.tournament import TournamentBody
|
||||
from bracket.sql.clubs import create_club
|
||||
from bracket.sql.rankings import sql_create_ranking
|
||||
from bracket.sql.tournaments import sql_create_tournament
|
||||
from bracket.utils.id_types import UserId
|
||||
from bracket.utils.types import assert_some
|
||||
@@ -86,4 +88,7 @@ async def setup_demo_account(user_id: UserId) -> None:
|
||||
duration_minutes=10,
|
||||
margin_minutes=5,
|
||||
)
|
||||
await sql_create_tournament(tournament)
|
||||
tournament_id = await sql_create_tournament(tournament)
|
||||
|
||||
ranking = RankingCreateBody()
|
||||
await sql_create_ranking(tournament_id=tournament_id, ranking_body=ranking, position=0)
|
||||
|
||||
@@ -30,7 +30,7 @@ class RankingBody(BaseModel):
|
||||
|
||||
|
||||
class RankingCreateBody(BaseModel):
|
||||
win_points: Decimal = Decimal("3.0")
|
||||
draw_points: Decimal = Decimal("1.0")
|
||||
win_points: Decimal = Decimal("1.0")
|
||||
draw_points: Decimal = Decimal("0.5")
|
||||
loss_points: Decimal = Decimal("0.0")
|
||||
add_score_points: bool = False
|
||||
|
||||
Reference in New Issue
Block a user