Skip to content

Commit

Permalink
[SELC-6087] fix findMailUuidAndUpdateUserRegistry method to retrieve …
Browse files Browse the repository at this point in the history
…workContact id
  • Loading branch information
flaminiaScarciofolo committed Nov 29, 2024
1 parent ad4e2db commit 993de8e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/user-ms/src/main/docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@
"type" : "string"
},
"mobilePhone" : {
"pattern" : "^\\+?[0-9]{9,15}$",
"pattern" : "^\\+?[0-9]{7,15}$",
"type" : "string"
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user-ms/src/main/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ components:
email:
type: string
mobilePhone:
pattern: "^\\+?[0-9]{9,15}$"
pattern: "^\\+?[0-9]{7,15}$"
type: string
User:
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public class UpdateUserRequest {
private String name;
private String familyName;
private String email;
@Pattern(regexp = "^\\+?[0-9]{9,15}$", message = "Il numero di telefono non è valido")
@Pattern(regexp = "^\\+?[0-9]{7,15}$", message = "Il numero di telefono non è valido")
private String mobilePhone;
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ private Uni<String> findMailUuidAndUpdateUserRegistry(UserResource userResource,
.filter(stringWorkContactResourceEntry -> existsWorkContactResourceForPhoneAndMail(stringWorkContactResourceEntry, emailToCompare, mobilePhoneToCompare))
.findFirst()
.map(Map.Entry::getKey))
.orElse(null);
.orElse(idContacts);


return updateUsingPATCH(userResource.getId().toString(),
userMapper.toMutableUserFieldsDto(userDto, userResource, idContacts))
.replaceWith(StringUtils.isBlank(existedUserMailUuid) ? idContacts : existedUserMailUuid);
userMapper.toMutableUserFieldsDto(userDto, userResource, existedUserMailUuid))
.replaceWith(existedUserMailUuid);
}

private static boolean existsWorkContactResourceForPhoneAndMail(Map.Entry<String, WorkContactResource> stringWorkContactResourceEntry, String emailToCompare, String mobilePhoneToCompare) {
Expand Down

0 comments on commit 993de8e

Please sign in to comment.