Class InternalUserService

java.lang.Object
app.YUP.service.InternalUserService

@Service public class InternalUserService extends Object
Service class for managing internal users.
  • Constructor Details

    • InternalUserService

      public InternalUserService()
  • Method Details

    • createInternalUser

      public void createInternalUser(RegistrationRequest registrationRequest)
      Creates a new internal user in the system.
      Parameters:
      registrationRequest - the user dto to create
    • changePassword

      public void changePassword(ChangePasswordRequest changePasswordRequest, InternalUser internalUser)
      Changes the password of an internal user.
      Parameters:
      changePasswordRequest - the request containing the old and new passwords
      internalUser - the internal user whose password needs to be changed
      Throws:
      InvalidParameterException - if the old password is incorrect or the new password does not meet the requirements
    • getUserById

      public InternalUser getUserById(String userId)
      Retrieves a user by their userId.
      Parameters:
      userId - the userId of the user to retrieve
      Returns:
      the user with the given userId
      Throws:
      ResourceNotFoundException - if the user is not found
    • existsById

      public boolean existsById(String userId)
      Checks if a user with the given userId exists in the system.
      Parameters:
      userId - the userId of the user to check
      Returns:
      true if the user exists, false otherwise
    • isValidCaptcha

      public boolean isValidCaptcha(String captcha)
      Check if captcha is valid.
      Parameters:
      captcha - the captcha response
      Returns:
      true if the captcha is valid, false otherwise
      Throws:
      CaptchaNotValidException - if the captcha validation fails