Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pfm 1419 user search #610

Merged
merged 31 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bc3c95a
Merge pull request #607 from egovernments/debasishchakraborty-egovt-p…
pradeepkumarcm-egov Oct 10, 2023
d8efbbe
PFM-1419 : added change to search user based on role tenantid
Oct 11, 2023
38c64d2
PFM-1419 : added change to search user based on role tenantid
Oct 11, 2023
a83165e
PFM-1419 : added change to search user based on role tenantid
Oct 11, 2023
28aaa5d
PFM-1419 : added change to search user based on role tenantid
Oct 12, 2023
80d93b6
PFM-1419 : added change to search user based on role tenantid
Oct 12, 2023
30fb7f9
PFM-1419 : added change to search user based on role tenantid
Oct 12, 2023
a7dc60b
PFM-1419-Employees search HRMS : added change to search employee base…
Oct 12, 2023
b5fadc0
PFM-1419-Employees search HRMS : added change to search employee base…
Oct 12, 2023
48088cc
PFM-1419-Employees search HRMS : added change to search employee base…
Oct 12, 2023
35cf7c8
PFM-1419-Employees search HRMS : added change to search employee base…
Oct 12, 2023
17cf93f
PFM-1419-Employees search HRMS : added change to search employee base…
Oct 12, 2023
15a5995
PFM-1419-User search : added change to search user based on user rol…
Oct 13, 2023
8c5c9b3
PFM-1419-User search : added change to search user based on user rol…
Oct 13, 2023
e426c46
PFM-1419-User search : added change to Employee search based on user…
Oct 13, 2023
5f4efbe
PFM-1419-User search : added change to Employee search based on user…
Oct 13, 2023
a62c7a5
PFM-1419-User search : added change to Employee search based on user…
Oct 13, 2023
dd2d07b
PFM-1419-User search : added change to Employee search based on user…
Oct 13, 2023
6865753
PFM-1419-User search : added change to Employee count API based on u…
Oct 13, 2023
3aa9929
PFM-1419-User search : added change to Employee count API based on u…
Oct 19, 2023
394b66b
removing size validation
Oct 26, 2023
4b62b2d
Added division wise search
Nov 2, 2023
5cd4320
Added division wise search
Nov 2, 2023
489f99f
Added division wise search
Nov 2, 2023
ef09429
Added logic to allow number to add in tenantid
Nov 3, 2023
95588ec
Added log lines
Nov 7, 2023
70674cf
Removed log lines
Feb 1, 2024
11d9bd4
Removed log lines
Feb 1, 2024
11e5284
Adding default password.
Feb 7, 2024
562d975
removed juristrictionn validation!!
Feb 12, 2024
022ad7b
PFM:1419 : Added chnages to remove log lines and remove hardcoded pas…
Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public class PropertiesManager {

@Value("${egov.user.search.endpoint}")
public String userSearchEndpoint;

@Value("${egov.user.search.tenant.endpoint}")
public String userSearchByTenantEndpoint;


@Value("${egov.user.create.endpoint}")
public String userCreateEndpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class Employee {

@Valid
@NotEmpty
@Size(min = 1,max = 50)
@Size(min = 1,max = 5000)
private List<Jurisdiction> jurisdictions = new ArrayList<>();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

import java.util.*;
import java.util.function.Function;
Expand Down Expand Up @@ -149,6 +150,11 @@ public EmployeeResponse search(EmployeeSearchCriteria criteria, RequestInfo requ
userSearchCriteria.put(HRMSConstants.HRMS_USER_SEARCH_CRITERA_MOBILENO,criteria.getPhone());
if( !CollectionUtils.isEmpty(criteria.getRoles()) )
userSearchCriteria.put(HRMSConstants.HRMS_USER_SEARCH_CRITERA_ROLECODES,criteria.getRoles());
if(!ObjectUtils.isEmpty(criteria.isStateLevelSearch))
userSearchCriteria.put(HRMSConstants.HRMS_IS_STATE_LEVEL_SEARCH_CODE, criteria.getIsStateLevelSearch());
if(!ObjectUtils.isEmpty(criteria.getIsActive()))
userSearchCriteria.put(HRMSConstants.HRMS_IS_ACTIVE_SEARCH_CODE, criteria.getIsActive());
Comment on lines +153 to +156
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of checks for isStateLevelSearch and isActive in the search criteria is crucial for supporting the new search functionalities. However, ensure that the ObjectUtils.isEmpty method is correctly used to check for null or default values, as it might not be the most intuitive choice for boolean fields. Consider using more explicit checks for boolean fields to improve code readability.

- if(!ObjectUtils.isEmpty(criteria.isStateLevelSearch))
+ if(criteria.isStateLevelSearch != null)
- if(!ObjectUtils.isEmpty(criteria.getIsActive()))
+ if(criteria.getIsActive() != null)

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
if(!ObjectUtils.isEmpty(criteria.isStateLevelSearch))
userSearchCriteria.put(HRMSConstants.HRMS_IS_STATE_LEVEL_SEARCH_CODE, criteria.getIsStateLevelSearch());
if(!ObjectUtils.isEmpty(criteria.getIsActive()))
userSearchCriteria.put(HRMSConstants.HRMS_IS_ACTIVE_SEARCH_CODE, criteria.getIsActive());
if(criteria.isStateLevelSearch != null)
userSearchCriteria.put(HRMSConstants.HRMS_IS_STATE_LEVEL_SEARCH_CODE, criteria.getIsStateLevelSearch());
if(criteria.getIsActive() != null)
userSearchCriteria.put(HRMSConstants.HRMS_IS_ACTIVE_SEARCH_CODE, criteria.getIsActive());


UserResponse userResponse = userService.getUser(requestInfo, userSearchCriteria);
userChecked =true;
if(!CollectionUtils.isEmpty(userResponse.getUser())) {
Expand Down Expand Up @@ -228,7 +234,6 @@ private void createUser(Employee employee, RequestInfo requestInfo) {
employee.getUser().setUuid(user.getUuid());
}catch(Exception e) {
log.error("Exception while creating user: ",e);
log.error("request: "+request);
throw new CustomException(ErrorConstants.HRMS_USER_CREATION_FAILED_CODE, ErrorConstants.HRMS_USER_CREATION_FAILED_MSG);
}

Expand All @@ -245,6 +250,7 @@ private void enrichUser(Employee employee) {
pwdParams.add(employee.getUser().getMobileNumber());
pwdParams.add(employee.getTenantId());
pwdParams.add(employee.getUser().getName().toUpperCase());
//TODO:Add localition of sms and add template to register SMS
employee.getUser().setPassword(hrmsUtils.generatePassword(pwdParams));
employee.getUser().setUserName(employee.getCode());
employee.getUser().setActive(true);
Expand Down Expand Up @@ -354,7 +360,6 @@ private void updateUser(Employee employee, RequestInfo requestInfo) {
userService.updateUser(request);
}catch(Exception e) {
log.error("Exception while updating user: ",e);
log.error("request: "+request);
throw new CustomException(ErrorConstants.HRMS_USER_UPDATION_FAILED_CODE, ErrorConstants.HRMS_USER_UPDATION_FAILED_MSG);
}

Expand Down Expand Up @@ -561,4 +566,77 @@ public Map<String,Object> getEmployeeCountResponse(RequestInfo requestInfo, Stri
return response;
}

public Map<String,Object> getEmployeeCountResponseV1(RequestInfo requestInfo, List<String> roles, String tenantId, boolean isStateLevelSearch){
EmployeeSearchCriteria activeEmployeeCriteria= EmployeeSearchCriteria.builder().roles(roles).tenantId(tenantId).isStateLevelSearch(isStateLevelSearch).isActive(true).build();
EmployeeResponse activeEmployeeResponse = search(activeEmployeeCriteria, requestInfo);
EmployeeSearchCriteria inActiveEmployeeCriteria= EmployeeSearchCriteria.builder().roles(roles).tenantId(tenantId).isStateLevelSearch(isStateLevelSearch).isActive(false).build();
EmployeeResponse inActiveEmployeeResponse = search(inActiveEmployeeCriteria, requestInfo);
Integer activeEmployeeCount= activeEmployeeResponse.getEmployees().size();
Integer inActiveEmployeeCount = inActiveEmployeeResponse.getEmployees().size();
Integer totalcount = activeEmployeeCount + inActiveEmployeeCount;
Map<String,String> results = new HashMap<>();
Map<String,Object> response = new HashMap<>();
ResponseInfo responseInfo = factory.createResponseInfoFromRequestInfo(requestInfo, true);

response.put("ResponseInfo",responseInfo);

if(totalcount == 0){
Map<String,String> error = new HashMap<>();
error.put("NO_RECORDS","No records found for the tenantId: "+tenantId);
throw new CustomException(error);
}
results.put("totalEmployee",totalcount.toString());
results.put("activeEmployee",activeEmployeeCount.toString());
results.put("inactiveEmployee",inActiveEmployeeCount.toString());

response.put("EmployeCount",results);
return response;
}
Comment on lines +569 to +594
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getEmployeeCountResponseV1 method is a significant addition that calculates employee counts based on different criteria. This method is well-structured and aligns with the PR's objectives. However, consider handling the potential CustomException more gracefully by providing more detailed error messages or alternative solutions when no records are found. This can enhance the user experience by offering clearer guidance on what actions to take next.


public EmployeeResponse searchListOfEmployee(EmployeeSearchCriteria criteria, RequestInfo requestInfo) {
boolean userChecked = false;
/*if(null == criteria.getIsActive() || criteria.getIsActive())
criteria.setIsActive(true);
else
criteria.setIsActive(false);*/
Map<String, User> mapOfUsers = new HashMap<String, User>();
if((!CollectionUtils.isEmpty(criteria.getRoles())) && !CollectionUtils.isEmpty(criteria.getTenantIds())) {
Map<String, Object> userSearchCriteria = new HashMap<>();
userSearchCriteria.put(HRMSConstants.HRMS_USER_SEARCH_CRITERA_TENANTIDS,criteria.getTenantIds());
if( !CollectionUtils.isEmpty(criteria.getRoles()) )
userSearchCriteria.put(HRMSConstants.HRMS_USER_SEARCH_CRITERA_ROLECODES,criteria.getRoles());
UserResponse userResponse = userService.getUserByTenantids(requestInfo, userSearchCriteria);
userChecked =true;
if(!CollectionUtils.isEmpty(userResponse.getUser())) {
mapOfUsers.putAll(userResponse.getUser().stream()
.collect(Collectors.toMap(User::getUuid, Function.identity())));
}
List<String> userUUIDs = userResponse.getUser().stream().map(User :: getUuid).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(criteria.getUuids()))
criteria.setUuids(criteria.getUuids().stream().filter(userUUIDs::contains).collect(Collectors.toList()));
else
criteria.setUuids(userUUIDs);
}
//checks if above criteria met and result is not null will check for name search if list of names are given as user search on name is not bulk api
List <Employee> employees = new ArrayList<>();
employees = repository.fetchEmployees(criteria, requestInfo);
List<String> uuids = employees.stream().map(Employee :: getUuid).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(uuids)){
Map<String, Object> UserSearchCriteria = new HashMap<>();
UserSearchCriteria.put(HRMSConstants.HRMS_USER_SEARCH_CRITERA_UUID,uuids);
if(mapOfUsers.isEmpty()){
UserResponse userResponse = userService.getUser(requestInfo, UserSearchCriteria);
if(!CollectionUtils.isEmpty(userResponse.getUser())) {
mapOfUsers = userResponse.getUser().stream()
.collect(Collectors.toMap(User :: getUuid, Function.identity()));
}
}
for(Employee employee: employees){
employee.setUser(mapOfUsers.get(employee.getUuid()));
}
}
return EmployeeResponse.builder().responseInfo(factory.createResponseInfoFromRequestInfo(requestInfo, true))
.employees(employees).build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public class UserService {
@Value("${egov.user.search.endpoint}")
private String userSearchEndpoint;

@Value("${egov.user.search.tenant.endpoint}")
private String userSearchByTenantEndpoint;

@Value("${egov.user.update.endpoint}")
private String userUpdateEndpoint;

Expand Down Expand Up @@ -124,6 +127,22 @@ public UserResponse getUser(RequestInfo requestInfo, Map<String, Object> UserSea

return userResponse;
}
public UserResponse getUserByTenantids(RequestInfo requestInfo, Map<String, Object> UserSearchCriteria ) {
StringBuilder uri = new StringBuilder();
Map<String, Object> userSearchReq = new HashMap<>();
userSearchReq.put(HRMSConstants.HRMS_USER_SERACH_CRITERIA_USERTYPE_CODE,HRMSConstants.HRMS_USER_SERACH_CRITERIA_USERTYPE);
for( String key: UserSearchCriteria.keySet())
userSearchReq.put(key, UserSearchCriteria.get(key));
uri.append(propertiesManager.getUserHost()).append(propertiesManager.getUserSearchByTenantEndpoint());
UserResponse userResponse = new UserResponse();
try {
userResponse = userCall(userSearchReq,uri);
}catch(Exception e) {
log.error("User search failed: ",e);
}

return userResponse;
}


/**
Expand All @@ -135,7 +154,7 @@ public UserResponse getUser(RequestInfo requestInfo, Map<String, Object> UserSea
@SuppressWarnings("all")
private UserResponse userCall(Object userRequest, StringBuilder uri) {
String dobFormat = null;
if(uri.toString().contains(userSearchEndpoint) || uri.toString().contains(userUpdateEndpoint))
if(uri.toString().contains(userSearchEndpoint) || uri.toString().contains(userUpdateEndpoint) || uri.toString().contains(userSearchByTenantEndpoint))
dobFormat="yyyy-MM-dd";
else if(uri.toString().contains(userCreateEndpoint))
dobFormat = "dd/MM/yyyy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ public class HRMSConstants {
public static final String HRMS_MDMS_HR_MASTERS_CODE = "egov-hrms";
public static final String HRMS_AC_ROLES_MASTERS_CODE = "ACCESSCONTROL-ROLES";
public static final String HRMS_MDMS_EGOV_LOCATION_MASTERS_CODE = "egov-location";

public static final String HRMS_IS_STATE_LEVEL_SEARCH_CODE = "isStateLevelSearch";

public static final String HRMS_IS_ACTIVE_SEARCH_CODE="active";

public static final String HRMS_MDMS_DEPT_CODE = "Department";
public static final String HRMS_MDMS_DESG_CODE = "Designation";
Expand Down Expand Up @@ -41,6 +45,7 @@ public class HRMSConstants {
public static final String HRMS_USER_SEARCH_CRITERA_UUID = "uuid";
public static final String HRMS_USER_SEARCH_CRITERA_ROLECODES = "roleCodes";
public static final String HRMS_USER_SEARCH_CRITERA_TENANTID = "tenantId";
public static final String HRMS_USER_SEARCH_CRITERA_TENANTIDS = "tenantIds";
public static final String HRMS_USER_SEARCH_CRITERA_MOBILENO = "mobileNumber";
public static final String HRMS_USER_SEARCH_CRITERA_NAME = "name";
public static final String HRMS_USER_SEARCH_CRITERA_USERNAME = "UserName";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.egov.hrms.web.contract;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.egov.common.contract.request.RequestInfo;
import org.egov.hrms.model.Employee;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

@Validated
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeSearchByTenantRequestWrapper {
@NotNull
@JsonProperty("RequestInfo")
private RequestInfo requestInfo;

@Valid
@JsonProperty("criteria")
private EmployeeSearchCriteria criteria;

}


Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ public class EmployeeSearchCriteria {

public Boolean isActive;

public Boolean isStateLevelSearch;

@Size(max = 250)
public String tenantId;

public List<String> tenantIds;
Comment on lines +50 to +55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of isStateLevelSearch and tenantIds fields enhances search capabilities. However, consider adding validation annotations (e.g., @NotNull for isStateLevelSearch, @NotEmpty for tenantIds) to ensure these fields are used correctly. Also, review the isCriteriaEmpty method to account for these new fields.

@NotNull
public Boolean isStateLevelSearch;

@NotEmpty
public List<String> tenantIds;


public String phone;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
import lombok.extern.slf4j.Slf4j;
import org.egov.common.contract.request.RequestInfo;
import org.egov.hrms.service.EmployeeService;
import org.egov.hrms.web.contract.EmployeeRequest;
import org.egov.hrms.web.contract.EmployeeResponse;
import org.egov.hrms.web.contract.EmployeeSearchCriteria;
import org.egov.hrms.web.contract.RequestInfoWrapper;
import org.egov.hrms.web.contract.*;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using wildcard imports (import org.egov.hrms.web.contract.*;) can lead to namespace pollution and make it harder to identify where specific classes are coming from. Consider importing only the classes that are actually used.

import org.egov.hrms.web.validator.EmployeeValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
Expand All @@ -56,6 +53,7 @@

import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
Expand Down Expand Up @@ -120,6 +118,14 @@ public ResponseEntity<?> search(@RequestBody @Valid RequestInfoWrapper requestIn
return new ResponseEntity<>(employeeResponse,HttpStatus.OK);
}

@PostMapping(value = "/_searchListOfEmployee")
@ResponseBody
public ResponseEntity<?> _searchListOfEmployee(@RequestBody @Valid EmployeeSearchByTenantRequestWrapper employeeSearchByTenantRequestWrapper) {
EmployeeResponse employeeResponse = employeeService.searchListOfEmployee(employeeSearchByTenantRequestWrapper.getCriteria(), employeeSearchByTenantRequestWrapper.getRequestInfo());
return new ResponseEntity<>(employeeResponse,HttpStatus.OK);
}


@PostMapping("_count")
@ResponseBody
private ResponseEntity<?> count(@RequestParam("tenantId") String tenantId, @RequestBody RequestInfo requestInfo) {
Expand All @@ -130,5 +136,15 @@ private ResponseEntity<?> count(@RequestParam("tenantId") String tenantId, @Requ
return new ResponseEntity<>(response,HttpStatus.OK);
}

@PostMapping("v1/_count")
@ResponseBody
private ResponseEntity<?> countV1(@RequestParam("tenantId") String tenantId, @RequestParam("roles") List<String> roles , @RequestParam("isStateLevelSearch") boolean isStateLevelSearch, @RequestBody RequestInfo requestInfo) {

Map<String,Object> response = new HashMap<>();
validator.validateEmployeeCountRequest(tenantId);
response = employeeService.getEmployeeCountResponseV1(requestInfo,roles,tenantId,isStateLevelSearch);
return new ResponseEntity<>(response,HttpStatus.OK);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void validateMdmsData(Employee employee, Map<String, String> errorMap, M
validateEmployee(employee, errorMap, mdmsData);
validateAssignments(employee, errorMap, mdmsData);
validateServiceHistory(employee, errorMap, mdmsData);
validateJurisdicton(employee, errorMap, mdmsData, boundaryMap);
//validateJurisdicton(employee, errorMap, mdmsData, boundaryMap);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting out the call to validateJurisdicton in the validateMdmsData method removes jurisdiction-related validation. Ensure that this change aligns with the new requirements and does not inadvertently bypass necessary validation checks that could lead to inconsistent or invalid data being processed.

validateEducationalDetails(employee, errorMap, mdmsData);
validateDepartmentalTest(employee, errorMap, mdmsData);
}
Expand All @@ -251,7 +251,7 @@ private void validateMdmsData(Employee employee, Map<String, String> errorMap, M
public void validateDataConsistency(Employee employee, Map<String, String> errorMap, Map<String, List<String>> mdmsData, Employee existingEmp, RequestInfo requestInfo) {
validateUserData(existingEmp,employee,errorMap, requestInfo);
validateConsistencyAssignment(existingEmp,employee,errorMap);
validateConsistencyJurisdiction(existingEmp,employee,errorMap);
//validateConsistencyJurisdiction(existingEmp,employee,errorMap);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, commenting out the call to validateConsistencyJurisdiction in the validateDataConsistency method skips checks for jurisdiction consistency during data updates. This could potentially allow for jurisdiction data inconsistencies if not handled elsewhere. Confirm that this change is intentional and that consistency checks are performed through other means if necessary.

validateConsistencyDepartmentalTest(existingEmp,employee,errorMap);
validateConsistencyEducationalDetails(existingEmp,employee,errorMap);
validateConsistencyServiceHistory(existingEmp, employee, errorMap);
Expand Down Expand Up @@ -465,12 +465,15 @@ private void validateJurisdicton(Employee employee, Map<String, String> errorMap
List<String> hierarchyTypes = JsonPath.read(boundaryMap,hierarchy_type_path);
List <String> boundaryTypes = JsonPath.read(boundaryMap,boundary_type_path);
List <String> boundaryValues = JsonPath.read(boundaryMap,boundary_value_path);
if(!hierarchyTypes.contains(jurisdiction.getHierarchy()))
if(!hierarchyTypes.contains(jurisdiction.getHierarchy())) {
errorMap.put(ErrorConstants.HRMS_INVALID_JURISDICTION_HEIRARCHY_CODE, ErrorConstants.HRMS_INVALID_JURISDICTION_HEIRARCHY_MSG);
if(!boundaryTypes.contains(jurisdiction.getBoundaryType()))
}
if(!boundaryTypes.contains(jurisdiction.getBoundaryType())) {
errorMap.put(ErrorConstants.HRMS_INVALID_JURISDICTION_BOUNDARY_TYPE_CODE, ErrorConstants.HRMS_INVALID_JURISDICTION_BOUNDARY_TYPE_MSG);
if(!boundaryValues.contains(jurisdiction.getBoundary()))
}
if(!boundaryValues.contains(jurisdiction.getBoundary())) {
errorMap.put(ErrorConstants.HRMS_INVALID_JURISDICTION_BOUNDARY_CODE, ErrorConstants.HRMS_INVALID_JURISDICTION_BOUNDARY_MSG);
}
Comment on lines +468 to +476
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The adjustments within the validateJurisdicton method, although the method itself is commented out, show an attempt to refine boundary checks. If re-enabling this validation in the future, ensure that these boundary checks are thoroughly tested to prevent any false negatives or positives in jurisdiction validation.

Consider revising the approach to jurisdiction validation to ensure it is both efficient and comprehensive, covering all necessary boundary and hierarchy checks without introducing performance bottlenecks.

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ egov.services.data_sync_employee.required = false
egov.mdms.host=https://dev.digit.org
egov.mdms.search.endpoint=/egov-mdms-service/v1/_search
#egov.mdms.search.endpoint=/egov-mdms-service-test/v1/_search
egov.mdms.search.endpoint.old= /egov-mdms-service/v1/_search
egov.mdms.host.old=https://dev.digit.org

#filestore urls
egov.filestore.host=https://dev.digit.org
Expand All @@ -48,6 +50,7 @@ egov.environment.domain=https://dev.digit.org/
#user
egov.user.host=https://dev.digit.org
egov.user.search.endpoint=/user/v1/_search
egov.user.search.tenant.endpoint=/user/_searchByTenant
egov.user.create.endpoint=/user/users/_createnovalidate
egov.user.update.endpoint=/user/users/_updatenovalidate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class UserServiceConstants {
public static final String PATTERN_GENDER = "^[a-zA-Z ]*$";
public static final String PATTERN_MOBILE = "(^$|[0-9]{10})";
public static final String PATTERN_CITY = "^[a-zA-Z. ]*$";
public static final String PATTERN_TENANT = "^[a-zA-Z. ]*$";
public static final String PATTERN_TENANT = "^[a-zA-Z.0-9 ]*$";
public static final String PATTERN_PINCODE = "^[1-9][0-9]{5}$";
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class UserSearchCriteria {
private List<String> sort;
private UserType type;
private String tenantId;
private List<String> tenantIds;
private Boolean isStateLevelSearch;
private List<String> roleCodes;

public void validate(boolean isInterServiceCall) {
Expand Down
Loading