package com.icomsys.main_vm.common.code.enumresource;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ScenarioNodeType {
    Intent("INTENT"),
    Speak("SPEAK"),
    Slot("SLOT"),
    Split("SPLIT"),
    API("API"),
    Common("COMMON"),
    Function("FUNCTION"),
    Call("CALL"),
    IN("IN"),
    OUT("OUT"),
    HORIZONTALCONTAINER("HORIZONTALCONTAINER"),
    VERTICALCONTAINER("VERTICALCONTAINER"),
    NotDefine("NOT_DEFINE");

    private final String name;

    public static ScenarioNodeType findByName(String nodeName) {
        for(ScenarioNodeType nodeType : ScenarioNodeType.values()) {
            if(nodeType.name.equals(nodeName)) {
                return nodeType;
            }
        }

        return NotDefine;
    }
}
