Get the user id from the original event instead of creating a new oe

This commit is contained in:
Fabio Bento Luiz 2023-03-25 19:57:45 +01:00
parent 750c00416f
commit 21f1631e83
1 changed files with 1 additions and 2 deletions

View File

@ -23,8 +23,7 @@ public class UserUtility {
for (Event event : events) {
if (event instanceof UserCreatedEvent) {
UserCreatedEvent e = (UserCreatedEvent) event;
user = new User(UUID.randomUUID()
.toString(), e.getFirstName(), e.getLastName());
user = new User(e.getUserId(), e.getFirstName(), e.getLastName());
}
if (event instanceof UserAddressAddedEvent) {
UserAddressAddedEvent e = (UserAddressAddedEvent) event;