package com.njcn.rdms.module.system.enums.dept;

import java.util.Arrays;

/**
 * 组织节点类型枚举
 */
public enum DeptOrgTypeEnum {

    COMPANY("company"),
    DEPT("dept"),
    DIRECTION("direction"),
    FUNCTION("function"),
    TEAM("team");

    private final String type;

    DeptOrgTypeEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static boolean isValid(String type) {
        return Arrays.stream(values()).anyMatch(item -> item.type.equals(type));
    }

    public static String defaultType() {
        return DEPT.type;
    }

}
