Pass tiers: Explorer ($20/30 days) and Champion ($40/30 days) beside the weekly Game Pass, behind sovTiers (default off, admin-only preview)

Islands and looks in Shards of Valor, never power and never more POL: every tier gets exactly the weekly pass caps and polgrant
still answers pass: true. Per-tier expiry side by side (record.tiers, legacy until mirrors weekly, lazy migration); flag() adds
tier (highest active) and tiers; hand-off token gamePass { active, until, tier }; /api/partner/player pass { active, until, tier,
tiers }. Buy { tier } with purchased credits or a waiting order per tier that a big-enough package fulfils (highest price first,
each tx once). No auto-renew, no proration. Admin: per-tier stats (Central week/month), comp per tier, end-a-tier (refund).
Tournament pool keeps weekly sales only unless passTournamentTierSales. Member card shows three tiers; /my#passes opens it.
Tests: qa/sov-passes-store.cjs, qa/sov-passes-local.mjs (bash qa/run.sh sov-passes). Cache tags my.js/admin.js 20261018tiers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-18 14:46:51 -05:00
parent 5e8f2c0b6b
commit 0688bdeb72
11 changed files with 590 additions and 59 deletions
+8 -4
View File
@@ -520,10 +520,14 @@
</div>
</div>
<div class="card">
<div class="card-head"><h3>Comp a pass</h3><span class="sub">support: one pass week, recorded as no sale</span></div>
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0"><input id="gpCompEmail" placeholder="member email" style="max-width:260px"><input id="gpCompWhy" placeholder="why" style="max-width:220px"><button class="btn small" id="gpComp" type="button">Give one pass week</button></p>
<div class="card-head"><h3>By pass tier</h3><span class="sub" id="gpTiersSub"></span></div>
<div id="gpTiers" class="small">…</div>
</div>
<p class="small muted">Settings live in Settings &rsaquo; Site settings: gamePassEnabled (1/0), gamePassPriceCredits, gamePassDays, capFreeDaily, capFreeTotal, capPassDaily, capPassTotal, capsStartDate (Central YYYY-MM-DD; empty = caps recorded, not enforced), passTournamentPct, telegramGamesTopicId. Prize POL is paid by the games from their faucets (GET /api/partner/tournament/pending), not from here.</p>
<div class="card">
<div class="card-head"><h3>Comp a pass</h3><span class="sub">support: one pass period, recorded as no sale</span></div>
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0"><input id="gpCompEmail" placeholder="member email" style="max-width:260px"><select id="gpCompTier"><option value="weekly">Game Pass (weekly)</option><option value="explorer">Explorer (monthly)</option><option value="champion">Champion (monthly)</option></select><input id="gpCompWhy" placeholder="why" style="max-width:220px"><button class="btn small" id="gpComp" type="button">Give one pass period</button><button class="btn small sec" id="gpRevoke" type="button">End this tier now (refund)</button></p>
</div>
<p class="small muted">Settings live in Settings &rsaquo; Site settings: gamePassEnabled (1/0), gamePassPriceCredits, gamePassDays, capFreeDaily, capFreeTotal, capPassDaily, capPassTotal, capsStartDate (Central YYYY-MM-DD; empty = caps recorded, not enforced), passTournamentPct, telegramGamesTopicId. Monthly tiers: sovTiers (1/0, the Explorer + Champion sale switch; off = only the admin account sees them), gamePassExplorerEnabled / gamePassChampionEnabled (0 stops one tier), gamePassExplorerPriceCredits (2000), gamePassChampionPriceCredits (4000), gamePassExplorerDays / gamePassChampionDays (30), passTournamentTierSales (1 = their sales feed the tournament pool; default 0). Prize POL is paid by the games from their faucets (GET /api/partner/tournament/pending), not from here.</p>
</div>
<div class="pane" id="pane-settings" hidden>
@@ -568,6 +572,6 @@
</div>
<script src="/assets/common.js?v=20261016n"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/admin.js?v=20261018gp"></script>
<script src="/assets/admin.js?v=20261018tiers"></script>
</body>
</html>