Skip to content

Commit

Permalink
[SELC-4800] hotfix: filter status ACTIVE when retrieve mails (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf committed May 8, 2024
1 parent 65367ff commit b07a69c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ public Uni<Void> updateUserStatusWithOptionalFilter(String userId, String instit
@Override
public Uni<List<String>> getUsersEmails(String institutionId, String productId) {
var userInstitutionFilters = UserInstitutionFilter.builder().institutionId(institutionId).build().constructMap();
var productFilters = OnboardedProductFilter.builder().productId(productId).build().constructMap();
var productFilters = OnboardedProductFilter.builder().productId(productId).status(ACTIVE).build().constructMap();
Multi<UserInstitution> userInstitutions = userInstitutionService.findAllWithFilter(userUtils.retrieveMapForFilter(userInstitutionFilters, productFilters));
return userInstitutions.onItem()
.transformToUni(userInstitution -> userRegistryApi.findByIdUsingGET(WORK_CONTACTS, userInstitution.getUserId())
return userInstitutions
.onItem().transformToUni(userInstitution -> userRegistryApi.findByIdUsingGET(WORK_CONTACTS, userInstitution.getUserId())
.map(userResource -> Objects.nonNull(userResource.getWorkContacts()) && userResource.getWorkContacts().containsKey(userInstitution.getUserMailUuid())
? userResource.getWorkContacts().get(userInstitution.getUserMailUuid()) : null)).merge()
? userResource.getWorkContacts().get(userInstitution.getUserMailUuid()) : null))
.merge()
.filter(workContactResource -> Objects.nonNull(workContactResource) && StringUtils.isNotBlank(workContactResource.getEmail().getValue()))
.map(workContactResource -> workContactResource.getEmail().getValue())
.collect().asList();
Expand Down

0 comments on commit b07a69c

Please sign in to comment.