Package app.YUP.service
Class InternalUserService
java.lang.Object
app.YUP.service.InternalUserService
Service class for managing internal users.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangePassword(ChangePasswordRequest changePasswordRequest, InternalUser internalUser) Changes the password of an internal user.voidcreateInternalUser(RegistrationRequest registrationRequest) Creates a new internal user in the system.booleanexistsById(String userId) Checks if a user with the given userId exists in the system.getUserById(String userId) Retrieves a user by their userId.booleanisValidCaptcha(String captcha) Check if captcha is valid.
-
Constructor Details
-
InternalUserService
public InternalUserService()
-
-
Method Details
-
createInternalUser
Creates a new internal user in the system.- Parameters:
registrationRequest- the user dto to create
-
changePassword
Changes the password of an internal user.- Parameters:
changePasswordRequest- the request containing the old and new passwordsinternalUser- 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
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
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
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
-