feat(inventory): scaffold InventoryService namespace types

Empty interfaces + records for IInventoryService, IInventoryTransaction,
InventoryCommitResult, InventoryLoadConfig, InventoryCatalogException.
Implementation lands in subsequent commits.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-31 15:38:51 -04:00
parent fc504af496
commit 220e5699cd
5 changed files with 119 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using SVSim.Database.Models;
namespace SVSim.Database.Services.Inventory;
/// <summary>
/// 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>).
/// </summary>
public sealed class InventoryLoadConfig
{
internal List<Func<IQueryable<Viewer>, IQueryable<Viewer>>> Includes { get; } = new();
public InventoryLoadConfig WithInclude<TProperty>(
Expression<Func<Viewer, TProperty>> path)
{
Includes.Add(q => q.Include(path));
return this;
}
public InventoryLoadConfig WithInclude<TProperty, TThen>(
Expression<Func<Viewer, IEnumerable<TProperty>>> collectionPath,
Expression<Func<TProperty, TThen>> thenPath)
{
Includes.Add(q => q.Include(collectionPath).ThenInclude(thenPath));
return this;
}
}