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 Summary
Modifier and TypeMethodDescriptionRetrieves detailed information about the logged-in user.boolean
isLoggedParentStudentClass
(@NotNull Integer classId) Checks if the logged-in parent has a child in a specific class.boolean
isLoggedStudent
(@NotNull UUID studentId) Checks if the logged-in student matches the specified student ID.boolean
isLoggedTeacherClass
(@NotNull Integer classId) Checks if the logged-in teacher is responsible for a specific class.boolean
isLoggedTeacherStudent
(@NotNull UUID studentId) Checks if the logged-in teacher is responsible for a specific student.boolean
isLoggedUserParent
(@NotNull UUID studentId) Checks if the logged-in user is the parent of a specific student.boolean
isStudentParent
(@NotNull Parent parent, @NotNull UUID studentId) Checks if the specified parent is the parent of a specific student.boolean
isTeacherClass
(@NotNull Teacher teacher, @NotNull Integer classId) Checks if a specific teacher is responsible for a specific class.updateAddress
(String address) Updates the address for the logged-in user.updatePreferences
(@NotNull SchoolUserUpdate schoolUserUpdate) Updates the preferences for the logged-in user.
-
Method Details
-
isStudentParent
Checks if the specified parent is the parent of a specific student.- Parameters:
parent
- the `Parent` objectstudentId
- 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
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
Checks if a specific teacher is responsible for a specific class.- Parameters:
teacher
- the `Teacher` objectclassId
- 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
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
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
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
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
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
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.
-