namespace HoneyBox.Admin.Business.Models.Goods;

#region Request Models

/// <summary>
/// 创建奖品请求
/// </summary>
public class PrizeCreateRequest
{
    /// <summary>
    /// 奖品标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 奖品图片URL
    /// </summary>
    public string ImgUrl { get; set; } = string.Empty;

    /// <summary>
    /// 奖品详情图片URL
    /// </summary>
    public string? ImgUrlDetail { get; set; }

    /// <summary>
    /// 库存数量
    /// </summary>
    public int Stock { get; set; }

    /// <summary>
    /// 奖品价格
    /// </summary>
    public decimal Price { get; set; }

    /// <summary>
    /// 回收金额
    /// </summary>
    public decimal Money { get; set; }

    /// <summary>
    /// 市场回收金额
    /// </summary>
    public decimal ScMoney { get; set; }

    /// <summary>
    /// 真实概率
    /// </summary>
    public decimal RealPro { get; set; }

    /// <summary>
    /// 商品类型 1-实物 2-虚拟
    /// </summary>
    public int GoodsType { get; set; } = 1;

    /// <summary>
    /// 排序值
    /// </summary>
    public int Sort { get; set; }

    /// <summary>
    /// 奖品等级ID
    /// </summary>
    public int? ShangId { get; set; }

    /// <summary>
    /// 奖励数量
    /// </summary>
    public int RewardNum { get; set; }

    /// <summary>
    /// 排名
    /// </summary>
    public int Rank { get; set; }

    /// <summary>
    /// 赠送金额
    /// </summary>
    public int GiveMoney { get; set; }

    /// <summary>
    /// 卡片编号
    /// </summary>
    public string? CardNo { get; set; }

    /// <summary>
    /// 类型
    /// </summary>
    public int Type { get; set; }

    /// <summary>
    /// 连击类型
    /// </summary>
    public int LianJiType { get; set; }

    /// <summary>
    /// 奖励ID
    /// </summary>
    public string? RewardId { get; set; }

    /// <summary>
    /// 翻倍倍数
    /// </summary>
    public int Doubling { get; set; } = 1;

    /// <summary>
    /// 是否灵珠奖品 0-否 1-是
    /// </summary>
    public int IsLingzhu { get; set; }

    /// <summary>
    /// 父奖品ID（宝箱子奖品时使用）
    /// 当添加宝箱的子奖品时，需要传入父奖品ID
    /// 系统会自动为所有箱号中的同一父奖品创建对应的子奖品
    /// </summary>
    public int GoodsListId { get; set; }

    /// <summary>
    /// 奖励配置列表
    /// 用于配置抽中该奖品时发放的货币奖励
    /// </summary>
    public List<PrizeRewardItem>? Rewards { get; set; }
}

/// <summary>
/// 奖品奖励配置项
/// </summary>
public class PrizeRewardItem
{
    /// <summary>
    /// 奖励类型：1=钻石(HH币) 2=UU币(积分) 3=哈尼券
    /// </summary>
    public int Type { get; set; }

    /// <summary>
    /// 奖励数量
    /// </summary>
    public int Amount { get; set; }
}

/// <summary>
/// 更新奖品请求
/// </summary>
public class PrizeUpdateRequest : PrizeCreateRequest
{
}

#endregion

#region Response Models

/// <summary>
/// 奖品响应
/// </summary>
public class PrizeDto
{
    /// <summary>
    /// 奖品ID
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 商品ID
    /// </summary>
    public int GoodsId { get; set; }

    /// <summary>
    /// 奖品编号
    /// </summary>
    public int Num { get; set; }

    /// <summary>
    /// 奖品标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 奖品图片URL
    /// </summary>
    public string ImgUrl { get; set; } = string.Empty;

    /// <summary>
    /// 奖品详情图片URL
    /// </summary>
    public string? ImgUrlDetail { get; set; }

    /// <summary>
    /// 总库存
    /// </summary>
    public int Stock { get; set; }

    /// <summary>
    /// 剩余库存
    /// </summary>
    public int SurplusStock { get; set; }

    /// <summary>
    /// 奖品价格
    /// </summary>
    public decimal Price { get; set; }

    /// <summary>
    /// 回收金额
    /// </summary>
    public decimal Money { get; set; }

    /// <summary>
    /// 市场回收金额
    /// </summary>
    public decimal ScMoney { get; set; }

    /// <summary>
    /// 真实概率
    /// </summary>
    public decimal RealPro { get; set; }

    /// <summary>
    /// 商品类型 1-实物 2-虚拟
    /// </summary>
    public int GoodsType { get; set; }

    /// <summary>
    /// 排序值
    /// </summary>
    public int Sort { get; set; }

    /// <summary>
    /// 奖品等级ID
    /// </summary>
    public int? ShangId { get; set; }

    /// <summary>
    /// 奖品等级名称
    /// </summary>
    public string? ShangTitle { get; set; }

    /// <summary>
    /// 奖品等级颜色
    /// </summary>
    public string? ShangColor { get; set; }

    /// <summary>
    /// 奖励数量
    /// </summary>
    public int RewardNum { get; set; }

    /// <summary>
    /// 排名
    /// </summary>
    public int Rank { get; set; }

    /// <summary>
    /// 赠送金额
    /// </summary>
    public int GiveMoney { get; set; }

    /// <summary>
    /// 卡片编号
    /// </summary>
    public string? CardNo { get; set; }

    /// <summary>
    /// 奖品编码
    /// </summary>
    public string? PrizeCode { get; set; }

    /// <summary>
    /// 类型
    /// </summary>
    public int Type { get; set; }

    /// <summary>
    /// 连击类型
    /// </summary>
    public int LianJiType { get; set; }

    /// <summary>
    /// 奖励ID
    /// </summary>
    public string? RewardId { get; set; }

    /// <summary>
    /// 翻倍倍数
    /// </summary>
    public int Doubling { get; set; }

    /// <summary>
    /// 是否灵珠奖品 0-否 1-是
    /// </summary>
    public int IsLingzhu { get; set; }

    /// <summary>
    /// 父奖品ID（宝箱子奖品时使用）
    /// 0 表示是父奖品或普通奖品，大于0表示是子奖品
    /// </summary>
    public int GoodsListId { get; set; }

    /// <summary>
    /// 奖励配置列表
    /// </summary>
    public List<PrizeRewardItem>? Rewards { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime? CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime UpdatedAt { get; set; }
}

#endregion
