package kz.konturai.parser.model;

public enum DetailLevel {
    КРАТКО("Кратко"),
    СТАНДАРТНО("Стандартно"),
    ПОДРОБНО("Подробно");

    private final String displayName;

    DetailLevel(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayName() {
        return displayName;
    }

    public static DetailLevel fromString(String value) {
        if (value == null) {
            return null;
        }
        try {
            return DetailLevel.valueOf(value.toUpperCase());
        } catch (IllegalArgumentException e) {
            // Try to match by display name
            for (DetailLevel level : DetailLevel.values()) {
                if (level.getDisplayName().equalsIgnoreCase(value) ||
                        level.name().equalsIgnoreCase(value)) {
                    return level;
                }
            }
            return null;
        }
    }
}

