Skip to content

Commit

Permalink
Adding security details in plan additional details
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishi-egov committed Jan 7, 2025
1 parent 661ffdf commit ef35a3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class ServiceConstants {
public static final String DOT_SEPARATOR = ".";
public static final String MICROPLAN_PREFIX = "MP-";
public static final String ACCESSIBILITY_DETAILS = "accessibilityDetails";
public static final String SECURITY_DETAILS = "securityDetails";

//MDMS field Constants
public static final String DATA = "data";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,19 @@ private Object enrichAdditionalDetials(Map<String, Object> BCodeToCensusAddition
// Extract required details from census additional details object.
String facilityName = (String) parsingUtil.extractFieldsFromJsonObject(censusAdditionalDetails, FACILITY_NAME);
Object accessibilityDetails = (Object) parsingUtil.extractFieldsFromJsonObject(censusAdditionalDetails, ACCESSIBILITY_DETAILS);
Object securityDetials = (Object) parsingUtil.extractFieldsFromJsonObject(censusAdditionalDetails, SECURITY_DETAILS);

// Creating a map of fields to be added in plan additional details with their key.
Map<String, Object> fieldsToBeUpdated = new HashMap<>();
if(facilityName != null && !facilityName.isEmpty())
fieldsToBeUpdated.put(FACILITY_NAME, facilityName);

if(accessibilityDetails != null)
fieldsToBeUpdated.put(ACCESSIBILITY_DETAILS, accessibilityDetails);

if(securityDetials != null)
fieldsToBeUpdated.put(SECURITY_DETAILS, securityDetials);

if(!CollectionUtils.isEmpty(fieldsToBeUpdated))
return parsingUtil.updateFieldInAdditionalDetails(new Object(), fieldsToBeUpdated);
}
Expand Down

0 comments on commit ef35a3a

Please sign in to comment.