Package it.astromark.attendance.service
Class AttendanceServiceImpl
java.lang.Object
it.astromark.attendance.service.AttendanceServiceImpl
- All Implemented Interfaces:
AttendanceService
-
Constructor Summary
ConstructorsConstructorDescriptionAttendanceServiceImpl
(SchoolUserService schoolUserService, SchoolClassRepository schoolClassRepository, AbsenceRepository absenceRepository, DelayRepository delayRepository, AttendanceMapper attendanceMapper, StudentRepository studentRepository, JustifiableService justifiableService) -
Method Summary
Modifier and TypeMethodDescriptiongetAttendance
(@NotNull Integer classId, @NotNull LocalDate date) Retrieves the attendance records for a specific class on a given date.void
saveAttendance
(@NotNull Integer classId, @NotNull LocalDate date, @NotNull List<AttendanceRequest> attendanceRequests) Saves the attendance records for a specific class on a given date.
-
Constructor Details
-
AttendanceServiceImpl
@Autowired public AttendanceServiceImpl(SchoolUserService schoolUserService, SchoolClassRepository schoolClassRepository, AbsenceRepository absenceRepository, DelayRepository delayRepository, AttendanceMapper attendanceMapper, StudentRepository studentRepository, JustifiableService justifiableService)
-
-
Method Details
-
getAttendance
@Transactional @PreAuthorize("hasRole(\'TEACHER\')") public List<AttendanceResponse> getAttendance(@NotNull @NotNull Integer classId, @NotNull @NotNull LocalDate date) Description copied from interface:AttendanceService
Retrieves the attendance records for a specific class on a given date.- Specified by:
getAttendance
in interfaceAttendanceService
- Parameters:
classId
- the ID of the classdate
- the date to retrieve attendance for- Returns:
- a list of AttendanceResponse objects representing the attendance records Pre-condition: The classId and date must not be null. The class associated with the classId must exist. Post-condition: Returns a list of attendance records for the specified class and date.
-
saveAttendance
@Transactional @PreAuthorize("hasRole(\'TEACHER\')") public void saveAttendance(@NotNull @NotNull Integer classId, @NotNull @NotNull LocalDate date, @NotNull @NotNull List<AttendanceRequest> attendanceRequests) Description copied from interface:AttendanceService
Saves the attendance records for a specific class on a given date.- Specified by:
saveAttendance
in interfaceAttendanceService
- Parameters:
classId
- the ID of the classdate
- the date to save attendance forattendanceRequests
- a list of AttendanceRequest objects containing attendance details Pre-condition: The classId and date must not be null. The attendanceRequests must not be null and must contain valid attendance data. Post-condition: The attendance records are saved for the specified class and date.
-