38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Fengling.RiskControl.Domain.Aggregates.LotteryActivities;
|
|
|
|
namespace Fengling.RiskControl.Application.Services;
|
|
|
|
public record LotteryParticipationRequest
|
|
{
|
|
public long MemberId { get; init; }
|
|
public string ActivityType { get; init; } = string.Empty;
|
|
public int StakePoints { get; init; }
|
|
public string? IpAddress { get; init; }
|
|
public string? DeviceId { get; init; }
|
|
}
|
|
|
|
public record LotteryParticipationResult
|
|
{
|
|
public long ActivityId { get; init; }
|
|
public LotteryParticipationStatus Status { get; init; }
|
|
public int? WinAmount { get; init; }
|
|
public string Message { get; init; } = string.Empty;
|
|
public RiskEvaluationResult? RiskResult { get; init; }
|
|
}
|
|
|
|
public enum LotteryParticipationStatus
|
|
{
|
|
Allowed = 0,
|
|
Blocked = 1,
|
|
PendingVerification = 2,
|
|
InsufficientPoints = 3,
|
|
Failed = 4
|
|
}
|
|
|
|
public interface ILotteryService
|
|
{
|
|
Task<LotteryParticipationResult> ParticipateAsync(LotteryParticipationRequest request);
|
|
Task<LotteryActivity?> GetActivityAsync(long activityId);
|
|
Task<IEnumerable<LotteryActivity>> GetMemberActivitiesAsync(long memberId);
|
|
}
|