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

namespace BLL.Interfaces
{
    /// <summary>
    /// 出货交接单与袋牌关联服务接口
    /// </summary>
    public interface IShippingHandoverFormBagTagService
    {
        /// <summary>
        /// 关联袋牌到出货交接单
        /// </summary>
        /// <param name="shippingHandoverFormId">出货交接单ID</param>
        /// <param name="bagTagIds">袋牌ID列表</param>
        /// <returns>影响行数</returns>
        Task<int> AssociateBagTagsAsync(int shippingHandoverFormId, List<int> bagTagIds);

        /// <summary>
        /// 获取出货交接单关联的袋牌列表
        /// </summary>
        /// <param name="shippingHandoverFormId">出货交接单ID</param>
        /// <returns>袋牌列表</returns>
        Task<List<BagTagEntity>> GetAssociatedBagTagsAsync(int shippingHandoverFormId);

        /// <summary>
        /// 从出货交接单中移除袋牌
        /// </summary>
        /// <param name="relationId">关联ID</param>
        /// <returns>影响行数</returns>
        Task<int> RemoveBagTagAsync(int relationId);

        /// <summary>
        /// 清空出货交接单的所有袋牌关联
        /// </summary>
        /// <param name="shippingHandoverFormId">出货交接单ID</param>
        /// <returns>影响行数</returns>
        Task<int> ClearBagTagsAsync(int shippingHandoverFormId);

        /// <summary>
        /// 统计出货交接单的袋牌数量和包裹数量
        /// </summary>
        /// <param name="shippingHandoverFormId">出货交接单ID</param>
        /// <returns>袋牌数量和包裹数量</returns>
        Task<(int BagTagCount, int PackageCount)> CountBagTagsAndPackagesAsync(int shippingHandoverFormId);

        /// <summary>
        /// 检查袋牌是否已关联到出货交接单
        /// </summary>
        /// <param name="bagTagId">袋牌ID</param>
        /// <returns>是否已关联</returns>
        Task<bool> IsBagTagAssociatedAsync(int bagTagId);

        /// <summary>
        /// 通过袋牌号关联袋牌到出货交接单
        /// </summary>
        /// <param name="shippingHandoverFormId">出货交接单ID</param>
        /// <param name="bagTagNumbers">袋牌号列表</param>
        /// <returns>影响行数</returns>
        Task<int> AssociateBagTagsByNumberAsync(int shippingHandoverFormId, List<string> bagTagNumbers);
    }
}