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 Type
    Method
    Description
    create(Tutor tutor)
    Creates 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
    update(Tutor tutor, Long id)
    Updates an existing tutor.
  • Method Details

    • create

      Tutor create(Tutor tutor)
      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

      Tutor findById(Long id)
      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

      Page<Tutor> findAll(int pageNumber, int pageSize)
      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

      void update(Tutor tutor, Long id)
      Updates an existing tutor.
      Parameters:
      tutor - the updated tutor data
      id - the unique identifier of the tutor to update
      Throws:
      EntityNotFoundException - if no tutor with the given ID is found
      EntityExistsException - if a tutor of current user already exist.
    • delete

      void delete(Long id)
      Deletes a tutor by its unique identifier.
      Parameters:
      id - the unique identifier of the tutor to delete
    • patchSubjects

      void patchSubjects(Set<Subject> subjects, Long id)
      Updates the list of subjects that a tutor can teach.
      Parameters:
      subjects - set of subjects
      id - the unique identifier of the tutor to update
    • patchGrades

      void patchGrades(Set<Integer> grades, Long id)
      Updates the list of education classes that a tutor can teach.
      Parameters:
      grades - set of grades
      id - the unique identifier of the tutor to update