Interface TutorService
- All Known Implementing Classes:
TutorServiceImpl
public interface TutorService
Service interface for managing
Tutor
entities. Define methods for CRUD operations and querying tutors.-
Method Summary
Modifier and TypeMethodDescriptionCreates a new tutor.void
Deletes a tutor by its unique identifier.findAll
(int pageNumber, int pageSize) Retrieves a paginated list of tutors.Retrieves an tutor by its unique identifier.void
patchGrades
(Set<Integer> grades, Long id) Updates the list of education classes that a tutor can teach.void
patchSubjects
(Set<Subject> subjects, Long id) Updates the list of subjects that a tutor can teach.void
Updates an existing tutor.
-
Method Details
-
create
Creates a new tutor.- Parameters:
tutor
- the tutor to create- Returns:
- the created
Tutor
- Throws:
EntityExistsException
- if a tutor of current user already exist.
-
findById
Retrieves an tutor by its unique identifier.- Parameters:
id
- the unique identifier of the tutor- Returns:
- the found
Tutor
- Throws:
EntityNotFoundException
- if no tutor with the given ID is found
-
findAll
Retrieves a paginated list of tutors.- Parameters:
pageNumber
- the page number (starting from 0)pageSize
- the number of tutors per page- Returns:
- a
Page
containing the requested tutors
-
update
Updates an existing tutor.- Parameters:
tutor
- the updated tutor dataid
- the unique identifier of the tutor to update- Throws:
EntityNotFoundException
- if no tutor with the given ID is foundEntityExistsException
- if a tutor of current user already exist.
-
delete
Deletes a tutor by its unique identifier.- Parameters:
id
- the unique identifier of the tutor to delete
-
patchSubjects
Updates the list of subjects that a tutor can teach.- Parameters:
subjects
- set of subjectsid
- the unique identifier of the tutor to update
-
patchGrades
Updates the list of education classes that a tutor can teach.- Parameters:
grades
- set of gradesid
- the unique identifier of the tutor to update
-