From 015c7ce259448f621c0b3c0770428b7a74314a64 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Tue, 9 Jun 2026 14:28:05 -0400 Subject: [PATCH] feat(inventory): thread GrantSource into InventoryTransaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add _source field + ctor parameter (between freeplay and log) to InventoryTransaction; pass loadCfg.Source from InventoryService.BeginAsync. Field is captured but not yet consumed — Task 6 wires it into history rows. Co-Authored-By: Claude Sonnet 4.6 --- SVSim.Database/Services/Inventory/InventoryService.cs | 2 +- SVSim.Database/Services/Inventory/InventoryTransaction.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SVSim.Database/Services/Inventory/InventoryService.cs b/SVSim.Database/Services/Inventory/InventoryService.cs index cc5ea67..ad33bf2 100644 --- a/SVSim.Database/Services/Inventory/InventoryService.cs +++ b/SVSim.Database/Services/Inventory/InventoryService.cs @@ -57,7 +57,7 @@ public sealed class InventoryService : IInventoryService var freeplay = _config.Get(); var dbTx = await _db.Database.BeginTransactionAsync(ct); - return new InventoryTransaction(_db, dbTx, viewer, freeplay, _log); + return new InventoryTransaction(_db, dbTx, viewer, freeplay, loadCfg.Source, _log); } public long EffectiveBalance(Viewer viewer, SpendCurrency currency) diff --git a/SVSim.Database/Services/Inventory/InventoryTransaction.cs b/SVSim.Database/Services/Inventory/InventoryTransaction.cs index 9d0d273..53e5c3e 100644 --- a/SVSim.Database/Services/Inventory/InventoryTransaction.cs +++ b/SVSim.Database/Services/Inventory/InventoryTransaction.cs @@ -13,6 +13,7 @@ internal sealed class InventoryTransaction : IInventoryTransaction private readonly IDbContextTransaction _dbTx; private readonly ILogger _log; private readonly FreeplayConfig _freeplay; + private readonly GrantSource _source; private bool _committed; public Viewer Viewer { get; } @@ -29,12 +30,14 @@ internal sealed class InventoryTransaction : IInventoryTransaction IDbContextTransaction dbTx, Viewer viewer, FreeplayConfig freeplay, + GrantSource source, ILogger log) { _db = db; _dbTx = dbTx; Viewer = viewer; _freeplay = freeplay; + _source = source; _log = log; }