using HoneyBox.Admin.Business.Models;
using HoneyBox.Admin.Business.Models.Goods;

namespace HoneyBox.Admin.Business.Services.Interfaces;

/// <summary>
/// 商品管理服务接口
/// </summary>
public interface IGoodsService
{
    #region 商品管理

    /// <summary>
    /// 获取商品列表
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>分页商品列表</returns>
    Task<PagedResult<GoodsListResponse>> GetGoodsListAsync(GoodsListRequest request);

    /// <summary>
    /// 获取商品详情
    /// </summary>
    /// <param name="goodsId">商品ID</param>
    /// <returns>商品详情</returns>
    Task<GoodsDetailResponse?> GetGoodsDetailAsync(int goodsId);

    /// <summary>
    /// 创建商品
    /// </summary>
    /// <param name="request">创建请求</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>新商品ID</returns>
    Task<int> CreateGoodsAsync(GoodsCreateRequest request, int operatorId);

    /// <summary>
    /// 更新商品
    /// </summary>
    /// <param name="goodsId">商品ID</param>
    /// <param name="request">更新请求</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>是否成功</returns>
    Task<bool> UpdateGoodsAsync(int goodsId, GoodsUpdateRequest request, int operatorId);

    /// <summary>
    /// 删除商品
    /// </summary>
    /// <param name="goodsId">商品ID</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>是否成功</returns>
    Task<bool> DeleteGoodsAsync(int goodsId, int operatorId);

    /// <summary>
    /// 设置商品状态（上架/下架）
    /// </summary>
    /// <param name="goodsId">商品ID</param>
    /// <param name="status">状态：0-下架 1-上架</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>是否成功</returns>
    Task<bool> SetGoodsStatusAsync(int goodsId, int status, int operatorId);

    #endregion

    #region 奖品管理

    /// <summary>
    /// 获取商品奖品列表
    /// </summary>
    /// <param name="goodsId">商品ID</param>
    /// <returns>奖品列表</returns>
    Task<List<PrizeDto>> GetPrizesAsync(int goodsId);

    /// <summary>
    /// 添加奖品
    /// </summary>
    /// <param name="goodsId">商品ID</param>
    /// <param name="request">创建请求</param>
    /// <returns>新奖品ID</returns>
    Task<int> AddPrizeAsync(int goodsId, PrizeCreateRequest request);

    /// <summary>
    /// 更新奖品
    /// </summary>
    /// <param name="prizeId">奖品ID</param>
    /// <param name="request">更新请求</param>
    /// <returns>是否成功</returns>
    Task<bool> UpdatePrizeAsync(int prizeId, PrizeUpdateRequest request);

    /// <summary>
    /// 删除奖品
    /// </summary>
    /// <param name="prizeId">奖品ID</param>
    /// <returns>是否成功</returns>
    Task<bool> DeletePrizeAsync(int prizeId);

    #endregion

    #region 盒子类型管理

    /// <summary>
    /// 获取盒子类型列表
    /// </summary>
    /// <returns>盒子类型列表</returns>
    Task<List<GoodsTypeDto>> GetGoodsTypesAsync();

    /// <summary>
    /// 创建盒子类型
    /// </summary>
    /// <param name="request">创建请求</param>
    /// <returns>新类型ID</returns>
    Task<int> CreateGoodsTypeAsync(GoodsTypeCreateRequest request);

    /// <summary>
    /// 更新盒子类型
    /// </summary>
    /// <param name="typeId">类型ID</param>
    /// <param name="request">更新请求</param>
    /// <returns>是否成功</returns>
    Task<bool> UpdateGoodsTypeAsync(int typeId, GoodsTypeUpdateRequest request);

    /// <summary>
    /// 删除盒子类型
    /// </summary>
    /// <param name="typeId">类型ID</param>
    /// <returns>是否成功</returns>
    Task<bool> DeleteGoodsTypeAsync(int typeId);

    /// <summary>
    /// 设置盒子类型状态
    /// </summary>
    /// <param name="typeId">类型ID</param>
    /// <param name="request">状态请求</param>
    /// <returns>是否成功</returns>
    Task<bool> SetGoodsTypeStatusAsync(int typeId, GoodsTypeStatusRequest request);

    #endregion

    #region 盒子扩展设置

    /// <summary>
    /// 获取盒子扩展设置
    /// </summary>
    /// <param name="goodsId">盒子ID</param>
    /// <returns>扩展设置（如无独立配置则返回类型默认配置）</returns>
    Task<GoodsExtendDto> GetGoodsExtendAsync(int goodsId);

    /// <summary>
    /// 更新盒子扩展设置
    /// </summary>
    /// <param name="goodsId">盒子ID</param>
    /// <param name="request">更新请求</param>
    /// <returns>是否成功</returns>
    Task<bool> UpdateGoodsExtendAsync(int goodsId, GoodsExtendUpdateRequest request);

    /// <summary>
    /// 删除盒子扩展设置（恢复使用类型默认配置）
    /// </summary>
    /// <param name="goodsId">盒子ID</param>
    /// <returns>是否成功</returns>
    Task<bool> DeleteGoodsExtendAsync(int goodsId);

    #endregion

    #region 盒子操作

    /// <summary>
    /// 复制盒子（含奖品）
    /// </summary>
    /// <param name="goodsId">源盒子ID</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>新盒子ID</returns>
    Task<int> CopyGoodsAsync(int goodsId, int operatorId);

    /// <summary>
    /// 清空盒子抽奖记录
    /// </summary>
    /// <param name="goodsId">盒子ID</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>是否成功</returns>
    Task<bool> ClearGoodsLotteryAsync(int goodsId, int operatorId);

    #endregion
}
