fix(shops): smoke-test fallout from today's shop-cluster ship

Two issues caught in a real-client smoke run against the freshly
bootstrapped DB:

1. NRE in ShadowverseTranslationMiddleware for parameterless actions.
   Five new actions (Sleeve.Info, LeaderSkin.{Ids,Products},
   ItemPurchase.Info, SpotCardExchange.Top) took no parameters, but
   the middleware does
   `endpointDescriptor.Parameters.FirstOrDefault().ParameterType`
   to discover the request DTO — `FirstOrDefault` returns null on a
   zero-param action and `.ParameterType` NREs. Tests didn't catch it
   because the test client POSTs plain JSON, bypassing this path.
   Fix: each action now takes `BaseRequest _` matching the codebase
   convention (PuzzleController.Info, BattlePassController.Info, etc.),
   plus the middleware throws an actionable
   InvalidOperationException pointing at the convention so the next
   contributor doesn't repeat the mistake.

2. Leader-skin set sale showed up as "FREE / Claim" with empty
   Includes panel after the viewer bought every skin in a series
   with no configured bonus items. Root cause: ComputeRewardStatus
   emitted status=1 (not_got) when set_sales_status != 0 regardless
   of whether rewards.items was empty, and SkinPurchaseInfoTask.
   CreateSetSaleInfo flags `is_free=true` on (is_completed &&
   not_got). Prod ships status=0 when items is empty even with
   set_sales_status==1 — we now mirror that.

504 tests still pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-27 23:57:12 -04:00
parent 7ef5f03eb3
commit 0f44a3482c
5 changed files with 34 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ using SVSim.Database.Enums;
using SVSim.Database.Models;
using SVSim.Database.Services;
using SVSim.EmulatedEntrypoint.Models.Dtos;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests.ItemPurchase;
using SVSim.EmulatedEntrypoint.Models.Dtos.Responses.ItemPurchase;
using SVSim.EmulatedEntrypoint.Services;
@@ -31,7 +32,7 @@ public class ItemPurchaseController : SVSimController
}
[HttpPost("info")]
public async Task<ActionResult<ItemPurchaseInfoResponse>> Info()
public async Task<ActionResult<ItemPurchaseInfoResponse>> Info(BaseRequest _)
{
if (!TryGetViewerId(out long viewerId)) return Unauthorized();