package cn.axzo.workflow.core.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", "仅运行中的实例可以推测"),
    ;
    private String code;
    private String message;

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

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

    public void setCode(String code) {
        this.code = code;
    }


    public void setMessage(String message) {
        this.message = message;
    }
}
