From 683d61e35da85c32ac5e5f0a84704734074685b0 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 28 Mar 2026 10:29:51 -0400 Subject: [PATCH] Gate prebuilt deck purchases on IsAvailableInShop flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add IsAvailableInShop to the buy query so decks not marked for sale cannot be purchased directly by ID (store listing already filtered this, but the buy endpoint did not) - Remove the unconditional starter-deck block; IsAvailableInShop is now the single gate — if an admin explicitly marks a starter deck as available in shop it can be purchased like any other deck Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../SOR.Bazaar/Handlers/BazaarBuyPrebuiltDeckHandler.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Server/src/SOR.Bazaar/Handlers/BazaarBuyPrebuiltDeckHandler.cs b/Server/src/SOR.Bazaar/Handlers/BazaarBuyPrebuiltDeckHandler.cs index 6106180..03210a1 100644 --- a/Server/src/SOR.Bazaar/Handlers/BazaarBuyPrebuiltDeckHandler.cs +++ b/Server/src/SOR.Bazaar/Handlers/BazaarBuyPrebuiltDeckHandler.cs @@ -41,7 +41,7 @@ internal sealed class BazaarBuyPrebuiltDeckHandler : BazaarHandlerBase, IMessage var deck = await _bazaarDb.PrebuiltDecks .Include(d => d.Cards) - .FirstOrDefaultAsync(d => d.Id == req.DeckId && d.IsActive + .FirstOrDefaultAsync(d => d.Id == req.DeckId && d.IsActive && d.IsAvailableInShop && (d.AvailableFrom == null || d.AvailableFrom <= now) && (d.AvailableUntil == null || d.AvailableUntil >= now), ct); @@ -49,11 +49,6 @@ internal sealed class BazaarBuyPrebuiltDeckHandler : BazaarHandlerBase, IMessage return ServerMessage.Error(message.Seq, "DECK_NOT_FOUND", "Prebuilt deck not found or not currently available."); - // Starter decks are handled by collection.select_starter_deck; not purchasable here. - if (deck.IsStarterDeck) - return ServerMessage.Error(message.Seq, "STARTER_DECK", - "Starter decks must be selected during onboarding, not purchased."); - // ── Debit ───────────────────────────────────────────────────────────── var debited = await TryDebitOriginPointsAsync(_identityDb, accountId, deck.OriginPointPrice, ct); if (!debited)