pub fn parse_enum_value<T>( value: &str, valid_variants: &[&str], ) -> Result<T, String>where T: FromStr + Display,
Parse a simple enum value (case-insensitive) and return the matched variant