package cn.axzo.workflow.common.enums;

import cn.axzo.framework.rocketmq.Event;

/**
 * 流程任务节点相关的 MQ 事件枚举定义
 *
 * @author wangli
 * @since 2023/9/25 16:09
 */
public enum ProcessTaskEventEnum {

    PROCESS_TASK_CREATED("process-task", "process-task-created", "流程任务已创建"),
    PROCESS_TASK_ASSIGNED("process-task", "process-task-assigned", "流程任务已分配"),
    PROCESS_TASK_COMPLETED("process-task", "process-task-completed", "流程任务已结束"),
    PROCESS_TASK_DELETED("process-task", "process-task-deleted", "流程任务已删除"),
    ;
    private final String module;
    private final String tag;
    private final String desc;
    private Event.EventCode eventCode;

    ProcessTaskEventEnum(String model, String tag, String desc) {
        this.eventCode = Event.EventCode.builder()
                .module(model)
                .name(tag)
                .build();
        this.module = model;
        this.tag = tag;
        this.desc = desc;
    }

    public String getModule() {
        return module;
    }

    public String getTag() {
        return tag;
    }

    public String getDesc() {
        return desc;
    }

    public Event.EventCode getEventCode() {
        return eventCode;
    }
}
