using HoneyBox.Model.Models;
using HoneyBox.Model.Models.Order;

namespace HoneyBox.Core.Interfaces;

/// <summary>
/// 订单服务接口
/// </summary>
public interface IOrderService
{
    #region 订单金额计算

    /// <summary>
    /// 一番赏订单金额计算
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">计算请求</param>
    /// <returns>计算结果</returns>
    Task<OrderCalculationDto> CalculateOrderMoneyAsync(int userId, OrderMoneyRequest request);

    /// <summary>
    /// 无限赏订单金额计算
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">计算请求</param>
    /// <returns>计算结果</returns>
    Task<OrderCalculationDto> CalculateInfiniteOrderMoneyAsync(int userId, InfiniteOrderMoneyRequest request);

    /// <summary>
    /// 商城订单金额计算
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">计算请求</param>
    /// <returns>计算结果</returns>
    Task<OrderCalculationDto> CalculateMallOrderMoneyAsync(int userId, MallOrderMoneyRequest request);

    #endregion

    #region 订单创建

    /// <summary>
    /// 一番赏订单创建
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">创建请求</param>
    /// <returns>创建结果</returns>
    Task<OrderBuyResponseDto> CreateOrderAsync(int userId, OrderBuyRequest request);

    /// <summary>
    /// 无限赏订单创建
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">创建请求</param>
    /// <returns>创建结果</returns>
    Task<OrderBuyResponseDto> CreateInfiniteOrderAsync(int userId, InfiniteOrderBuyRequest request);

    #endregion

    #region 订单查询

    /// <summary>
    /// 获取订单列表
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">查询请求</param>
    /// <returns>订单列表</returns>
    Task<PageResponse<OrderListDto>> GetOrderListAsync(int userId, OrderListRequest request);

    /// <summary>
    /// 获取订单详情
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="orderNum">订单号</param>
    /// <returns>订单详情（扁平结构，包含goods_list）</returns>
    Task<OrderInfoDto> GetOrderDetailAsync(int userId, string orderNum);

    #endregion

    #region 抽奖结果查询

    /// <summary>
    /// 获取一番赏抽奖结果
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="orderNum">订单号</param>
    /// <returns>抽奖结果响应</returns>
    Task<PrizeOrderLogResponseDto> GetPrizeOrderLogAsync(int userId, string orderNum);

    /// <summary>
    /// 获取无限赏抽奖结果
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="orderNum">订单号</param>
    /// <returns>无限赏抽奖结果响应</returns>
    Task<InfinitePrizeOrderLogResponseDto> GetInfinitePrizeOrderLogAsync(int userId, string orderNum);

    #endregion

    #region 订单模块扩展

    /// <summary>
    /// 获取订单支付状态
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="orderNum">订单号</param>
    /// <returns>订单状态响应</returns>
    Task<OrderStatusResponseDto> GetOrderStatusAsync(int userId, string orderNum);

    /// <summary>
    /// 获取订单列表（GET方式）
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="page">页码</param>
    /// <param name="pageSize">每页数量</param>
    /// <returns>订单列表响应</returns>
    Task<GetOrderListResponseDto> GetOrderListByGetAsync(int userId, int page, int pageSize);

    /// <summary>
    /// 创建网页支付订单
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="orderNum">订单号</param>
    /// <returns>网页支付订单响应</returns>
    Task<WebPayOrderResponseDto> CreateWebPayOrderAsync(int userId, string orderNum);

    /// <summary>
    /// 获取订单URL链接
    /// </summary>
    /// <param name="orderNum">订单号</param>
    /// <returns>订单链接响应</returns>
    Task<OrderUrlLinkResponseDto> GetOrderUrlLinkAsync(string orderNum);

    /// <summary>
    /// 商城下单
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">下单请求</param>
    /// <returns>订单创建响应</returns>
    Task<OrderBuyResponseDto> CreateMallOrderAsync(int userId, MallOrderBuyRequest request);

    /// <summary>
    /// 获取道具卡列表
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="page">页码</param>
    /// <param name="pageSize">每页数量</param>
    /// <returns>道具卡列表响应</returns>
    Task<ItemCardListResponseDto> GetItemCardListAsync(int userId, int page, int pageSize);

    /// <summary>
    /// 连击赏秘宝下单
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="request">下单请求</param>
    /// <returns>订单创建响应</returns>
    Task<OrderBuyResponseDto> CreateInfiniteMibaoOrderAsync(int userId, InfiniteMibaoOrderBuyRequest request);

    /// <summary>
    /// 获取测试用户Token（仅测试环境）
    /// </summary>
    /// <param name="userId">当前用户ID</param>
    /// <param name="targetUserId">目标用户ID</param>
    /// <returns>测试用户Token</returns>
    Task<string> GetUserTestTokenAsync(int userId, int targetUserId);

    #endregion
}
