feat(achievements): add 67 and 666 reading streak achievements#3986
Closed
idoshamun wants to merge 3 commits into
Closed
feat(achievements): add 67 and 666 reading streak achievements#3986idoshamun wants to merge 3 commits into
idoshamun wants to merge 3 commits into
Conversation
Extend ContributionRewardType with store_discount, suggest_causes, council, patchy_picture, joke and trivia. Cores and plus_days already grant automatically; the new types now: - suggest_causes: grants the cause-suggestion right via a user flag - store_discount, council: mark fulfilled and ping #contributions with the contributor's email so the team can send the coupon / invite - patchy_picture, joke, trivia: content-only, mark fulfilled (payload rides on the tier metadata, rendered client-side) Slack fires after the claim commits, so a failed claim never notifies and a Slack outage never fails the claim.
Address review: use the Feature table (wired to the feature-flag system) for the suggest_causes right instead of a User.flags field. Adds a contribution_suggest_causes FeatureType, granted idempotently on claim.
Add contributionFoundingAward query returning totalSpots, claimedCount, and the visitor's founding membership + 1-based number (null for non-members/anon). Public like contributionStatus so the spots counter renders for everyone. Frontend was showing hardcoded placeholders.
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.
What
Adds two new
reading_streakmilestone achievements:Full reading-streak set is now 10, 50, 67, 365, 512, 666, 1024.
Changes
AddMoreReadingStreakAchievements— inserts the two achievement rows (badges already uploaded to Cloudinaryachievements/folder).bin/syncReadingStreakAchievements.ts— one-off script to retroactively unlock the new milestones for users whosemaxStreakalready qualifies. Idempotent (reusesupdateUserAchievementProgress), scoped to the two new achievements andmaxStreak >= 67.Post-deploy
Run the backfill after this migration deploys (the rows must exist first):
npx ts-node bin/syncReadingStreakAchievements.tsNotes
No new unit test: the CDC worker already covers the generic reading-streak unlock path; 67/666 exercise the identical
evaluateAbsoluteValueAchievementcode path. Migration verified by applying locally; existing streak tests pass.