namespace HoneyBox.Admin.Business.Models.User;

/// <summary>
/// 用户订单查询请求
/// </summary>
public class UserOrderQuery : PagedRequest
{
    /// <summary>
    /// 订单状态：0待支付，1已支付，2已取消
    /// </summary>
    public int? Status { get; set; }

    /// <summary>
    /// 订单编号
    /// </summary>
    public string? OrderNum { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    public DateTime? EndTime { get; set; }
}

/// <summary>
/// 用户订单项
/// </summary>
public class UserOrderItem
{
    /// <summary>
    /// 订单ID
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 订单编号
    /// </summary>
    public string OrderNum { get; set; } = null!;

    /// <summary>
    /// 商品ID
    /// </summary>
    public int GoodsId { get; set; }

    /// <summary>
    /// 商品标题
    /// </summary>
    public string? GoodsTitle { get; set; }

    /// <summary>
    /// 商品图片
    /// </summary>
    public string? GoodsImgurl { get; set; }

    /// <summary>
    /// 商品单价
    /// </summary>
    public decimal GoodsPrice { get; set; }

    /// <summary>
    /// 购买数量
    /// </summary>
    public int Num { get; set; }

    /// <summary>
    /// 订单总金额
    /// </summary>
    public decimal OrderTotal { get; set; }

    /// <summary>
    /// 折后金额
    /// </summary>
    public decimal OrderZheTotal { get; set; }

    /// <summary>
    /// 实际支付金额
    /// </summary>
    public decimal Price { get; set; }

    /// <summary>
    /// 使用余额
    /// </summary>
    public decimal UseMoney { get; set; }

    /// <summary>
    /// 使用积分
    /// </summary>
    public decimal UseIntegral { get; set; }

    /// <summary>
    /// 使用钻石
    /// </summary>
    public decimal UseScore { get; set; }

    /// <summary>
    /// 使用优惠券金额
    /// </summary>
    public decimal? UseCoupon { get; set; }

    /// <summary>
    /// 折扣
    /// </summary>
    public decimal Zhe { get; set; }

    /// <summary>
    /// 中奖数量
    /// </summary>
    public int PrizeNum { get; set; }

    /// <summary>
    /// 订单状态：0待支付，1已支付，2已取消
    /// </summary>
    public int Status { get; set; }

    /// <summary>
    /// 状态文本
    /// </summary>
    public string StatusText => Status switch
    {
        0 => "待支付",
        1 => "已支付",
        2 => "已取消",
        _ => "未知"
    };

    /// <summary>
    /// 支付方式：1微信，2支付宝
    /// </summary>
    public int PayType { get; set; }

    /// <summary>
    /// 支付方式文本
    /// </summary>
    public string PayTypeText => PayType switch
    {
        1 => "微信支付",
        2 => "支付宝",
        _ => "其他"
    };

    /// <summary>
    /// 订单类型
    /// </summary>
    public int OrderType { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 支付时间
    /// </summary>
    public DateTime? PayTime { get; set; }
}
