package cn.stylefeng.workflow.instance.api;

import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.workflow.api.entity.design.Node;
import cn.stylefeng.workflow.api.entity.task.RuTask;
import cn.stylefeng.workflow.instance.api.pojo.TaskApplicantInfo;
import cn.stylefeng.workflow.instance.api.pojo.request.RuntimeInstanceRequest;
import cn.stylefeng.workflow.instance.api.pojo.task.CommonTaskItem;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface TaskApi {

    Set<Long> getInstanceCurrentApprover(Long instanceId);

    Map<Long, Set<Long>> getInstanceCurrentApprover(List<Long> instanceIdList);

    Node getTaskNode(Long taskId);

    Integer getTaskStatus(Long taskId);

    TaskApplicantInfo getTaskApplicantInfo(Long taskId);

    PageResult<CommonTaskItem> getUserTasks(RuntimeInstanceRequest runtimeInstanceRequest);

    List<CommonTaskItem> getUserTasksTotal(RuntimeInstanceRequest runtimeInstanceRequest);

    Set<Long> getUserHandledInstanceIdList(List<Long> userIdList);

    Set<Long> getInstanceIdsInStatus(List<Long> instanceIds,List<Integer> taskStatus);

    List<RuTask> getUserProcessingAndHandlingTaskList(Long userId, Long instanceId);

}