idac: fix normal round new round calculation

This commit is contained in:
Dniel97
2026-07-05 23:40:42 +02:00
parent a78f5f4d11
commit 444e0ea04e
+14 -1
View File
@@ -149,11 +149,24 @@ class IDACSeason3TeamService:
past_league_info.rank,
)
new_league_rank_id = promote_effect_param.next_league_rank_id
if promote_effect_param.demote_rank > 0:
# Condition 1: Demotion (falls through to the default demote_league_rank_id)
if past_league_info.rank >= promote_effect_param.demote_rank:
new_league_rank_id = promote_effect_param.demote_league_rank_id
# Condition 2: Maintain Rank (e.g., didn't hit demotion, but rank is > promotion threshold)
elif past_league_info.rank > promote_effect_param.rank:
new_league_rank_id = past_league_info.league_rank_id
# Condition 3: Promotion (falls through to the default next_league_rank_id)
await self.data.team.put_league_info(
LeagueInfoDto(
round_id=self.round_id,
team_id=team.id,
league_rank_id=promote_effect_param.next_league_rank_id,
league_rank_id=new_league_rank_id,
)
)
else: