package cn.stylefeng.workflow.instance.modular.task.enums;

import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import lombok.Getter;

@Getter
public enum RuTaskExceptionEnum implements AbstractExceptionEnum {

    RU_TASK_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "任务查询结果不存在"),

    CANT_AGREE(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10002", "该待办任务已同意或已拒绝，无法进行审批通过操作"),

    CANT_FIND_FORM_LIST(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10003", "获取不到流程表单配置信息，请检查流程是否配置流程表单"),

    CANT_RECALL(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10004", "流程撤回失败，参数为空！"),

    HAVE_ALREADY_APPROVE(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10004", "流程存在已经审批的任务，无法进行撤回"),

    INSTANCE_STATUS_NOT_RIGHT(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10005", "非进行中流程，无法进行撤回"),

    INSTANCE_STATUS_NOT_RIGHT_CNACEL(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10006", "非进行中流程，无法进行撤销"),

    CANT_DELEGATE_TASK(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10007", "无法转交任务，您无法操作本任务"),

    CANT_FIND_START_TASK(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10008", "无法获取待开始的任务，请检查用户任务是否正常"),

    NO_RUNNING_NODE(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10009", "没有进行中的流程节点，任务无法重新办理"),

    NO_ALREADY_FINISHED_TASK(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10010", "进行中节点，没有用户已经完成的任务，无法重新办理");

    private final String errorCode;

    private final String userTip;

    RuTaskExceptionEnum(String errorCode, String userTip) {
        this.errorCode = errorCode;
        this.userTip = userTip;
    }

}