Merge pull request #13719 from FabioBentoLuiz/fix/es-userutility
Event Sourcing - Recreate user with id from the UserCreatedEvent instead of creating a new one
This commit is contained in:
commit
75da1d17c6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue