package cn.axzo.workflow.common.code;

import cn.axzo.framework.domain.web.code.IModuleRespCode;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 流程实例响应码
 *
 * @author wangli
 * @since 2023/12/14 16:34
 */
@Getter
@AllArgsConstructor
public enum BpmnInstanceRespCode implements IModuleRespCode {
    PROCESS_OPERATION_PARAM_VALID_ERROR("001", "参数缺失, 请确保传入了 ID 或 businessKey 对流程实例进行操作"),
    PROCESS_INSTANCE_CANCEL_FAIL_NOT_EXISTS("002", "流程撤回失败，审批流程已完结"),
    PROCESS_INSTANCE_CANCEL_FAIL_NOT_SELF("003", "流程撤回失败，该流程不是你发起的"),
    PROCESS_INSTANCE_NOT_EXISTS("004", "流程实例不存在或已结束"),
    PROCESS_INSTANCE_ID_NOT_EXISTS("005", "流程实例【{}】不存在"),
    PROCESS_INSTANCE_CANCELLED("006", "流程实例已撤回"),
    PROCESS_INSTANCE_CANT_CANCEL("007", "流程实例不能撤回"),
    PROCESS_INSTANCE_CANT_ABORT("008", "流程实例不能中止"),
    PROCESS_INSTANCE_CANT_UPDATE("009", "流程实例不能更新"),
    PROCESS_INSTANCE_CANT_DELETE("010", "流程实例不能删除"),
    PROCESS_INSTANCE_CANT_START("011", "流程实例不能启动"),
    TASK_CANT_COMMENT_INSTANCE_NOT_EXISTS("012", "流程实例【{}】不存在, 不能评论"),
    RUNNING_INSTANCE_ONLY_FORECAST("013", "仅运行中的实例可以推测"),
    ENGINE_EXEC_EXCEPTION("014", "引擎内部异常:【{}】"),
    PROCESS_TASK_NOT_EXISTS("015", "流程任务不存在或已处理"),
    PROCESS_DOC_READ_PARAM_ERROR("016", "查询审批人阅读状态参数丢失自然人 ID 数据"),
    PROCESS_DOC_ID_NOT_IN_MODEL("017", "当前流程中，不存在指定文档"),
    PROCESS_SIGN_DATA_NOT_EXISTS("018", "签署业务审批未获取到初始模板复制数据"),
    PROCESS_INSTANCE_CANT_REMIND("019", "流程实例【{}】不存在, 不能评论"),
    PROCESS_EXT_LOG_PARAM_ERROR("020", "查询流程日志的审批人PersonId参数不合法"),
    PROCESS_INSTANCE_CREATE_PARAM_ERROR("021", "当前审批业务必须传入叶子节点（CooperationOrgDTO.nodeId）"),
    ;
    private final String code;
    private final String message;

    @Override
    public String getModuleCode() {
        return "05";
    }

    @Override
    public String getProjectCode() {
        return "998";
    }

}
