namespace HoneyBox.Model.Models.UserCoupon;

/// <summary>
/// 用户优惠券列表请求
/// </summary>
public class UserCouponListRequest
{
    /// <summary>
    /// 状态: 1=未使用, 2=已分享
    /// </summary>
    public int Status { get; set; } = 1;

    /// <summary>
    /// 页码
    /// </summary>
    public int Page { get; set; } = 1;

    /// <summary>
    /// 每页数量
    /// </summary>
    public int Limit { get; set; } = 15;
}

/// <summary>
/// 用户优惠券列表响应
/// </summary>
public class UserCouponListResponse
{
    /// <summary>
    /// 优惠券列表
    /// </summary>
    public List<UserCouponDto> List { get; set; } = new();

    /// <summary>
    /// 最后一页页码
    /// </summary>
    public int LastPage { get; set; }

    /// <summary>
    /// 今日已领取数量
    /// </summary>
    public int YCount { get; set; }

    /// <summary>
    /// 每日领取上限
    /// </summary>
    public int ZCount { get; set; } = 50;

    /// <summary>
    /// 用户吧唧币余额
    /// </summary>
    public decimal UserIntegral { get; set; }

    /// <summary>
    /// 最大合成数量
    /// </summary>
    public int KeHcCount { get; set; } = 20;

    /// <summary>
    /// 合成损耗率
    /// </summary>
    public string SunHao { get; set; } = "10%";
}

/// <summary>
/// 用户优惠券DTO
/// </summary>
public class UserCouponDto
{
    /// <summary>
    /// 优惠券ID
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 状态: 1=未使用, 2=已分享
    /// </summary>
    public int Status { get; set; }

    /// <summary>
    /// 等级: 1=特级, 2=终极, 3=高级, 4=普通
    /// </summary>
    public int Level { get; set; }

    /// <summary>
    /// 等级文本
    /// </summary>
    public string LevelText { get; set; } = string.Empty;

    /// <summary>
    /// 等级图片
    /// </summary>
    public string LevelImg { get; set; } = string.Empty;

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

    /// <summary>
    /// 面值
    /// </summary>
    public string Num { get; set; } = string.Empty;

    /// <summary>
    /// 可领取次数
    /// </summary>
    public int KlNum { get; set; }

    /// <summary>
    /// 可领取次数2
    /// </summary>
    public int KlNum2 { get; set; }

    /// <summary>
    /// 已领取数量
    /// </summary>
    public int YiLing { get; set; }
}

/// <summary>
/// 优惠券详情请求
/// </summary>
public class CouponDetailRequest
{
    /// <summary>
    /// 优惠券ID
    /// </summary>
    public int Id { get; set; }
}

/// <summary>
/// 优惠券详情响应
/// </summary>
public class CouponDetailResponse
{
    /// <summary>
    /// 优惠券ID
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 等级
    /// </summary>
    public int Level { get; set; }

    /// <summary>
    /// 等级文本
    /// </summary>
    public string LevelText { get; set; } = string.Empty;

    /// <summary>
    /// 等级图片
    /// </summary>
    public string LevelImg { get; set; } = string.Empty;

    /// <summary>
    /// 分享时间
    /// </summary>
    public string ShareTime { get; set; } = string.Empty;

    /// <summary>
    /// 用户ID
    /// </summary>
    public int UserId { get; set; }

    /// <summary>
    /// 面值
    /// </summary>
    public string Num { get; set; } = string.Empty;

    /// <summary>
    /// 可领取次数2
    /// </summary>
    public int KlNum2 { get; set; }

    /// <summary>
    /// 剩余可领取金额 (own2 - own)
    /// </summary>
    public decimal Own2 { get; set; }

    /// <summary>
    /// 已领取数量
    /// </summary>
    public int YlCount { get; set; }

    /// <summary>
    /// 已领取总金额
    /// </summary>
    public decimal YlIntegralCount { get; set; }

    /// <summary>
    /// 分享者昵称
    /// </summary>
    public string ShareUserNickname { get; set; } = string.Empty;

    /// <summary>
    /// 分享者头像
    /// </summary>
    public string ShareUserHeadimg { get; set; } = string.Empty;

    /// <summary>
    /// 领取记录列表
    /// </summary>
    public List<CouponClaimRecordDto> YlList { get; set; } = new();
}

/// <summary>
/// 分享者信息DTO
/// </summary>
public class ShareUserDto
{
    /// <summary>
    /// 昵称
    /// </summary>
    public string Nickname { get; set; } = string.Empty;

    /// <summary>
    /// 头像
    /// </summary>
    public string Headimg { get; set; } = string.Empty;
}

/// <summary>
/// 优惠券领取记录DTO
/// </summary>
public class CouponClaimRecordDto
{
    /// <summary>
    /// 用户ID
    /// </summary>
    public int UserId { get; set; }

    /// <summary>
    /// 昵称
    /// </summary>
    public string Nickname { get; set; } = string.Empty;

    /// <summary>
    /// 头像
    /// </summary>
    public string Headimg { get; set; } = string.Empty;

    /// <summary>
    /// 领取金额
    /// </summary>
    public decimal LNum { get; set; }

    /// <summary>
    /// 领取时间
    /// </summary>
    public string AddTime { get; set; } = string.Empty;

    /// <summary>
    /// 是否手气最佳
    /// </summary>
    public int LuckyKing { get; set; }
}

/// <summary>
/// 分享优惠券请求
/// </summary>
public class ShareCouponRequest
{
    /// <summary>
    /// 优惠券ID
    /// </summary>
    public int Id { get; set; }
}

/// <summary>
/// 领取优惠券请求
/// </summary>
public class ClaimCouponRequest
{
    /// <summary>
    /// 优惠券ID
    /// </summary>
    public int Id { get; set; }
}

/// <summary>
/// 领取优惠券响应
/// </summary>
public class ClaimCouponResponse
{
    /// <summary>
    /// 领取金额
    /// </summary>
    public decimal Amount { get; set; }

    /// <summary>
    /// 是否手气最佳
    /// </summary>
    public bool LuckyKing { get; set; }
}

/// <summary>
/// 合成计算请求
/// </summary>
public class SynthesisCalculateRequest
{
    /// <summary>
    /// 优惠券ID列表 (逗号分隔)
    /// </summary>
    public string CouponIds { get; set; } = string.Empty;
}

/// <summary>
/// 合成计算响应
/// </summary>
public class SynthesisCalculateResponse
{
    /// <summary>
    /// 新优惠券信息
    /// </summary>
    public SynthesisCouponDto Coupon { get; set; } = new();

    /// <summary>
    /// 原始总价值
    /// </summary>
    public decimal SumNum { get; set; }

    /// <summary>
    /// 合成后价值 (扣除10%损耗)
    /// </summary>
    public decimal ShNum { get; set; }
}

/// <summary>
/// 合成优惠券DTO
/// </summary>
public class SynthesisCouponDto
{
    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 等级
    /// </summary>
    public int Level { get; set; }
}

/// <summary>
/// 合成优惠券请求
/// </summary>
public class SynthesisCouponsRequest
{
    /// <summary>
    /// 优惠券ID列表 (逗号分隔)
    /// </summary>
    public string CouponIds { get; set; } = string.Empty;
}
