feat(inventory): thread GrantSource into InventoryTransaction

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 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-09 14:28:05 -04:00
parent f394529c8c
commit 015c7ce259
2 changed files with 4 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ public sealed class InventoryService : IInventoryService
var freeplay = _config.Get<FreeplayConfig>();
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)

View File

@@ -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;
}