Skip to content

Commit

Permalink
HCMPRE-2212 making facilityId in plan search a set for multiple drop …
Browse files Browse the repository at this point in the history
…down search, changes filterMap signature.
  • Loading branch information
Priyanka-eGov committed Jan 27, 2025
1 parent 7ade1ec commit 1e2505b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,31 +253,31 @@ public void enrichSearchRequest(PlanSearchRequest planSearchRequest) {
PlanSearchCriteria planSearchCriteria = planSearchRequest.getPlanSearchCriteria();

// Filter map for filtering plan metadata present in additional details
Map<String, String> filtersMap = new LinkedHashMap<>();
Map<String, Set<String>> filtersMap = new LinkedHashMap<>();

// Add facility id as a filter if present in search criteria
if (!ObjectUtils.isEmpty(planSearchCriteria.getFacilityId())) {
filtersMap.put(FACILITY_ID_SEARCH_PARAMETER_KEY, planSearchCriteria.getFacilityId());
if (!ObjectUtils.isEmpty(planSearchCriteria.getFacilityIds())) {
filtersMap.put(FACILITY_ID_SEARCH_PARAMETER_KEY, planSearchCriteria.getFacilityIds());
}

// Add terrain as a filter if present in search criteria
if (!ObjectUtils.isEmpty(planSearchCriteria.getTerrain())) {
filtersMap.put(TERRAIN_CONDITION_SEARCH_PARAMETER_KEY, planSearchCriteria.getTerrain());
filtersMap.put(TERRAIN_CONDITION_SEARCH_PARAMETER_KEY, Collections.singleton(planSearchCriteria.getTerrain()));
}

// Add onRoadCondition as a filter if present in search criteria
if (!ObjectUtils.isEmpty(planSearchCriteria.getOnRoadCondition())) {
filtersMap.put(ROAD_CONDITION_SEARCH_PARAMETER_KEY, planSearchCriteria.getOnRoadCondition());
filtersMap.put(ROAD_CONDITION_SEARCH_PARAMETER_KEY, Collections.singleton(planSearchCriteria.getOnRoadCondition()));
}

// Add securityQ1 as a filter if present in search criteria
if (!ObjectUtils.isEmpty(planSearchCriteria.getSecurityQ1())) {
filtersMap.put(SECURITY_Q1_SEARCH_PARAMETER_KEY, planSearchCriteria.getSecurityQ1());
filtersMap.put(SECURITY_Q1_SEARCH_PARAMETER_KEY, Collections.singleton(planSearchCriteria.getSecurityQ1()));
}

// Add securityQ2 as a filter if present in search criteria
if (!ObjectUtils.isEmpty(planSearchCriteria.getSecurityQ2())) {
filtersMap.put(SECURITY_Q2_SEARCH_PARAMETER_KEY, planSearchCriteria.getSecurityQ2());
filtersMap.put(SECURITY_Q2_SEARCH_PARAMETER_KEY, Collections.singleton(planSearchCriteria.getSecurityQ2()));
}

if(!CollectionUtils.isEmpty(filtersMap))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class PlanSearchCriteria {
@JsonProperty("planConfigurationId")
private String planConfigurationId = null;

@JsonProperty("facilityId")
private String facilityId = null;
@JsonProperty("facilityIds")
private Set<String> facilityIds = null;

@JsonProperty("onRoadCondition")
private String onRoadCondition = null;
Expand Down Expand Up @@ -72,6 +72,6 @@ public class PlanSearchCriteria {
private Integer limit = null;

@JsonIgnore
private Map<String, String> filtersMap = null;
private Map<String, Set<String>> filtersMap = null;

}

0 comments on commit 1e2505b

Please sign in to comment.