using HoneyBox.Admin.Business.Models;
using HoneyBox.Admin.Business.Models.Order;

namespace HoneyBox.Admin.Business.Services.Interfaces;

/// <summary>
/// 订单管理服务接口
/// </summary>
public interface IOrderService
{
    #region 订单查询

    /// <summary>
    /// 获取订单列表
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>分页订单列表</returns>
    Task<PagedResult<OrderListResponse>> GetOrderListAsync(OrderListRequest request);

    /// <summary>
    /// 获取订单详情
    /// </summary>
    /// <param name="orderId">订单ID</param>
    /// <returns>订单详情</returns>
    Task<OrderDetailResponse?> GetOrderDetailAsync(int orderId);

    /// <summary>
    /// 获取卡单列表（待处理的订单项）
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>分页订单列表</returns>
    Task<PagedResult<OrderListResponse>> GetStuckOrdersAsync(OrderListRequest request);

    /// <summary>
    /// 获取兑换订单列表
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>分页兑换订单列表</returns>
    Task<PagedResult<RecoveryOrderResponse>> GetRecoveryOrdersAsync(OrderListRequest request);

    /// <summary>
    /// 获取综合订单列表（支持按账号类型和状态过滤）
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>分页订单列表</returns>
    Task<PagedResult<OrderListResponse>> GetComprehensiveOrdersAsync(ComprehensiveOrderListRequest request);

    #endregion

    #region 发货管理

    /// <summary>
    /// 获取发货订单列表
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>分页发货订单列表</returns>
    Task<PagedResult<ShippingOrderResponse>> GetShippingOrdersAsync(ShippingOrderListRequest request);

    /// <summary>
    /// 获取发货订单详情
    /// </summary>
    /// <param name="sendId">发货记录ID</param>
    /// <returns>发货订单详情</returns>
    Task<ShippingOrderResponse?> GetShippingOrderDetailAsync(int sendId);

    /// <summary>
    /// 发货处理
    /// </summary>
    /// <param name="sendId">发货记录ID</param>
    /// <param name="request">发货请求</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>是否成功</returns>
    Task<bool> ShipOrderAsync(int sendId, ShipOrderRequest request, int operatorId);

    /// <summary>
    /// 取消发货订单
    /// </summary>
    /// <param name="sendId">发货记录ID</param>
    /// <param name="operatorId">操作员ID</param>
    /// <returns>是否成功</returns>
    Task<bool> CancelShippingOrderAsync(int sendId, int operatorId);

    #endregion

    #region 订单导出

    /// <summary>
    /// 导出订单为Excel
    /// </summary>
    /// <param name="request">导出请求</param>
    /// <returns>Excel文件字节数组</returns>
    Task<byte[]> ExportOrdersAsync(OrderExportRequest request);

    /// <summary>
    /// 导出发货订单为CSV
    /// </summary>
    /// <param name="request">导出请求</param>
    /// <returns>CSV文件字节数组</returns>
    Task<byte[]> ExportShippingOrdersAsync(ShippingExportRequest request);

    /// <summary>
    /// 导出回收订单为CSV
    /// </summary>
    /// <param name="request">导出请求</param>
    /// <returns>CSV文件字节数组</returns>
    Task<byte[]> ExportRecoveryOrdersAsync(RecoveryExportRequest request);

    /// <summary>
    /// 获取发货订单统计信息
    /// </summary>
    /// <param name="request">查询请求</param>
    /// <returns>统计信息</returns>
    Task<ShippingStatsResponse> GetShippingStatsAsync(ShippingOrderListRequest request);

    /// <summary>
    /// 导出综合订单为CSV
    /// </summary>
    /// <param name="request">导出请求</param>
    /// <returns>CSV文件字节数组</returns>
    Task<byte[]> ExportComprehensiveOrdersAsync(ComprehensiveOrderExportRequest request);

    #endregion
}
