using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Entity.WorkFlow;
using GxPress.Request.App.Flow;
using Datory;

namespace GxPress.Repository.Interface.WorkFlow
{
    public interface IFlowTodoRepository : IRepository
    {
        Task<bool> UpdateSortAsync(FlowTodo todo);
        Task<int> InsertAsync(FlowTodo item);

        Task<int> GetCountByUserIdAsync(int userId);

        Task<IEnumerable<FlowTodo>> GetListByUserIdAsync(int userId, int processId, int page, int perPage);

        Task<bool> DeleteAsync(int todoId);

        Task<bool> DeleteAllAsync(int flowId);

        Task<IEnumerable<FlowTodo>> GetListByFlowIdAsync(int flowId);

        Task<IEnumerable<(int TodoId, int FlowId)>> GetTodoIdFlowIdListAsync(int userId, string type, bool isDone, FlowListRequest request);

        Task<int> GetCountAsync(int userId, string type, bool isDone, FlowListRequest request);

        Task<IEnumerable<(int TodoId, int FlowId)>> GetTodoIdFlowIdListAsync(int userId, string type, FlowListRequest request, bool isRead);

        Task<int> GetCountAsync(int userId, string type, FlowListRequest request);

        Task<FlowTodo> GetAsync(int todoId);

        Task<bool> UpdateAsync(FlowTodo todo);

        Task UpdateCCIsDoneAsync(int userId, int flowId);

        Task DeleteCheckingByFlowIdAsync(int flowId);

        Task<IEnumerable<int>> GetAllCheckedUserIdListAsync(int flowId);

        /// <summary>
        /// 未读数量
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="type"></param>
        /// <param name="isDone"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<int> GetUReadCountAsync(int userId, string type, bool isDone, FlowListRequest request);
        Task<int> CountAsync(SqlKata.Query query);

        Task<IEnumerable<FlowTodo>> GetAllAsync(SqlKata.Query query);
        Task<bool> UpdateAsync(SqlKata.Query query);
        Task<FlowTodo> GetAsync(SqlKata.Query query);

        Task<int> GetReadCountAsync(int userId, string type, FlowListRequest request, bool isRead);

         /// <summary>
        /// 抄送未读数量
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<int> FlowCcUReadCountAsync(int userId);
    }
}