execute
open override fun execute(user: User, credentials: UserCredentials): RegisterUser.Companion.RegisterUserResult
Executes the user registration process.
This method checks if a user with the given ID already exists. If the user is not registered, it saves the user and their credentials into the respective repositories. If an error occurs during the process, it returns a failure result.
Return
A RegisterUserResult indicating the outcome of the registration process:
UserIsAlreadyRegisteredif the user already exists.Successif the user and credentials are successfully saved.Failureif an error occurs during the process.
Parameters
user
The user entity to be registered.
credentials
The credentials associated with the user.