feat: add optional absolute count to achievement progress#179
Merged
Conversation
Achievement progress is a 0-100 percentage, which can't reconstruct the absolute number behind it (games played, articles read, etc.). Add a nullable, open-ended count column to the achievement_user pivot, settable via grantAchievement() and incremented alongside progress via incrementAchievementProgress(). The count increment is carried on the AchievementProgressionIncreased event.
cjmellor
marked this pull request as ready for review
July 10, 2026 20:56
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.
Achievement progress is a 0–100 percentage, so it can't reconstruct the absolute number behind it — how many games were played, articles read, and so on (requested in #145). This adds an optional
counton the achievement, set when granting viagrantAchievement(achievement: $a, progress: 50, count: 5)and increased alongside progress viaincrementAchievementProgress(achievement: $a, amount: 10, count: 1). Unlike progress, the count is open-ended rather than capped at 100, and a null starting value is treated as zero on first increment. The increment amount is also carried on theAchievementProgressionIncreasedevent so listeners can react to it.Closes #145