Skip to content

Commit

Permalink
HLM Health-HRMS bug fix, user was set to null in hrms update as the t…
Browse files Browse the repository at this point in the history
…enantid was not provided during internal search
  • Loading branch information
kanishq-egov committed May 31, 2024
1 parent 3c88770 commit 74a1d13
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,18 @@ public Long getPosition() {
*/
public EmployeeResponse update(EmployeeRequest employeeRequest) {
RequestInfo requestInfo = employeeRequest.getRequestInfo();

String tenantId = null;
if (!CollectionUtils.isEmpty(employeeRequest.getEmployees())) {
tenantId = employeeRequest.getEmployees().get(0).getTenantId();
}

List <String> uuidList= new ArrayList<>();
for(Employee employee: employeeRequest.getEmployees()) {
uuidList.add(employee.getUuid());
}
EmployeeResponse existingEmployeeResponse = search(EmployeeSearchCriteria.builder().uuids(uuidList).build(),requestInfo);

EmployeeResponse existingEmployeeResponse = search(EmployeeSearchCriteria.builder().uuids(uuidList).tenantId(tenantId).build(),requestInfo);
List <Employee> existingEmployees = existingEmployeeResponse.getEmployees();
employeeRequest.getEmployees().stream().forEach(employee -> {
enrichUpdateRequest(employee, requestInfo, existingEmployees);
Expand Down

0 comments on commit 74a1d13

Please sign in to comment.