feat(inventory): add Source to InventoryLoadConfig
Adds a `GrantSource Source { get; set; }` property (defaults to
`GrantSource.Unknown`) to `InventoryLoadConfig`. Plumbing-only — no
behavior change; callers that don't set `Source` get Unknown rows,
greppable via `acquire_type=0` in dev.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,11 +9,23 @@ namespace SVSim.Database.Services.Inventory;
|
||||
/// Caller-supplied extra <c>.Include</c> chains on top of the canonical viewer-inventory query
|
||||
/// in <see cref="IInventoryService.BeginAsync"/>. Use to bring in extra collections needed by
|
||||
/// the calling controller (e.g. <c>MissionData</c>, <c>BuildDeckPurchases</c>).
|
||||
/// <para>
|
||||
/// Also carries the <see cref="Source"/> tag that <see cref="IInventoryTransaction.CommitAsync"/>
|
||||
/// stamps onto every <c>viewer_acquire_history</c> row written from this transaction. Callers
|
||||
/// that don't set <see cref="Source"/> end up with <see cref="GrantSource.Unknown"/> rows;
|
||||
/// grep for <c>acquire_type=0</c> in dev to find unmigrated sites.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public sealed class InventoryLoadConfig
|
||||
{
|
||||
internal List<Func<IQueryable<Viewer>, IQueryable<Viewer>>> Includes { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Logical source of every grant queued in this transaction. Defaults to
|
||||
/// <see cref="GrantSource.Unknown"/>.
|
||||
/// </summary>
|
||||
public GrantSource Source { get; set; } = GrantSource.Unknown;
|
||||
|
||||
public InventoryLoadConfig WithInclude<TProperty>(
|
||||
Expression<Func<Viewer, TProperty>> path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user