using System.Text.Json.Serialization;

namespace HoneyBox.Model.Models.Mall;

#region Diamond Product Models

/// <summary>
/// 钻石商品列表项
/// </summary>
public class DiamondProductDto
{
    /// <summary>
    /// 产品ID
    /// </summary>
    [JsonPropertyName("products_id")]
    public string ProductsId { get; set; } = string.Empty;

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

    /// <summary>
    /// 价格
    /// </summary>
    [JsonPropertyName("price")]
    public decimal Price { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    [JsonPropertyName("status")]
    public byte? Status { get; set; }

    /// <summary>
    /// 商品图片
    /// </summary>
    [JsonPropertyName("image")]
    public string? Image { get; set; }

    /// <summary>
    /// 选中图片
    /// </summary>
    [JsonPropertyName("select_image")]
    public string? SelectImage { get; set; }
}

#endregion

#region Diamond Order Models

/// <summary>
/// 创建钻石订单请求
/// </summary>
public class CreateDiamondOrderRequest
{
    /// <summary>
    /// 产品ID
    /// </summary>
    [JsonPropertyName("product_id")]
    public string ProductId { get; set; } = string.Empty;

    /// <summary>
    /// 支付类型：1=小程序微信支付，2=H5支付宝，3=APP微信，4=APP支付宝
    /// </summary>
    [JsonPropertyName("pay_type")]
    public int PayType { get; set; } = 2;
}

/// <summary>
/// 创建钻石订单结果
/// </summary>
public class CreateDiamondOrderResult
{
    /// <summary>
    /// 状态：1=成功，0=失败
    /// </summary>
    [JsonPropertyName("status")]
    public int Status { get; set; }

    /// <summary>
    /// 订单号
    /// </summary>
    [JsonPropertyName("order_num")]
    public string? OrderNum { get; set; }

    /// <summary>
    /// 支付数据
    /// </summary>
    [JsonPropertyName("res")]
    public object? Res { get; set; }
}

/// <summary>
/// 钻石订单状态响应
/// </summary>
public class DiamondOrderStatusResponse
{
    /// <summary>
    /// 订单状态
    /// </summary>
    [JsonPropertyName("status")]
    public string Status { get; set; } = string.Empty;

    /// <summary>
    /// 奖励日志
    /// </summary>
    [JsonPropertyName("reward_log")]
    public string? RewardLog { get; set; }
}

#endregion

#region Diamond Order Constants

/// <summary>
/// 钻石订单状态常量
/// </summary>
public static class DiamondOrderStatus
{
    /// <summary>
    /// 待支付
    /// </summary>
    public const string Pending = "pending";

    /// <summary>
    /// 支付成功
    /// </summary>
    public const string Success = "success";

    /// <summary>
    /// 支付失败
    /// </summary>
    public const string Failed = "failed";
}

/// <summary>
/// 钻石订单支付方式常量
/// </summary>
public static class DiamondPayMethod
{
    /// <summary>
    /// 支付宝
    /// </summary>
    public const string Alipay = "alipay";

    /// <summary>
    /// 微信支付
    /// </summary>
    public const string Wechat = "wechat";
}

#endregion
