Interface SchoolUserService

All Known Implementing Classes:
SchoolUserServiceImpl

public interface SchoolUserService
Service interface for managing school user-related operations. Provides methods to handle common functionalities for all types of school users.
  • Method Details

    • isStudentParent

      boolean isStudentParent(@NotNull @NotNull Parent parent, @NotNull @NotNull UUID studentId)
      Checks if the specified parent is the parent of a specific student.
      Parameters:
      parent - the `Parent` object
      studentId - the UUID of the student
      Returns:
      true if the parent is the parent of the student, false otherwise Pre-condition: The `parent` and `studentId` must not be null. The student must exist. Post-condition: Returns true if the parent is associated with the specified student.
    • isLoggedUserParent

      boolean isLoggedUserParent(@NotNull @NotNull UUID studentId)
      Checks if the logged-in user is the parent of a specific student.
      Parameters:
      studentId - the UUID of the student
      Returns:
      true if the logged-in user is the parent of the student, false otherwise Pre-condition: The `studentId` must not be null. The student must exist. Post-condition: Returns true if the logged-in user is associated as the parent of the student.
    • isTeacherClass

      boolean isTeacherClass(@NotNull @NotNull Teacher teacher, @NotNull @NotNull Integer classId)
      Checks if a specific teacher is responsible for a specific class.
      Parameters:
      teacher - the `Teacher` object
      classId - the ID of the class
      Returns:
      true if the teacher is responsible for the class, false otherwise Pre-condition: The `teacher` and `classId` must not be null. The class must exist. Post-condition: Returns true if the teacher is associated with the class.
    • isLoggedTeacherClass

      boolean isLoggedTeacherClass(@NotNull @NotNull Integer classId)
      Checks if the logged-in teacher is responsible for a specific class.
      Parameters:
      classId - the ID of the class
      Returns:
      true if the logged-in teacher is responsible for the class, false otherwise Pre-condition: The `classId` must not be null. The class must exist. Post-condition: Returns true if the logged-in teacher is associated with the class.
    • isLoggedParentStudentClass

      boolean isLoggedParentStudentClass(@NotNull @NotNull Integer classId)
      Checks if the logged-in parent has a child in a specific class.
      Parameters:
      classId - the ID of the class
      Returns:
      true if the logged-in parent has a child in the class, false otherwise Pre-condition: The `classId` must not be null. The class must exist. Post-condition: Returns true if the logged-in parent is associated with the class.
    • isLoggedTeacherStudent

      boolean isLoggedTeacherStudent(@NotNull @NotNull UUID studentId)
      Checks if the logged-in teacher is responsible for a specific student.
      Parameters:
      studentId - the UUID of the student
      Returns:
      true if the logged-in teacher is responsible for the student, false otherwise Pre-condition: The `studentId` must not be null. The student must exist. Post-condition: Returns true if the logged-in teacher is associated with the student.
    • isLoggedStudent

      boolean isLoggedStudent(@NotNull @NotNull UUID studentId)
      Checks if the logged-in student matches the specified student ID.
      Parameters:
      studentId - the UUID of the student
      Returns:
      true if the logged-in student matches the specified ID, false otherwise Pre-condition: The `studentId` must not be null. The student must exist. Post-condition: Returns true if the logged-in student matches the specified ID.
    • updatePreferences

      SchoolUserResponse updatePreferences(@NotNull @NotNull SchoolUserUpdate schoolUserUpdate)
      Updates the preferences for the logged-in user.
      Parameters:
      schoolUserUpdate - the object containing the updated preferences
      Returns:
      a `SchoolUserResponse` object representing the updated user details Pre-condition: The `schoolUserUpdate` must not be null and must contain valid preference data. Post-condition: The user's preferences are updated, and a response object is returned.
    • updateAddress

      SchoolUserResponse updateAddress(String address)
      Updates the address for the logged-in user.
      Parameters:
      address - the new address
      Returns:
      a `SchoolUserResponse` object representing the updated user details Pre-condition: The `address` must not be null or empty. Post-condition: The user's address is updated, and a response object is returned.
    • getByIdDetailed

      SchoolUserDetailed getByIdDetailed()
      Retrieves detailed information about the logged-in user.
      Returns:
      a `SchoolUserDetailed` object containing detailed user information Pre-condition: The user must be logged in. Post-condition: Returns detailed information about the logged-in user.