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

namespace BLL.Interfaces
{
    public interface IBagTagService
    {
        Task<List<string>> GenerateBagTagsAsync(string channelName, int count, string creator);
        Task<bool> OpenBagTagAsync(string tagNumber);
        Task<bool> CloseBagTagAsync(string tagNumber);
        Task<(bool Success, int ErrorCode, string ErrorMessage)> AssociateWaybillAsync(string tagNumber, string finalMileTrackingNumber, string creator);
        Task<BagTagEntity> GetBagTagAsync(string tagNumber);
        Task<List<MDL.DTOs.BagTagWaybillWithDetailsDto>> GetWaybillsByTagNumberAsync(string tagNumber);
        Task<(List<BagTagEntity> BagTags, int TotalCount)> GetBagTagsBatchAsync(
            int page, 
            int pageSize, 
            string sortBy, 
            string sortOrder, 
            string tagNumber, 
            string channel, 
            string status, 
            string creator);
        Task<int> GetWaybillCountByTagNumberAsync(string tagNumber);
        Task<(bool Success, int ErrorCode, string ErrorMessage)> RemoveWaybillAssociationAsync(string tagNumber, string finalMileTrackingNumber);
        Task<BagTagWaybillEntity> GetBagTagByWaybillAsync(string finalMileTrackingNumber);
        Task<bool> IsWaybillAssociatedAsync(string finalMileTrackingNumber);
        Task<List<BagTagEntity>> GetAvailableBagTagsByChannelAsync(string channel);

        /// <summary>
        /// 启动自动集包任务
        /// </summary>
        Task<StartAutoPackResponse> StartAutoPackAsync(string tagNumber, string creator);

        /// <summary>
        /// 查询自动集包进度
        /// </summary>
        Task<AutoPackProgressResponse> GetAutoPackProgressAsync(string taskId);

        /// <summary>
        /// 取消自动集包任务
        /// </summary>
        Task<bool> CancelAutoPackAsync(string taskId);

        /// <summary>
        /// 获取自动集包结果
        /// </summary>
        Task<AutoPackResultResponse> GetAutoPackResultAsync(string taskId);
    }
}