using System.Collections.Generic;
using System.Threading.Tasks;
using MDL.Models;

namespace BLL.Interfaces
{
    /// <summary>
    /// 订单日志服务接口
    /// </summary>
    public interface IOrderLogService
    {
        /// <summary>
        /// 记录订单操作日志
        /// </summary>
        /// <param name="neutralWaybillNumber">中性面单单号</param>
        /// <param name="finalMileTrackingNumber">尾程跟踪单号</param>
        /// <param name="operationType">操作类型</param>
        /// <param name="operationResult">操作结果</param>
        /// <param name="operationDescription">操作说明</param>
        /// <param name="operator">操作人</param>
        /// <returns>记录是否成功</returns>
        Task<bool> RecordOrderLogAsync(string? neutralWaybillNumber, string? finalMileTrackingNumber, string operationType, string operationResult, string operationDescription, string? @operator = null);
        
        /// <summary>
        /// 根据中性面单单号获取订单日志列表
        /// </summary>
        /// <param name="neutralWaybillNumber">中性面单单号</param>
        /// <returns>订单日志实体列表</returns>
        Task<List<OrderLogEntity>> GetOrderLogsByWaybillNumberAsync(string neutralWaybillNumber);
        
        /// <summary>
        /// 根据尾程跟踪单号获取订单日志列表
        /// </summary>
        /// <param name="finalMileTrackingNumber">尾程跟踪单号</param>
        /// <returns>订单日志实体列表</returns>
        Task<List<OrderLogEntity>> GetOrderLogsByTrackingNumberAsync(string finalMileTrackingNumber);
        
        /// <summary>
        /// 获取所有订单日志列表（分页）
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <returns>订单日志实体列表</returns>
        Task<List<OrderLogEntity>> GetAllOrderLogsAsync(int pageIndex, int pageSize);
        
        /// <summary>
        /// 根据操作类型和操作结果获取订单日志列表
        /// </summary>
        /// <param name="operationType">操作类型</param>
        /// <param name="operationResult">操作结果</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <returns>订单日志实体列表</returns>
        Task<List<OrderLogEntity>> GetOrderLogsByOperationAsync(string operationType, string operationResult, int pageIndex, int pageSize);
    }
}
