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 IFlowRepository : IRepository
    {
        Task<int> InsertAsync(Flow flow);

        Task<bool> DeleteAsync(int id);

        Task<Flow> GetAsync(int flowId);

        Task<int> GetCountByUserIdAsync(int userId, bool checking, FlowListRequest request);

        Task<IEnumerable<Flow>> GetListAsync(int processId);

        Task<int> GetCountAsync(int processId, string state, string startDate, string endDate);

        Task<IEnumerable<Flow>> GetListAllAsync(int page, int perPage, int processId, string state, string startDate, string endDate);

        Task<IEnumerable<Flow>> GetListByUserIdAsync(int userId, bool checking, FlowListRequest request);

        Task<IEnumerable<Flow>> GetListByIdListAsync(IEnumerable<int> flowIdList, int page, int perPage);

        Task UpdateStateAsync(int flowId, string state);

        Task UpdateProcessNodeIdAsync(int flowId, int processNodeId);

         /// <summary>
        /// 新增 未读数量
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="checking"></param>
        /// <param name="request"></param>
        /// <returns></returns>
       Task<int> GetUReadCountByUserIdAsync(int userId, bool checking, FlowListRequest request);

       Task<int> CountAsync(SqlKata.Query query);
    }
}