Commit 8f27ec1
get_gamification_features() gated leaderboard / achievements / store off the
slugs 'professional' and 'basic', but the canonical platform_plans slugs are
free / starter / pro / business / enterprise. Every tenant on pro, starter, or
business fell through to the ELSE branch and had those features reported as
locked — so students at paying schools saw "Upgrade to Professional" on
features they already owned (e.g. the Point Store on a Pro school).
It also hardcoded the feature tiers instead of reading platform_plans.features,
the source get_plan_features() already uses. Rewrote it to resolve the plan the
same way and read leaderboard / achievements / store straight from
platform_plans.features, so the two functions can no longer drift.
Verified on Code Academy Pro (alice@student.com): store now renders all 6
items, balance + per-item pricing correct, insufficient-coins state correct,
and a successful redeem deducts coins and writes a gamification_redemptions row.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4813dd7 commit 8f27ec1
2 files changed
Lines changed: 49 additions & 0 deletions
File tree
- docs/screenshots
- supabase/migrations
Loading
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments