using SVSim.Database.Models;
using SVSim.Database.Services;
namespace SVSim.Database.Services.Inventory;
public interface IInventoryService
{
///
/// Loads the viewer with the canonical inventory graph (Cards.Card, Sleeves, Emblems,
/// LeaderSkins, Degrees, MyPageBackgrounds, Items.Item under AsSplitQuery), opens a DB
/// transaction, and returns a builder for queueing operations. Throws
/// if the viewer does not exist.
///
Task BeginAsync(
long viewerId,
CancellationToken ct = default,
Action? configure = null);
Task> EffectiveOwnedCardsAsync(Viewer viewer, CancellationToken ct = default);
Task EffectiveCosmeticsAsync(Viewer viewer, CancellationToken ct = default);
long EffectiveBalance(Viewer viewer, SpendCurrency currency);
}
public sealed class InventoryViewerNotFoundException : Exception
{
public InventoryViewerNotFoundException(long viewerId)
: base($"Viewer {viewerId} not found") { }
}