Uses of Class
org.ntnu.idi.idatt2106.sparesti.sparestibackend.model.User
Packages that use User
Package
Description
-
Uses of User in org.ntnu.idi.idatt2106.sparesti.sparestibackend.mapper
Methods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.mapper that return UserModifier and TypeMethodDescriptionRegisterMapper.toEntity
(RegisterRequest request, Role role, String encodedPassword) Maps User register DTO to entityMethods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.mapper with parameters of type UserModifier and TypeMethodDescriptionMaps User entity to DTOMaps from User entity to DTOChallengeMapper.toEntity
(ChallengeCreateDTO challengeCreateDTO, User user) Converts from challenge DTO to entity.GoalMapper.toEntity
(GoalCreateDTO goalDTO, User user) Maps DTO to Goal entityUserMapper.toStreakResponse
(User user, ZonedDateTime firstDue) Maps from User to Streak DTOvoid
UserMapper.updateEntity
(User user, UserUpdateDTO updateDTO, String encodedPassword) Updates User entity from DTO -
Uses of User in org.ntnu.idi.idatt2106.sparesti.sparestibackend.model
Constructors in org.ntnu.idi.idatt2106.sparesti.sparestibackend.model with parameters of type UserModifierConstructorDescriptionAuthenticator
(com.yubico.webauthn.RegistrationResult result, com.yubico.webauthn.data.AuthenticatorAttestationResponse response, User user, String name) Constructs a new Authenticator instance based on the WebAuthn registration result and the attestation response. -
Uses of User in org.ntnu.idi.idatt2106.sparesti.sparestibackend.repository
Methods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.repository that return UserModifier and TypeMethodDescriptionUserRepository.findByHandle
(com.yubico.webauthn.data.ByteArray handle) Finds a user based on their handle, which acts as a unique identifier for the userMethods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.repository that return types with arguments of type UserModifier and TypeMethodDescriptionUserRepository.findByEmail
(String email) Finds a user from a given emailUserRepository.findByUsername
(String username) Finds a user from a given usernameMethods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.repository with parameters of type UserModifier and TypeMethodDescriptionvoid
GoalRepository.deleteByIdAndUser
(Long id, User user) Transactional method used for deleting a goal of a userorg.springframework.data.domain.Page
<Challenge> ChallengeRepository.findAllByCompletedOnIsNotNullAndUser
(User user, org.springframework.data.domain.Pageable pageable) Finds a page of completed saving challenges of a user (completion date is set, therefore not "null")org.springframework.data.domain.Page
<Goal> GoalRepository.findAllByCompletedOnIsNotNullAndUser
(User user, org.springframework.data.domain.Pageable pageable) Finds a page of saving goals of a user that are complete/inactive (completedOn is not null)ChallengeRepository.findAllByCompletedOnIsNullAndUser
(User user) Finds a list of active saving challenges of a user (completion date is not set, therefore "null")org.springframework.data.domain.Page
<Challenge> ChallengeRepository.findAllByCompletedOnIsNullAndUser
(User user, org.springframework.data.domain.Pageable pageable) Finds a page of active saving challenges of a user (completion date is not set, therefore "null")GoalRepository.findAllByCompletedOnIsNullAndUser
(User user) Finds all saving goals of a user that are active (completedOn is null)GoalRepository.findAllByCompletedOnIsNullAndUserOrderByPriorityAsc
(User user) Finds all saving goals of a user that are active (completedOn is null), sorted by priority, from lowest value (high priority) to highest (low priority)AuthenticatorRepository.findAllByUser
(User user) Finds all biometric entries for a userorg.springframework.data.domain.Page
<Goal> GoalRepository.findAllByUser
(User user, org.springframework.data.domain.Pageable pageable) Finds a page of all saving goal entities of a userChallengeRepository.findByIdAndUser
(Long id, User user) Gets an Optional object, wrapped around either a saving challenge of a user, if it exists, or nothing.GoalRepository.findByIdAndUser
(Long id, User user) Finds the goal of a user specified by its id, wrapped by an Optional object.org.springframework.data.domain.Page
<Challenge> ChallengeRepository.findByUser
(User user, org.springframework.data.domain.Pageable pageable) Gets a page of saving challenges of a user.void
AuthenticatorRepository.removeAllByUser
(User user) Transactional statement used when removing all biometric entries of a user. -
Uses of User in org.ntnu.idi.idatt2106.sparesti.sparestibackend.service
Methods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.service that return UserModifier and TypeMethodDescriptionUserService.findUserByEmail
(String email) Find user by their emailUserService.findUserByUsername
(String username) Finds a user from a given username.Persists a user entityMethods in org.ntnu.idi.idatt2106.sparesti.sparestibackend.service with parameters of type UserModifier and TypeMethodDescriptionChallengeService.completeChallenge
(Long challengeId, User user) Marks a challenge as completed, updates user statistics such as saved amounts and streaks, and persists these changes to the database.GoalService.completeGoal
(Long goalId, User user) Completes a goal of a user, specified by its IDvoid
ChallengeService.deleteChallenge
(Long challengeId, User user) Deletes a challenge by ID and user, ensuring it is no longer present in the database.void
GoalService.deleteUserGoal
(Long id, User user) Deletes a goal of a user, specified by its IDAccountService.findUserAccounts
(User user) Retrieves the saving and spending accounts associated with the specified user.GoalService.findUserGoal
(Long id, User user) Finds a user's saving goal specified by its IDorg.springframework.data.domain.Page
<ChallengeDTO> ChallengeService.getActiveChallenges
(User user, org.springframework.data.domain.Pageable pageable) Retrieves all active (not completed) challenges for a specific user and paginates the results.GoalService.getActiveUserGoals
(User user) Gets a list of active user goalsChallengeService.getChallenge
(Long challengeId, User user) Retrieves a specific challenge by ID and user.org.springframework.data.domain.Page
<ChallengeDTO> ChallengeService.getChallengesByUser
(User user, org.springframework.data.domain.Pageable pageable) Retrieves all challenges associated with a specific user and paginates the results.org.springframework.data.domain.Page
<ChallengeDTO> ChallengeService.getCompletedChallenges
(User user, org.springframework.data.domain.Pageable pageable) Retrieves all completed challenges for a specific user and paginates the results.org.springframework.data.domain.Page
<GoalResponseDTO> GoalService.getCompletedUserGoals
(User user, org.springframework.data.domain.Pageable pageable) Gets a page of completed user goalsChallengeService.getGeneratedChallenges
(User user) Gets list of generated challengesorg.springframework.data.domain.Page
<GoalResponseDTO> GoalService.getUserGoals
(User user, org.springframework.data.domain.Pageable pageable) Gets a page of a user's saving goalsChallengeService.save
(ChallengeCreateDTO challengeCreateDTO, User user) Creates and persists a new challenge based on provided DTO and user details.GoalService.save
(GoalCreateDTO goalDTO, User user) Saves a goal entity.Persists a user entityAccountService.saveAccount
(AccountDTO accountDTO, User user) Saves a new account based on the provided DTO and associates it with the given user.GoalService.update
(Long id, GoalUpdateDTO goalDTO, User user) Updates a goal of a user, specified by its IDAccountService.updateAccount
(AccountUpdateDTO accountUpdateDTO, User user) Updates an existing account of the specified user based on the provided update DTO.ChallengeService.updateChallenge
(Long id, ChallengeUpdateDTO challengeUpdateDTO, User user) Updates an existing challenge with new data from a provided DTO if the challenge has not been completed.GoalService.updatePriorities
(List<Long> goalIds, User user) Updates the priority ordering of the list of active saving goals of a user