Interface IUserService

All Superinterfaces:
IGenericService<User,UUID>
All Known Implementing Classes:
UserServiceImpl

public interface IUserService extends IGenericService<User,UUID>
Service interface for managing User entities. Extends IGenericService to inherit common CRUD operations.
See Also:
  • Method Details

    • findByEmail

      User findByEmail(String email)
      Finds a user by their email address.
      Parameters:
      email - The email address of the user - must not be null.
      Returns:
      The User entity if found.
      Throws:
      BadRequestException - if the email is null.
      NotFoundException - if the entity is not found.
    • register

      User register(User user)
      Registers a new User entity in the system.

      This method should be used only after verifying that no existing user has the same email by calling existsByEmail(String email). If a user with the given email already exists, an exception must be thrown before calling this method.

      Parameters:
      user - The user entity to register - must not be null.
      Returns:
      The registered user entity.
      Throws:
      BadRequestException - If the provided user data is null.
    • existsByEmail

      boolean existsByEmail(String email)
      Checks if a user exists by their email address.
      Parameters:
      email - The email address to check - must not be null.
      Returns:
      true if a user with the given email exists, otherwise false.