public function setNewPasswordForValidUser(ResetTokenDto $resetTokenDto)
 {
     ResultHelper::whenEmpty($resetTokenDto->getToken(), AppLabelUtil::$ERROR_RESET_TOKEN_INCOMPLETE, HttpStatusCode::badRequest());
     ResultHelper::whenEmpty($resetTokenDto->getUserName(), AppLabelUtil::$ERROR_RESET_TOKEN_INCOMPLETE, HttpStatusCode::badRequest());
     ResultHelper::whenEmpty($resetTokenDto->getPassword(), AppLabelUtil::$ERROR_RESET_TOKEN_INCOMPLETE, HttpStatusCode::badRequest());
     $user = $this->userService->getUserByUserName($resetTokenDto->getUserName());
     ResultHelper::whenEmpty($user, AppLabelUtil::$ERROR_RESET_TOKEN_INVALID, HttpStatusCode::badRequest());
     $validationToken = $this->restTokenService->getResetTokenByUserId($user->getId(), $resetTokenDto->getToken());
     ResultHelper::whenEmpty($validationToken, AppLabelUtil::$ERROR_RESET_TOKEN_INVALID, HttpStatusCode::unauthorized());
     $result = $this->userService->setNewPassWordForUserId($user->getId(), $resetTokenDto->getPassword());
     ResultHelper::whenEmpty($result, AppLabelUtil::$ERROR_RESET_TOKEN_INVALID, HttpStatusCode::unauthorized());
     $this->restTokenService->removeResetTokenOfUser($user->getId());
 }
 /**
  * @param resetTokenDto ResetTokenDto
  * @return ResetToken
  */
 public function mapResetTokenDtoToResetToken(ResetTokenDto $resetTokenDto)
 {
     $resetToken = new ResetToken();
     $resetToken->setId($resetTokenDto->getId());
     $resetToken->setUserId($resetTokenDto->getUserId());
     $resetToken->setToken($resetTokenDto->getToken());
     return $resetToken;
 }