Skip to content

Shop & economy

/admin/shop is the operator surface for the Splintertoken storefront, the gametime subscription system, and the keycode redemption pipeline.

Categories

  • shop.categories rows: key, default English label, per-locale label_i18n JSONB, sort order.
  • Inline edit table at /admin/shop — POST creates, PUT (per category key) updates, DELETE removes (items keep the orphaned category string).
  • The launcher / web shop renders the matching label_i18n[locale] with English fallback.

Items

  • shop.items: id, name, category, price (in Splintertokens), payload JSONB, applies_to_game_ids array, enabled / hidden flags, featured flag, time-window availability.
  • "Featured" promotes an item into the shop hero strip.
  • Hidden items stay queryable by ID (for promo links) but don't appear in the catalogue list.
  • applies_to_game_ids[] empty = all games; populated = scoped.

Splintertoken balance

  • shop.balance per account (read by GET /api/v1/shop/balance).
  • Manual credit / debit form with audit reason; goes through auth.account_activity for traceability.

Gametime keycodes

  • shop.keycodes row per code, format XXXX-XXXX-XXXX-XXXX. Each carries kind (gametime / tokens / shop_item) plus payload (days, token_amount, item_id).
  • Bulk generator: pick kind + count + expiry → CSV export of new codes with redemption URL pre-baked.
  • Audit page: every redemption with redeemer account, IP, time.

Subscription

  • auth.account.subscription_expires_at is the unix epoch the sub expires on; unlimited = TRUE means GM-grant eternal access.
  • Admin can extend a sub by N days, or set unlimited.
  • The launcher's <7 days warning chip reads GET /api/v1/me/subscription against the same data.

Forum / shop / tokens / gametime flags

Independent on/off knobs in auth.app_setting:

  • tokens_enabled, gametime_enabled, shop_enabled, shop_open, forum_enabled, forum_open.

The launcher hides the Shop tab and gametime warning entirely when the relevant flag is off; the redeem dialog still surfaces if any of the three credit-able features is on.