feat(registry): admin stat edit, grant and revoke, name and title edit (P7) #22

Merged
kblack0610 merged 1 commit from feat/registry-admin-awards into main 2026-11-04 21:47:41 +00:00
Owner

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 an admin award of the difference (negative lowers it); * follows; same value grants nothing.
  • POST /api/players/{account}/awards {kind, game, key, amount}: stat, win, or unlock of 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's reward entitlement is revoked.
  • Player detail gains account.title, stats, awards (50 newest, with grantedBy). Players page: Stats and awards tab (per-tier table, set total, grant, revoke) and a name/title form.
  • Every write audits on channel player with before and after. Admin port only.
  • grantUnlock now takes an award, 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 passes node --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

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 an `admin` award of the difference (negative lowers it); `*` follows; same value grants nothing. - `POST /api/players/{account}/awards` `{kind, game, key, amount}`: `stat`, `win`, or `unlock` of 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's `reward` entitlement is revoked. - Player detail gains `account.title`, `stats`, `awards` (50 newest, with `grantedBy`). Players page: Stats and awards tab (per-tier table, set total, grant, revoke) and a name/title form. - Every write audits on channel `player` with before and after. Admin port only. - `grantUnlock` now takes an `award`, 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 passes `node --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
kblack0610 deleted branch feat/registry-admin-awards 2026-11-04 21:47:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kblack0610/bnb-game-servers!22
No description provided.