using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Entity;
using GxPress.Request.AddressBookGroup;
using GxPress.Result.AddressBook;
using Datory;
using GxPress.Result.AddressBookGroup;

namespace GxPress.Repository.Interface
{
    public interface IAddressBookGroupRepository:IRepository
    {
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int id);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(AddressBookGroupUpRequest request);
        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<IEnumerable<AddressBookGroupResult>> GetAddressBookGroupListAsync(
            AddressBookGroupSearchRequest request);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<AddressBookGroup> InsertAsync(AddressBookGroupInRequest request);
        /// <summary>
        /// 获取用户通讯录组
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<AddressBookListResult> GetAddressBookListAsync(AddressBookListRequest request);

        /// <summary>
        /// 添加联系人
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> InsertAddressBookUserAsync(AddressBookInUserRequest request);

        Task<List<User>> GetUserByDepartmentIdAsync(List<User> users, int departmentId);

        /// <summary>
        /// 根据通讯录PID获取用户
        /// </summary>
        /// <param name="users"></param>
        /// <param name="pid"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<User>> GetUserByAddressBookGroupPidAsync(List<User> users, int pid,int userId);

        /// <summary>
        /// 根据组ID获取用户
        /// </summary>
        /// <param name="addressBookGroupId"></param>
        /// <returns></returns>
        Task<List<User>> GetUserByAddressBookGroupIdAsync(int addressBookGroupId);
        Task<List<AddressBookGroup>> GetAllAsync(SqlKata.Query query);
        /// <summary>
        /// 自建分组排序
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> SortAsync(AddressBookGroupSortRequest request);
    }
}
