namespace HoneyBox.Core.Interfaces;

/// <summary>
/// 奖励发放服务接口
/// </summary>
public interface IRewardService
{
    /// <summary>
    /// 发放奖励
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="rewardId">奖励ID（业务标识）</param>
    /// <param name="source">奖励来源描述</param>
    /// <returns>发放结果</returns>
    Task<RewardSendResult> SendRewardAsync(int userId, string rewardId, string source = "系统奖励");

    /// <summary>
    /// 发放奖励（带倍数）
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="rewardId">奖励ID（业务标识）</param>
    /// <param name="multiple">倍数</param>
    /// <param name="source">奖励来源描述</param>
    /// <returns>发放结果</returns>
    Task<RewardSendResult> SendRewardMultipleAsync(int userId, string rewardId, int multiple, string source = "系统奖励");
}

/// <summary>
/// 奖励发放结果
/// </summary>
public class RewardSendResult
{
    /// <summary>
    /// 是否成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 消息
    /// </summary>
    public string Message { get; set; } = string.Empty;

    /// <summary>
    /// 发放详情列表
    /// </summary>
    public List<RewardSendDetail> Details { get; set; } = new();
}

/// <summary>
/// 单个奖励发放详情
/// </summary>
public class RewardSendDetail
{
    /// <summary>
    /// 奖励记录ID
    /// </summary>
    public int RewardId { get; set; }

    /// <summary>
    /// 奖励类型
    /// </summary>
    public int RewardType { get; set; }

    /// <summary>
    /// 是否成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 消息
    /// </summary>
    public string Message { get; set; } = string.Empty;
}
