From 53342637933bc6aa38b1cf3c18e3138a60fec770 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Tue, 9 Jun 2026 15:09:43 -0400 Subject: [PATCH] feat(inventory): tag remaining BeginAsync call sites for acquire history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add GrantSource.CardCraft (16) for card crafting via red ether, and tag CardInventoryRepository.Create accordingly. LoadController backfill and ArenaTwoPickService.Entry are debit/infrastructure-only — left as Unknown. Co-Authored-By: Claude Sonnet 4.6 --- SVSim.Database/Repositories/Card/CardInventoryRepository.cs | 2 +- SVSim.Database/Services/Inventory/GrantSource.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SVSim.Database/Repositories/Card/CardInventoryRepository.cs b/SVSim.Database/Repositories/Card/CardInventoryRepository.cs index 6c1cc53..da4ff41 100644 --- a/SVSim.Database/Repositories/Card/CardInventoryRepository.cs +++ b/SVSim.Database/Repositories/Card/CardInventoryRepository.cs @@ -136,7 +136,7 @@ public class CardInventoryRepository : ICardInventoryRepository // Mutation phase via InventoryService transaction — freeplay-aware RedEther debit, // card grants with cosmetic cascade. - await using var tx = await _inv.BeginAsync(viewerId); + await using var tx = await _inv.BeginAsync(viewerId, configure: cfg => cfg.Source = GrantSource.CardCraft); var spendResult = await tx.TrySpendAsync(SpendCurrency.RedEther, (long)totalCost); if (!spendResult.Success) diff --git a/SVSim.Database/Services/Inventory/GrantSource.cs b/SVSim.Database/Services/Inventory/GrantSource.cs index d721ef2..abb0c6a 100644 --- a/SVSim.Database/Services/Inventory/GrantSource.cs +++ b/SVSim.Database/Services/Inventory/GrantSource.cs @@ -28,7 +28,8 @@ public enum GrantSource AchievementReward = 13, SerialCodeRedeem = 14, CardCosmeticCascade = 15, - // Reserved high to stay visually distinct from gameplay sources; 16–98 are intentionally unused. + CardCraft = 16, + // Reserved high to stay visually distinct from gameplay sources; 17–98 are intentionally unused. AdminGrant = 99, } @@ -57,6 +58,7 @@ public static class GrantSourceMessages GrantSource.AchievementReward => "From achievement reward", GrantSource.SerialCodeRedeem => "From serial code", GrantSource.CardCosmeticCascade => "Card cosmetic", + GrantSource.CardCraft => "From card crafting", GrantSource.AdminGrant => "From admin grant", _ => throw new ArgumentOutOfRangeException(nameof(source), source, "Unhandled GrantSource"), };