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

HLM Health-HRMS bug fix, user was set to null in hrms update as the t… #761

Merged
merged 11 commits into from
Jun 4, 2024
Merged
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();
}
kanishq-egov marked this conversation as resolved.
Show resolved Hide resolved

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
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private IndividualRequest mapToIndividualUpdateRequest(Individual individual, Us
.tenantId(userRequest.getUser().getTenantId())
.description(role.getDescription())
.build()).collect(Collectors.toList()))
.userType(UserType.fromValue(userRequest.getUser().getType()))
.userType(individual.getUserDetails().getUserType())
kanishq-egov marked this conversation as resolved.
Show resolved Hide resolved
.build())
.isDeleted(Boolean.FALSE)
.clientAuditDetails(AuditDetails.builder()
Expand Down
Loading