From 349d7f32cdd3188abfdaeba9995b7a5c23efadcc Mon Sep 17 00:00:00 2001 From: gamer147 Date: Tue, 9 Jun 2026 15:07:19 -0400 Subject: [PATCH] feat(leader-skin): tag buy tx as LeaderSkinBuy for acquire history Co-Authored-By: Claude Sonnet 4.6 --- .../Controllers/LeaderSkinController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs b/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs index 7446fc2..d93f4f8 100644 --- a/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs +++ b/SVSim.EmulatedEntrypoint/Controllers/LeaderSkinController.cs @@ -177,7 +177,7 @@ public class LeaderSkinController : SVSimController if (!product.IsEnabled || product.Series is not { IsEnabled: true }) return BadRequest(new { error = "product_not_available" }); - await using var tx = await _inv.BeginAsync(viewerId, HttpContext.RequestAborted); + await using var tx = await _inv.BeginAsync(viewerId, HttpContext.RequestAborted, cfg => cfg.Source = GrantSource.LeaderSkinBuy); // Already-purchased = viewer owns the leader_skin this product grants. if (tx.OwnsCosmetic(CosmeticType.Skin, product.LeaderSkinId)) @@ -230,7 +230,7 @@ public class LeaderSkinController : SVSimController if (!series.IsEnabled || series.SetSalesStatus == 0) return BadRequest(new { error = "set_sale_not_active" }); - await using var tx = await _inv.BeginAsync(viewerId, HttpContext.RequestAborted); + await using var tx = await _inv.BeginAsync(viewerId, HttpContext.RequestAborted, cfg => cfg.Source = GrantSource.LeaderSkinBuy); if (tx.IsFreeplay) return BadRequest(new { error = "already_purchased" }); @@ -286,7 +286,7 @@ public class LeaderSkinController : SVSimController if (existingClaim is not null) return new LeaderSkinBuyResponse { RewardList = new() }; - await using var tx = await _inv.BeginAsync(viewerId, HttpContext.RequestAborted); + await using var tx = await _inv.BeginAsync(viewerId, HttpContext.RequestAborted, cfg => cfg.Source = GrantSource.LeaderSkinBuy); // Must own every skin in the series to claim the bonus. bool ownsAll = series.Products.Count > 0 && series.Products.All(p => tx.OwnsCosmetic(CosmeticType.Skin, p.LeaderSkinId));