From 0a241dd8c42951deb4b9d6a5b215f998f1110f63 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Fri, 17 Apr 2026 08:12:38 +0530 Subject: [PATCH] refactor: restrict agent specializations to about_me_expertise field only --- .../agents/data/models/agent_profile.dart | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/lib/features/agents/data/models/agent_profile.dart b/lib/features/agents/data/models/agent_profile.dart index 11fea66..918fc78 100644 --- a/lib/features/agents/data/models/agent_profile.dart +++ b/lib/features/agents/data/models/agent_profile.dart @@ -153,21 +153,12 @@ class AgentProfile { } /// Get specializations / expertise from field values. - /// Matches web's getExpertiseTags slugs exactly. + /// Strictly reads about_me_expertise only (matches web + admin filter source). List get specializations { final tags = []; - // Must match web's expertiseFieldSlugs exactly (exact match, not contains) - const expertiseSlugs = [ - 'about_me_expertise', - 'expertise_areas', - 'specializations', - 'areas_of_expertise', - 'expertise', - ]; for (final fv in fieldValues) { - final slug = fv.fieldSlug.toLowerCase(); - if (!expertiseSlugs.contains(slug)) continue; + if (fv.fieldSlug.toLowerCase() != 'about_me_expertise') continue; if (fv.jsonValue is List) { for (final v in (fv.jsonValue as List)) { @@ -187,16 +178,6 @@ class AgentProfile { } } - // Add from legacy specializations array - for (final spec in legacySpecializations) { - if (spec.isNotEmpty && !tags.contains(spec)) tags.add(spec); - } - - // Add from languages array - for (final lang in languages) { - if (lang.isNotEmpty && !tags.contains(lang)) tags.add(lang); - } - return tags; }