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

namespace DAL.Interfaces
{
    /// <summary>
    /// 货物数据仓库接口
    /// </summary>
    public interface ICargoDataRepository
    {
        /// <summary>
        /// 批量插入货物数据
        /// </summary>
        /// <param name="cargoDataList">货物数据列表</param>
        /// <returns>插入成功的记录数</returns>
        Task<int> BatchInsertAsync(List<CargoDataEntity> cargoDataList);
        
        /// <summary>
        /// 根据中性面单单号查询货物数据
        /// </summary>
        /// <param name="neutralWaybillNumber">中性面单单号</param>
        /// <returns>货物数据实体</returns>
        Task<CargoDataEntity?> GetByWaybillNumberAsync(string neutralWaybillNumber);
        
        /// <summary>
        /// 查询货物数据
        /// </summary>
        /// <param name="searchKey">搜索关键字（中性面单/提单号/大包号）</param>
        /// <param name="customerId">客户ID（可选）</param>
        /// <param name="pageIndex">页码（默认1）</param>
        /// <param name="pageSize">每页记录数（默认100）</param>
        /// <returns>货物数据列表</returns>
        Task<IEnumerable<CargoDataEntity>> QueryAsync(string? searchKey = null, int? customerId = null, int pageIndex = 1, int pageSize = 100);
        
        /// <summary>
        /// 按中性面单单号批量更新货物数据
        /// </summary>
        /// <param name="cargoDataList">货物数据列表</param>
        /// <returns>更新成功的记录数</returns>
        Task<int> BatchUpdateByWaybillNumberAsync(List<CargoDataEntity> cargoDataList);
        
        /// <summary>
        /// 按中性面单单号批量删除货物数据
        /// </summary>
        /// <param name="neutralWaybillNumbers">中性面单单号列表</param>
        /// <returns>删除成功的记录数</returns>
        Task<int> BatchDeleteByWaybillNumbersAsync(List<string> neutralWaybillNumbers);
    }
}