feat(registry): admin stat edit, grant and revoke, name and title edit (P7) #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/registry-admin-awards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rewards-admin P7 (plan dodginballs-rewards-admin.md): the admin site can now edit a player's rewards and profile.
PATCH /api/players/{account}{name?, title?}: rename, set or clear the shown title.PUT /api/players/{account}/stats/{key}{game, value}: sets the total over every tier by granting anadminaward of the difference (negative lowers it);*follows; same value grants nothing.POST /api/players/{account}/awards{kind, game, key, amount}:stat,win, orunlockof an active reward item (409 otherwise or when owned).DELETE /api/players/{account}/awards/{id}: revoke any tier; stat/win come off that tier's totals, an unlock'srewardentitlement is revoked.account.title,stats,awards(50 newest, withgrantedBy). Players page: Stats and awards tab (per-tier table, set total, grant, revoke) and a name/title form.playerwith before and after. Admin port only.grantUnlocknow takes anaward, so the server post and the admin grant share it.assumed: a stat edit sets the total across tiers, written as admin tier, because the ledger-sum invariant only lets an admin write the admin tier.
assumed: an admin title is free text (0-24 printable), not checked against reached tiers, because titles in achievements JSON are P8.
assumed: admin unlocks are reward items only; any catalog item can already be granted with the existing admin entitlements route.
Checks: gofmt and vet clean;
go test ./...against real Postgres and MinIO ok, 133 PASS / 0 FAIL, including the new TestAdminPlayerStatGrantAndRevoke, TestAdminPlayerUnlockGrantAndRevoke, TestAdminPlayerNameAndTitle and the sign-in test covering the four new routes. players.js passesnode --check; not driven in a browser.Nothing removed: new routes, no mechanism superseded.
Not deployed: ships with the next registry-v* tag (human action).
https://claude.ai/code/session_01AWkPsp8G3uHTBMTb3Cqnv9
Admin port only, behind withPlayers, every write audited on channel player: PATCH /api/players/{account} (name, title), PUT .../stats/{key} (sets the total over every tier with an admin award of the difference), POST .../awards (stat, win, or a reward unlock), DELETE .../awards/{id} (revoke any tier, off the totals or the entitlement). Player detail gains title, stats and awards; the page gains a Stats and awards tab and a name/title form. Claude-Session: https://claude.ai/code/session_01AWkPsp8G3uHTBMTb3Cqnv9