using System.Text.Json.Serialization;

namespace HoneyBox.Model.Models.Sign;

/// <summary>
/// 签到信息响应
/// </summary>
public class SignInfoResponse
{
    /// <summary>
    /// 连续签到天数
    /// </summary>
    [JsonPropertyName("days")]
    public int Days { get; set; }

    /// <summary>
    /// 今日是否已签到：0-未签到 1-已签到
    /// </summary>
    [JsonPropertyName("is_sign")]
    public int IsSign { get; set; }

    /// <summary>
    /// 本月已签到天数
    /// </summary>
    [JsonPropertyName("sign_days")]
    public int SignDays { get; set; }

    /// <summary>
    /// 当月总天数
    /// </summary>
    [JsonPropertyName("total_days")]
    public int TotalDays { get; set; }

    /// <summary>
    /// 距离月底还有几天
    /// </summary>
    [JsonPropertyName("rest_days")]
    public int RestDays { get; set; }

    /// <summary>
    /// 累计签到配置列表
    /// </summary>
    [JsonPropertyName("continuous_configs")]
    public List<SignConfigDto> ContinuousConfigs { get; set; } = new();

    /// <summary>
    /// 每日签到配置列表
    /// </summary>
    [JsonPropertyName("daily_configs")]
    public List<SignConfigDto> DailyConfigs { get; set; } = new();
}

/// <summary>
/// 签到配置DTO
/// </summary>
public class SignConfigDto
{
    /// <summary>
    /// 配置ID
    /// </summary>
    [JsonPropertyName("id")]
    public int Id { get; set; }

    /// <summary>
    /// 奖励ID
    /// </summary>
    [JsonPropertyName("reward_id")]
    public string RewardId { get; set; } = string.Empty;

    /// <summary>
    /// 天数
    /// </summary>
    [JsonPropertyName("day")]
    public int Day { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    [JsonPropertyName("description")]
    public string? Description { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [JsonPropertyName("sort")]
    public int? Sort { get; set; }

    /// <summary>
    /// 图标URL
    /// </summary>
    [JsonPropertyName("icon")]
    public string? Icon { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    [JsonPropertyName("title")]
    public string? Title { get; set; }

    /// <summary>
    /// 签到状态：0-未签到 1-可领取 2-已领取
    /// </summary>
    [JsonPropertyName("is_sign")]
    public int IsSign { get; set; }

    /// <summary>
    /// 是否是当天签到日：0-否 1-是
    /// </summary>
    [JsonPropertyName("is_sign_day")]
    public int IsSignDay { get; set; }

    /// <summary>
    /// 奖励列表
    /// </summary>
    [JsonPropertyName("rewards")]
    public List<RewardDto> Rewards { get; set; } = new();
}

/// <summary>
/// 奖励DTO
/// </summary>
public class RewardDto
{
    /// <summary>
    /// 奖励类型：1-钻石 2-UU币 3-达达卷 4-优惠券
    /// </summary>
    [JsonPropertyName("reward_type")]
    public int RewardType { get; set; }

    /// <summary>
    /// 奖励扩展参数
    /// </summary>
    [JsonPropertyName("reward_extend")]
    public int? RewardExtend { get; set; }

    /// <summary>
    /// 奖励数值
    /// </summary>
    [JsonPropertyName("reward_value")]
    public decimal RewardValue { get; set; }

    /// <summary>
    /// 奖励类型文本
    /// </summary>
    [JsonPropertyName("reward_type_text")]
    public string RewardTypeText { get; set; } = string.Empty;
}

/// <summary>
/// 签到结果响应
/// </summary>
public class SignResultResponse
{
    /// <summary>
    /// 签到后的本月签到天数
    /// </summary>
    [JsonPropertyName("sign_days")]
    public int SignDays { get; set; }

    /// <summary>
    /// 奖励消息
    /// </summary>
    [JsonPropertyName("reward_msg")]
    public string? RewardMsg { get; set; }
}
