Interface UserService

All Known Implementing Classes:
UserServiceImpl

public interface UserService
  • Method Details

    • getActualLoginUser

      UserDto getActualLoginUser(String token)
      Retrieves the currently logged-in user's details based on the provided token.
      Parameters:
      token - Authentication token of the current user
      Returns:
      UserDto containing information about the logged-in user
    • getUserById

      UserDto getUserById(Long id)
      Retrieves a user by their unique ID.
      Parameters:
      id - The ID of the user to retrieve
      Returns:
      UserDto representing the user with the given ID
    • createUser

      Long createUser(CreateUserDto createUserDto)
      Creates a new user in the system.
      Parameters:
      createUserDto - DTO containing details of the user to create
      Returns:
      The ID of the newly created user
    • getUsers

      List<UserDto> getUsers(UserSpecificationDto userSpecificationDto)
      Retrieves a list of users matching the specified criteria.
      Parameters:
      userSpecificationDto - DTO containing user filter criteria
      Returns:
      List of UserDto matching the criteria
    • activateUser

      Long activateUser(UserActivationTokenDto userActivationTokenDto)
      Activates a user account using the provided activation token.
      Parameters:
      userActivationTokenDto - DTO containing the activation token
      Returns:
      The ID of the activated user
    • getActualLoginRole

      Role getActualLoginRole(String token)
      Retrieves the role of the currently logged-in user based on the token.
      Parameters:
      token - Authentication token of the current user
      Returns:
      Role of the logged-in user
    • refreshVerificationEmailToken

      Long refreshVerificationEmailToken(EmailDto emailDto)
      Refreshes the email verification token for a user.
      Parameters:
      emailDto - DTO containing the user's email
      Returns:
      The ID of the user whose verification email token was refreshed
    • changePassword

      Long changePassword(ChangePasswordDto changePasswordDto, String token)
      Changes the password of the currently authenticated user.
      Parameters:
      changePasswordDto - DTO containing current and new password details
      token - Authentication token of the current user
      Returns:
      The ID of the user whose password was changed
    • lostPassword

      Long lostPassword(EmailDto emailDto)
      Initiates a lost password process for a user by their email.
      Parameters:
      emailDto - DTO containing the user's email
      Returns:
      The ID of the user who requested password recovery
    • newPassword

      Long newPassword(NewPasswordDto newPasswordDto)
      Sets a new password for a user using a verification token.
      Parameters:
      newPasswordDto - DTO containing the new password and verification token
      Returns:
      The ID of the user whose password was reset
    • changeEmail

      Long changeEmail(NewEmailDto newEmailDto, String token)
      Changes the email address of the currently authenticated user.
      Parameters:
      newEmailDto - DTO containing current password and new email
      token - Authentication token of the current user
      Returns:
      The ID of the user whose email was changed
    • updateUser

      Long updateUser(UpdateUserDto updateUserDto)
      Updates user details such as role and holiday hours.
      Parameters:
      updateUserDto - DTO containing updated user information
      Returns:
      The ID of the updated user
    • deleteUser

      Long deleteUser(String token)
      Deletes the currently logged-in user (soft delete). Admin users cannot be deleted.
      Parameters:
      token - Authentication token of the current user
      Returns:
      The ID of the deleted user
    • deleteUser

      Long deleteUser(Long userId, String token)
      Deletes a user by ID if the currently logged-in user has admin privileges.
      Parameters:
      userId - The ID of the user to delete
      token - Authentication token of the current user
      Returns:
      The ID of the deleted user