Repository navigation
feat(achievements): expose the gameplay catalog and a user's achievement record - #108
Merged
Merged
Conversation
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.
Stacked on #107; retarget to
mainonce it merges. Read side for the achievements atlas page (design in evolution-card-gamedocs/architecture/achievements-atlas.md).Summary
GET /api/v1/achievements: the gameplay catalog (code IS NOT NULL, not deleted) with each item's requirement derived from its code (rankedWins/rankedMatches/currentStreak/ladderFirstWinwith target and ladder;nullfor an unknown code). Stableversionhash,ETagand 304 onIf-None-Match.GET /api/v1/users/:userId/achievements: every award of the user with itsawardId(repeated trophies stay distinct) plus lifetime progress computed frommatcheswith the same eligibility as the game-server awarder (not annulled, not deleted, no season filter):rankedWins,rankedMatches,currentStreak(latest 200 rows walked until the first loss) andhasRankedWinByLadderfor TCG, OCG, Edison, JTP and Genesys, resolved through the existing rank-group member patterns so a win on a dated TCG list counts for TCG. 200 with zero counters for a user without matches, 404 for an unknown user. Public like/users/:userId/stats.Queries filter on
anulled = false AND deleted_at IS NULLso they can use the partial index shipped in evolution-types#16.Test plan
bun run lintbun test(564 passed)bun run buildGET /api/v1/achievementslists 13 items;GET /api/v1/users/<id>/achievementsfor a player with ranked history shows plausible lifetime counters