using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Enum;

namespace QYZH.InteractiveMagazine.Models.Dto;

/// <summary>
/// 商品创建/更新输入
/// </summary>
public class ProductInput
{
    /// <summary>
    /// 商品名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 描述
    /// </summary>
    public string? Description { get; set; }

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

    /// <summary>
    /// 所需积分
    /// </summary>
    public int Price { get; set; }

    /// <summary>
    /// 商品类型: MakeUpCard, PetBg
    /// </summary>
    public string Type { get; set; } = string.Empty;

    /// <summary>
    /// 售卖状态: OnSale, OffSale
    /// </summary>
    public ProductStatusEnum Status { get; set; } = ProductStatusEnum.OnSale;

    /// <summary>
    /// 扩展数据
    /// </summary>
    public string? MetaData { get; set; }

    /// <summary>
    /// 是否上架
    /// </summary>
    public bool IsActive { get; set; } = true;

    /// <summary>
    /// 库存(-1无限)
    /// </summary>
    public int Stock { get; set; } = -1;

    /// <summary>
    /// 是否是虚拟商品
    /// </summary>
    public bool IsVirtual { get; set; }

    /// <summary>
    /// Type对应的Id
    /// </summary>
    public long TypeId { get; set; }
}

/// <summary>
/// 商品输出
/// </summary>
public class ProductOutput
{
    /// <summary>
    /// 主键ID
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 商品名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 描述
    /// </summary>
    public string? Description { get; set; }

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

    /// <summary>
    /// 所需积分
    /// </summary>
    public int Price { get; set; }

    /// <summary>
    /// 商品类型
    /// </summary>
    public string Type { get; set; } = string.Empty;

    /// <summary>
    /// 状态
    /// </summary>
    public string Status { get; set; } = string.Empty;

    /// <summary>
    /// 扩展数据
    /// </summary>
    public string? MetaData { get; set; }

    /// <summary>
    /// 是否上架
    /// </summary>
    public bool IsActive { get; set; }

    /// <summary>
    /// 库存(-1无限)
    /// </summary>
    public int Stock { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    public string? CreatedBy { get; set; }

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

    /// <summary>
    /// 更新人
    /// </summary>
    public string? UpdatedBy { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdatedAt { get; set; }

    /// <summary>
    /// 是否是虚拟商品
    /// </summary>
    public bool IsVirtual { get; set; }

    /// <summary>
    /// Type对应的Id
    /// </summary>
    public long TypeId { get; set; }
}

/// <summary>
/// 商品分页查询输入
/// </summary>
public class ProductQueryInput : PageQueryModel
{
    /// <summary>
    /// 商品名称（模糊查询）
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 商品类型
    /// </summary>
    public string? Type { get; set; }

    /// <summary>
    /// 售卖状态
    /// </summary>
    public ProductStatusEnum? Status { get; set; }

    /// <summary>
    /// 是否上架
    /// </summary>
    public bool? IsActive { get; set; }
}
