24 lines
758 B
C#
24 lines
758 B
C#
using Store.Users.Entities;
|
|
using YourNamespace;
|
|
|
|
namespace Store.Users.Behaviors;
|
|
|
|
/// <summary>需要账户积分消费检查的请求。</summary>
|
|
public interface IAccountConsumptionRequest
|
|
{
|
|
string? UserName { get; }
|
|
AccountConsumptionContext? ConsumptionContext { get; set; }
|
|
ConsumptionQuote CalculateConsumption(UserEntity user);
|
|
}
|
|
|
|
/// <summary>需要检查商铺归属的请求,与是否消费无关。</summary>
|
|
public interface IShopOwnershipRequest
|
|
{
|
|
string UserName { get; }
|
|
string ShopId { get; }
|
|
ShopEntity? OwnedShop { get; set; }
|
|
}
|
|
|
|
public sealed record ConsumptionQuote(decimal Amount, decimal UnitPrice);
|
|
public sealed record AccountConsumptionContext(UserEntity User, UserEntity Actor, ConsumptionQuote Quote);
|