# Uses of Class
com.plannaplan.entities.User

Packages that use User
Package | Description
--- | ---
com.plannaplan.entities | Provides all entieites that are created in database by Hibernate
com.plannaplan.models | Provides readonly (mostly) classes to keep data for diffrent pourposes
com.plannaplan.repositories | Provides jpa repositories interfaces to comunicate with database.
com.plannaplan.services | Provides service classes to make operations with entities or comunicate with external systems.

## Uses of User in com.plannaplan.entities

Methods in com.plannaplan.entities that return User
Modifier and Type | Method | Description
--- | --- | ---
`User` | Commision.`getCommisionCommiter()` |
`User` | Commision.`getCommisionOwner()` | User of given commision getter

Methods in com.plannaplan.entities that return types with arguments of type User
Modifier and Type | Method | Description
--- | --- | ---
`java.util.Set<User>` | Groups.`getRegisteredStudents()` |

Methods in com.plannaplan.entities with parameters of type User
Modifier and Type | Method | Description
--- | --- | ---
`void` | Groups.`assignUser​(User user)` |

Constructors in com.plannaplan.entities with parameters of type User
Constructor | Description
--- | ---
`Commision​(User user)` |
`Commision​(User user, User commiter)` |

## Uses of User in com.plannaplan.models

Methods in com.plannaplan.models with parameters of type User
Modifier and Type | Method | Description
--- | --- | ---
`void` | EmailExchangesData.`addExchange​(User user, Exchange data)` | method to add user and his event to data to be send

## Uses of User in com.plannaplan.repositories

Methods in com.plannaplan.repositories that return types with arguments of type User
Modifier and Type | Method | Description
--- | --- | ---
`java.util.List<User>` | UserRepository.`getAllByRole​(UserRoles role)` |
`java.util.Optional<User>` | UserRepository.`getByAuthority​(java.lang.String authority)` | return user by given authority
`java.util.Optional<User>` | UserRepository.`getByEmail​(java.lang.String authority)` |
`java.util.Optional<User>` | UserRepository.`getByRefreshToken​(java.lang.String refreshToken)` |
`java.util.Optional<User>` | UserRepository.`getByToken​(java.lang.String token)` |
`java.util.Optional<User>` | UserRepository.`getByUsosId​(java.lang.String usosId)` |
`java.util.List<User>` | UserRepository.`searchForUsers​(java.lang.String query)` |
`java.util.List<User>` | UserRepository.`searchForUsers​(java.lang.String query, UserRoles role)` | search for user with given query

## Uses of User in com.plannaplan.services

Methods in com.plannaplan.services that return User
Modifier and Type | Method | Description
--- | --- | ---
`User` | UserService.`checkForUser​(java.lang.String email, java.lang.String usosId)` | checks if user exist and return him or creates new one with student role otherwise
`User` | UserService.`checkForUser​(java.lang.String email, java.lang.String usosId, UserRoles roleIfNotExist)` | checks if user exist and creates new one if doesn't
`User` | UserService.`getUserByEmail​(java.lang.String email)` |
`User` | UserService.`login​(User authority)` | generates token for user and if user don't have name in database it will attemp to obtain these from usos api and saves changes in database
`User` | UserService.`save​(User user)` | sacves user to databse and return instatnce with id

Methods in com.plannaplan.services that return types with arguments of type User
Modifier and Type | Method | Description
--- | --- | ---
`java.util.List<User>` | UserService.`getAllStudents()` |
`java.util.Optional<User>` | UserService.`getByAuthority​(java.lang.String authority)` | return user by given authority
`java.util.Optional<User>` | UserService.`getById​(java.lang.Long userId)` |
`java.util.Optional<User>` | UserService.`getByToken​(java.lang.String token)` |
`java.util.List<User>` | UserService.`getStudentsSortedByRanking()` | get students sorted by their ranking
`java.util.Optional<User>` | UserService.`getUserByRefreshToken​(java.lang.String refreshToken)` |
`java.util.List<User>` | UserService.`searchForStudents​(java.lang.String query)` | search for user with given query

Methods in com.plannaplan.services with parameters of type User
Modifier and Type | Method | Description
--- | --- | ---
`java.util.Optional<Commision>` | CommisionService.`getNewestCommision​(User user)` | get newest commision ov given user
`java.util.List<Commision>` | CommisionService.`getUsersCommisions​(User user)` | gets user commisions
`User` | UserService.`login​(User authority)` | generates token for user and if user don't have name in database it will attemp to obtain these from usos api and saves changes in database
`User` | UserService.`save​(User user)` | sacves user to databse and return instatnce with id
`void` | EmailService.`sendAcceptationResult​(User user, EmailAcceptedData data)` | sends email with infromation about accepted groups

Method parameters in com.plannaplan.services with type arguments of type User
Modifier and Type | Method | Description
--- | --- | ---
`void` | UserService.`saveAll​(java.util.List<User> users)` |