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

namespace DAL.Interfaces
{
    /// <summary>
    /// 出货交接单与袋牌关联仓库接口
    /// </summary>
    public interface IShippingHandoverFormBagTagRepository
    {
        /// <summary>
        /// 插入关联记录
        /// </summary>
        /// <param name="relation">关联实体</param>
        /// <returns>影响行数</returns>
        Task<int> InsertAsync(ShippingHandoverFormBagTagEntity relation);

        /// <summary>
        /// 批量插入关联记录
        /// </summary>
        /// <param name="relations">关联实体列表</param>
        /// <returns>影响行数</returns>
        Task<int> InsertBatchAsync(List<ShippingHandoverFormBagTagEntity> relations);

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

        /// <summary>
        /// 根据袋牌ID获取关联的出货交接单
        /// </summary>
        /// <param name="bagTagId">袋牌ID</param>
        /// <returns>关联实体</returns>
        Task<ShippingHandoverFormBagTagEntity> GetByBagTagIdAsync(int bagTagId);

        /// <summary>
        /// 删除关联记录
        /// </summary>
        /// <param name="id">关联ID</param>
        /// <returns>影响行数</returns>
        Task<int> DeleteAsync(int id);

        /// <summary>
        /// 根据出货交接单ID删除所有关联记录
        /// </summary>
        /// <param name="shippingHandoverFormId">出货交接单ID</param>
        /// <returns>影响行数</returns>
        Task<int> DeleteByShippingHandoverFormIdAsync(int shippingHandoverFormId);

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