package cn.axzo.workflow.common.enums;

import java.util.Arrays;
import java.util.Objects;

/**
 * 模型业务类型枚举
 *
 * @author wangli
 * @since 2025-03-26 11:49
 */
public enum ModelBizTypeEnum {

    SIGN("SIGN", "签署业务"),
    FLOWABLE("FLOWABLE", "审批业务"),
    ;
    private final String type;
    private final String desc;

    ModelBizTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static ModelBizTypeEnum valueOfType(String type) {
        return Arrays.stream(ModelBizTypeEnum.values())
                .filter(i -> Objects.equals(i.getType(), type))
                .findAny()
                .orElse(null);
    }
}
