namespace HoneyBox.Model.Models.Prize;

using System.Text.Json.Serialization;
using HoneyBox.Model.Models;

/// <summary>
/// 抽奖请求
/// </summary>
public class DrawPrizeRequest
{
    /// <summary>
    /// 商品ID
    /// </summary>
    [JsonPropertyName("goods_id")]
    public int GoodsId { get; set; }

    /// <summary>
    /// 抽奖次数
    /// </summary>
    [JsonPropertyName("times")]
    public int Times { get; set; } = 1;
}

/// <summary>
/// 抽奖结果响应
/// </summary>
public class DrawPrizeResponse
{
    /// <summary>
    /// 中奖奖品列表
    /// </summary>
    [JsonPropertyName("prizes")]
    public List<PrizeResultItem> Prizes { get; set; } = new();

    /// <summary>
    /// 消耗金额
    /// </summary>
    [JsonPropertyName("cost_amount")]
    public decimal CostAmount { get; set; }

    /// <summary>
    /// 剩余余额
    /// </summary>
    [JsonPropertyName("remaining_balance")]
    public decimal RemainingBalance { get; set; }
}

/// <summary>
/// 中奖奖品项
/// </summary>
public class PrizeResultItem
{
    /// <summary>
    /// 奖品ID
    /// </summary>
    [JsonPropertyName("id")]
    public int Id { get; set; }

    /// <summary>
    /// 奖品名称
    /// </summary>
    [JsonPropertyName("name")]
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 奖品图片
    /// </summary>
    [JsonPropertyName("img_url")]
    public string ImgUrl { get; set; } = string.Empty;

    /// <summary>
    /// 奖品等级
    /// </summary>
    [JsonPropertyName("level")]
    public int Level { get; set; }

    /// <summary>
    /// 奖品价值
    /// </summary>
    [JsonPropertyName("value")]
    public decimal Value { get; set; }
}

/// <summary>
/// 中奖记录列表请求
/// </summary>
public class PrizeRecordListRequest : PageRequest
{
    /// <summary>
    /// 商品ID
    /// </summary>
    [JsonPropertyName("goods_id")]
    public int? GoodsId { get; set; }
}

/// <summary>
/// 中奖记录响应
/// </summary>
public class PrizeRecordResponse
{
    /// <summary>
    /// 记录ID
    /// </summary>
    [JsonPropertyName("id")]
    public int Id { get; set; }

    /// <summary>
    /// 奖品名称
    /// </summary>
    [JsonPropertyName("prize_name")]
    public string PrizeName { get; set; } = string.Empty;

    /// <summary>
    /// 奖品图片
    /// </summary>
    [JsonPropertyName("prize_img")]
    public string PrizeImg { get; set; } = string.Empty;

    /// <summary>
    /// 中奖时间
    /// </summary>
    [JsonPropertyName("created_at")]
    public DateTime CreatedAt { get; set; }
}
