-
-
Save theboreddev/0a99c83d8b76dc4bb3c0d2740638ac47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserService(private val userRepository: UserRepository, private val eventsEngine: UserEventsEngine) { | |
fun create(user: User): User { | |
val savedUser = userRepository.save(user) | |
eventsEngine.send(UserCreated(UUID.randomUUID().toString(), user)) | |
return User.create(savedUser) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment