package com.docus.server.common.event;

import com.docus.infrastructure.core.db.enums.IIntegerEnum;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

/**
 * 流程事件
 */
@Getter
public class FlowEvent extends ApplicationEvent {
    /**
     * 业务系统病案主键
     */
    private final String patientId;
    /**
     * 自动分段流程类型
     */
    private final FlowTypeEnum flowTypeEnum;

    public FlowEvent(Object source, String patientId, FlowTypeEnum flowTypeEnum) {
        super(source);
        this.patientId = patientId;
        this.flowTypeEnum = flowTypeEnum;
    }


    public enum FlowTypeEnum implements IIntegerEnum {
        //正式
        START_SEGMENT(1, "开始分段事件"),
        START_OCR(2, "开始OCR事件"),
        START_UPLOAD(3, "开始上传归档系统事件"),

        //调试
        START_SEGMENT_TEST(4, "开始分段测试事件"),
        START_OCR_TEST(5, "开始OCR测试事件"),
        START_UPLOAD_TEST(6, "开始上传归档系统测试事件");

        private Integer value;
        private String display;

        FlowTypeEnum(Integer value, String display) {
            this.value = value;
            this.display = display;
        }

        @Override
        public Integer getValue() {
            return this.value;
        }

        @Override
        public String getDisplay() {
            return this.display;
        }
    }

}
