Team-game ladder support: opponents lists, opposing-team head-to-head, live metadata shape - #306
Merged
Conversation
…d, live leaderboard metadata shape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #292 — team boards become supported tournament ladders — and fixes two real integration bugs found by verifying every assumption against the live upstream API first (payloads fetched 2026-07-25; test players from docs/data-sources.md).
Ground-truth findings (drove the design)
leaderboardmap: [{matchtype_id, statgroup_type, ...}]— thematchtypeskey the parser read no longer exists. That silent key move was the real cause of the June 1 empty-map incident; since then the derived map has been empty every cycle and only the{6: 3}floor kept 1v1 RM matches attributed — every other board's matches have been written withleaderboard_id = NULL. The parser now readsleaderboardmapwith the legacy key as fallback (_leaderboard_matchtype_ids).SOLO_*/TEAM_*taxonomy (SOLO_RM_RANKED), not "1v1 …" — the token check would have 422'd every create in production. Fixtures had drifted from the payload. (No live impact: prod is dormant.) Replaced by an id allowlist, and fixtures across the suite now mirror the real payload shape.statgroup_type: 1— AoE2 team ladders rate players individually with solo statgroups, so the existing personal-stat parsing is already correct for TG; no poller stat changes needed. A live 3v3 match confirmed per-playerteamid/outcome/old|newrating, all of which thematch_playersmodel already stores for every participant.Changes
SUPPORTED_TOURNAMENT_LEADERBOARD_IDS = {1, 2, 3, 4, 13, 14}): the six classic ranked solo + team boards (DM/RM/EW), transcribed from the live payload. Excluded until verified:SOLO_BR(FFA breaks two-team reads),CO_*, POM/RBW customs. Create/PATCH message updated.{6: 3}to all seven public ranked boards' mappings (transcribed, not guessed), with the corrected incident history in the comment.RecentMatchup.opponents: list[MatchupOpponent]): the oldlimit(1)correlated subqueries — which silently reported one arbitrary opponent on team boards — are replaced by one batched participants query over the capped matchups. The legacy scalaropponent_*fields keep their exact pre-Team-game ladder support: multi-opponent matchups, full statgroups, verified matchtype floor #292 contract: populated iff exactly one opponent (1v1), null otherwise — 1v1 consumers are byte-identical.team_id(additive) so the consumer can group sides. Only rostered entrants are listed, as before.docs/data-sources.mdrecords the schema drift + taxonomy so the next integration reads the current truth.Tests
588 passed. New: leaderboardmap + legacy parser shapes; extended-floor merge behavior; guard allow/deny matrix (team board 201, BR 422, unranked 422, unknown 422, EW 201); TG matchup opponents list with allies excluded + scalar nulling; 1v1 scalar byte-compatibility; allies-vs-opposed head-to-head with
team_id. Consumers regenerate orval clients (additive fields only).Closes #292 (and supersedes the #302 name check).