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

namespace DAL.Interfaces
{
    public interface IArrivalHandoverFormRepository
    {
        Task<int> InsertAsync(ArrivalHandoverFormEntity form);
        Task<ArrivalHandoverFormEntity> GetByIdAsync(int id);
        Task<ArrivalHandoverFormEntity> GetByHandoverNumberAsync(string handoverNumber);
        Task<List<ArrivalHandoverFormEntity>> GetAllAsync();
        Task<int> UpdateAsync(ArrivalHandoverFormEntity form);
        Task<int> DeleteAsync(int id);
        Task<bool> ExistsByHandoverNumberAsync(string handoverNumber);
        /// <summary>
        /// 批量获取到货交接单（分页）
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="sortBy">排序字段</param>
        /// <param name="sortOrder">排序方向</param>
        /// <param name="handoverNumber">交接单号</param>
        /// <param name="creator">创建人</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>到货交接单列表和总记录数</returns>
        Task<(List<ArrivalHandoverFormEntity> Forms, int TotalCount)> GetArrivalHandoverFormsBatchAsync(
            int page,
            int pageSize,
            string sortBy,
            string sortOrder,
            string handoverNumber,
            string creator,
            System.DateTime? startDate = null,
            System.DateTime? endDate = null);

        /// <summary>
        /// 获取指定日期范围内的到货交接单
        /// </summary>
        /// <param name="startDate">开始日期 (UTC)</param>
        /// <param name="endDate">结束日期 (UTC)</param>
        /// <returns>到货交接单列表</returns>
        Task<List<ArrivalHandoverFormEntity>> GetArrivalHandoverFormsByDateRangeAsync(System.DateTime startDate, System.DateTime endDate);
    }
}