using System.Text.Json.Serialization;

namespace HoneyBox.Model.Models.Invitation;

/// <summary>
/// 推荐信息请求
/// </summary>
public class InvitationInfoRequest
{
    /// <summary>
    /// 页码
    /// </summary>
    public int Page { get; set; } = 1;
}

/// <summary>
/// 推荐信息响应 - 匹配PHP接口返回格式
/// </summary>
public class InvitationInfoResponse
{
    /// <summary>
    /// 分享标题
    /// </summary>
    [JsonPropertyName("share_title")]
    public string ShareTitle { get; set; } = string.Empty;

    /// <summary>
    /// 分享图片URL
    /// </summary>
    [JsonPropertyName("share_image")]
    public string ShareImage { get; set; } = string.Empty;

    /// <summary>
    /// 总邀请人数
    /// </summary>
    [JsonPropertyName("count")]
    public int Count { get; set; }

    /// <summary>
    /// 总奖励金额
    /// </summary>
    [JsonPropertyName("money")]
    public decimal Money { get; set; }

    /// <summary>
    /// 邀请记录列表
    /// </summary>
    [JsonPropertyName("data")]
    public List<InvitationRecordDto> Data { get; set; } = new();

    /// <summary>
    /// 最后一页页码
    /// </summary>
    [JsonPropertyName("last_page")]
    public int LastPage { get; set; }
}

/// <summary>
/// 邀请记录DTO - 匹配PHP接口返回格式
/// </summary>
public class InvitationRecordDto
{
    /// <summary>
    /// 被邀请用户ID
    /// </summary>
    [JsonPropertyName("id")]
    public int Id { get; set; }

    /// <summary>
    /// 昵称
    /// </summary>
    [JsonPropertyName("nickname")]
    public string Nickname { get; set; } = string.Empty;

    /// <summary>
    /// 头像
    /// </summary>
    [JsonPropertyName("headimg")]
    public string Headimg { get; set; } = string.Empty;

    /// <summary>
    /// 推荐人ID
    /// </summary>
    [JsonPropertyName("pid")]
    public int Pid { get; set; }

    /// <summary>
    /// 注册时间
    /// </summary>
    [JsonPropertyName("addtime")]
    public string Addtime { get; set; } = string.Empty;

    /// <summary>
    /// 奖励金额（佣金）
    /// </summary>
    [JsonPropertyName("commission_money")]
    public decimal CommissionMoney { get; set; }
}

/// <summary>
/// 绑定邀请码请求
/// </summary>
public class BindInviteCodeRequest
{
    /// <summary>
    /// 邀请码
    /// </summary>
    [JsonPropertyName("invite_code")]
    public string InviteCode { get; set; } = string.Empty;
}

/// <summary>
/// 绑定邀请码响应
/// </summary>
public class BindInviteCodeResponse
{
    /// <summary>
    /// 是否成功
    /// </summary>
    public bool Success { get; set; }

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