15 lines
634 B
C#
15 lines
634 B
C#
using SVSim.Database.Models;
|
|
|
|
namespace SVSim.Database.Services;
|
|
|
|
/// <summary>
|
|
/// Centralized debit primitive — the symmetric twin of <c>RewardGrantService.ApplyAsync</c>.
|
|
/// Encapsulates the affordability-check + deduction + post-state-total pattern that was inlined
|
|
/// across the shop/pack controllers. Does NOT call <c>SaveChangesAsync</c>; the caller saves.
|
|
/// Freeplay (for Crystal/Rupee/RedEther) makes spends always succeed without deducting.
|
|
/// </summary>
|
|
public interface ICurrencySpendService
|
|
{
|
|
Task<SpendResult> TrySpendAsync(Viewer viewer, SpendCurrency currency, long cost, CancellationToken ct = default);
|
|
}
|