feat(bp): /battle_pass/buy — crystal-cost + retroactive premium grants

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-26 23:36:18 -04:00
parent 0ceab721e9
commit 2cb8c271a8
9 changed files with 422 additions and 1 deletions

View File

@@ -19,4 +19,12 @@ public interface IBattlePassService
/// array if the viewer already owns premium for the active season. Null when no active season.
/// </summary>
Task<BattlePassItemListResponse?> GetItemListAsync(long viewerId, CancellationToken ct);
/// <summary>
/// Purchase premium for the active season. Validates season_id matches active season,
/// product id derives from season, viewer has crystals, viewer isn't already premium.
/// On success: deducts crystals, flips IsPremium, retroactively grants premium rewards for
/// every level &lt;= current_level not yet claimed. All-or-nothing transaction.
/// </summary>
Task<BattlePassBuyOutcome> BuyPremiumAsync(long viewerId, int seasonId, int productId, CancellationToken ct);
}