namespace HoneyBox.Admin.Business.Models.User;

/// <summary>
/// 用户列表请求
/// </summary>
public class UserListRequest : PagedRequest
{
    /// <summary>
    /// 关键字搜索（支持用户ID、手机号、昵称）
    /// </summary>
    public string? Keyword { get; set; }

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

    /// <summary>
    /// 手机号
    /// </summary>
    public string? Mobile { get; set; }

    /// <summary>
    /// 昵称
    /// </summary>
    public string? Nickname { get; set; }

    /// <summary>
    /// 最后登录IP
    /// </summary>
    public string? LastLoginIp { get; set; }

    /// <summary>
    /// 注册开始日期
    /// </summary>
    public DateTime? StartDate { get; set; }

    /// <summary>
    /// 注册结束日期
    /// </summary>
    public DateTime? EndDate { get; set; }

    /// <summary>
    /// 上级用户ID
    /// </summary>
    public int? ParentId { get; set; }
}

/// <summary>
/// 用户列表响应
/// </summary>
public class UserListResponse
{
    /// <summary>
    /// 用户ID
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 用户唯一标识
    /// </summary>
    public string? Uid { get; set; }

    /// <summary>
    /// 昵称
    /// </summary>
    public string? Nickname { get; set; }

    /// <summary>
    /// 头像
    /// </summary>
    public string? Avatar { get; set; }

    /// <summary>
    /// 手机号
    /// </summary>
    public string? Mobile { get; set; }

    /// <summary>
    /// 余额/钻石 (对应 balance_name)
    /// </summary>
    public decimal Balance { get; set; }

    /// <summary>
    /// 积分/HH币 (对应 currency1_name)
    /// </summary>
    public decimal Integral { get; set; }

    /// <summary>
    /// 哈尼券 (对应 currency2_name)
    /// </summary>
    public decimal Diamond { get; set; }

    /// <summary>
    /// 权益等级
    /// </summary>
    public int EquityLevel { get; set; }

    /// <summary>
    /// 注册时间
    /// </summary>
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 最后登录IP
    /// </summary>
    public string? LastLoginIp { get; set; }

    /// <summary>
    /// 状态：1正常 0禁用
    /// </summary>
    public int Status { get; set; }

    /// <summary>
    /// 是否测试账号
    /// </summary>
    public int IsTest { get; set; }

    /// <summary>
    /// 上级用户ID
    /// </summary>
    public int ParentId { get; set; }

    // 统计字段
    /// <summary>
    /// 总消费金额
    /// </summary>
    public decimal TotalConsumption { get; set; }

    /// <summary>
    /// 盒柜价值
    /// </summary>
    public decimal BoxValue { get; set; }

    /// <summary>
    /// 微信支付金额
    /// </summary>
    public decimal WeChatPayment { get; set; }

    /// <summary>
    /// 余额支付金额
    /// </summary>
    public decimal BalancePayment { get; set; }

    /// <summary>
    /// 积分支付金额
    /// </summary>
    public decimal IntegralPayment { get; set; }

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

    /// <summary>
    /// 发货价值
    /// </summary>
    public decimal ShippingValue { get; set; }
}

/// <summary>
/// 用户详情响应
/// </summary>
public class UserDetailResponse : UserListResponse
{
    /// <summary>
    /// 微信OpenId
    /// </summary>
    public string? OpenId { get; set; }

    /// <summary>
    /// 微信UnionId
    /// </summary>
    public string? UnionId { get; set; }

    /// <summary>
    /// 公众号OpenId
    /// </summary>
    public string? GzhOpenId { get; set; }

    /// <summary>
    /// 最后登录时间
    /// </summary>
    public DateTime? LastLoginTime { get; set; }

    /// <summary>
    /// 欧气值
    /// </summary>
    public int? OuQi { get; set; }

    /// <summary>
    /// 抽奖次数
    /// </summary>
    public int? DrawNum { get; set; }
}
