Class ClassAgendaServiceImpl
java.lang.Object
it.astromark.agenda.schoolclass.service.ClassAgendaServiceImpl
- All Implemented Interfaces:
ClassAgendaService
-
Constructor Summary
ConstructorsConstructorDescriptionClassAgendaServiceImpl
(TeachingTimeslotRepository teachingTimeslotRepository, TimeslotMapper timeslotMapper, SchoolUserService schoolUserService, AuthenticationService authenticationService, StudentRepository studentRepository, ClassAgendaMapper classAgendaMapper, ClassAgendaHelperMapper classAgendaHelperMapper, SignedHourRepository signedHourRepository, ClassTimetableRepository classTimetableRepository, TeachingRepository teachingRepository, SchoolClassRepository schoolClassRepository, ClassworkService classworkService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTimeslot
(Integer classId, TeachingTimeslotRequest request) Adds a teaching timeslot for a given class.void
createTimeTable
(ClassTimeTableRequest request) Creates a timetable for a given class.getClassTimeslot
(Integer classId, LocalDate now) Retrieves the teaching timeslots for a specific class at the current date.getTeachingTimeslot
(Integer classId, LocalDate localDate) Retrieves detailed teaching timeslots for a specific day.getTimeTable
(Integer classId) Retrieves the timetable for a specific class.getTotalHour
(Integer classId) Retrieves the total teaching hours for a given class.getWeekTimeslot
(Integer classID, LocalDate date) Retrieves the teaching timeslots for a specific week.boolean
Checks if a timeslot is signed for a given ID and date.sign
(Integer classId, SignHourRequest request) Signs the teaching hours for a given class.
-
Constructor Details
-
ClassAgendaServiceImpl
@Autowired public ClassAgendaServiceImpl(TeachingTimeslotRepository teachingTimeslotRepository, TimeslotMapper timeslotMapper, SchoolUserService schoolUserService, AuthenticationService authenticationService, StudentRepository studentRepository, ClassAgendaMapper classAgendaMapper, ClassAgendaHelperMapper classAgendaHelperMapper, SignedHourRepository signedHourRepository, ClassTimetableRepository classTimetableRepository, TeachingRepository teachingRepository, SchoolClassRepository schoolClassRepository, ClassworkService classworkService)
-
-
Method Details
-
getTotalHour
Description copied from interface:ClassAgendaService
Retrieves the total teaching hours for a given class.- Specified by:
getTotalHour
in interfaceClassAgendaService
- Parameters:
classId
- the ID of the class- Returns:
- the total hours of teaching for the specified class Pre-condition: The `classId` must not be null. The class associated with the `classId` must exist. Post-condition: Returns the total teaching hours as an integer value.
-
addTimeslot
Description copied from interface:ClassAgendaService
Adds a teaching timeslot for a given class.- Specified by:
addTimeslot
in interfaceClassAgendaService
- Parameters:
classId
- the ID of the classrequest
- the request containing details about the teaching timeslot Pre-condition: The `classId` must not be null. The `request` must not be null and must contain valid timeslot details. Post-condition: A new teaching timeslot is added to the specified class.
-
sign
@PreAuthorize("hasRole(\'TEACHER\')") public TeachingTimeslotDetailedResponse sign(Integer classId, SignHourRequest request) Description copied from interface:ClassAgendaService
Signs the teaching hours for a given class.- Specified by:
sign
in interfaceClassAgendaService
- Parameters:
classId
- the ID of the classrequest
- the request containing signing details Pre-condition: The `classId` must not be null. The `request` must not be null and must contain valid signing details. Post-condition: The specified hours are signed for the given class.
-
isSigned
Description copied from interface:ClassAgendaService
Checks if a timeslot is signed for a given ID and date.- Specified by:
isSigned
in interfaceClassAgendaService
- Parameters:
signedId
- the ID of the signed timeslotdate
- the date to check- Returns:
- true if the timeslot is signed, false otherwise Pre-condition: The `signedId` and `date` must not be null. The timeslot associated with the `signedId` must exist. Post-condition: Returns true if the timeslot is signed, otherwise false.
-
getWeekTimeslot
@PreAuthorize("hasRole(\'STUDENT\') || hasRole(\'PARENT\')") public List<TeachingTimeslotResponse> getWeekTimeslot(Integer classID, LocalDate date) Description copied from interface:ClassAgendaService
Retrieves the teaching timeslots for a specific week.- Specified by:
getWeekTimeslot
in interfaceClassAgendaService
- Parameters:
classID
- the ID of the classdate
- the date within the week to retrieve timeslots for- Returns:
- a list of `TeachingTimeslotResponse` objects representing the timeslots Pre-condition: The `classID` and `date` must not be null. The class associated with the `classID` must exist. Post-condition: Returns a list of timeslots for the specified week.
-
getTeachingTimeslot
@PreAuthorize("hasRole(\'TEACHER\')") public List<TeachingTimeslotDetailedResponse> getTeachingTimeslot(Integer classId, LocalDate localDate) Description copied from interface:ClassAgendaService
Retrieves detailed teaching timeslots for a specific day.- Specified by:
getTeachingTimeslot
in interfaceClassAgendaService
- Parameters:
classId
- the ID of the classlocalDate
- the date to retrieve timeslots for- Returns:
- a list of `TeachingTimeslotDetailedResponse` objects representing the detailed timeslots Pre-condition: The `classId` and `localDate` must not be null. The class associated with the `classId` must exist. Post-condition: Returns a list of detailed timeslots for the specified day.
-
createTimeTable
Description copied from interface:ClassAgendaService
Creates a timetable for a given class.- Specified by:
createTimeTable
in interfaceClassAgendaService
- Parameters:
request
- the request containing timetable details Pre-condition: The `request` must not be null and must contain valid timetable details. Post-condition: A new timetable is created for the specified class.
-
getClassTimeslot
Description copied from interface:ClassAgendaService
Retrieves the teaching timeslots for a specific class at the current date.- Specified by:
getClassTimeslot
in interfaceClassAgendaService
- Parameters:
classId
- the ID of the classnow
- the current date- Returns:
- a list of `TeachingTimeslotResponse` objects representing the class's timeslots Pre-condition: The `classId` and `now` must not be null. The class associated with the `classId` must exist. Post-condition: Returns a list of timeslots for the specified class at the current date.
-
getTimeTable
Description copied from interface:ClassAgendaService
Retrieves the timetable for a specific class.- Specified by:
getTimeTable
in interfaceClassAgendaService
- Parameters:
classId
- the ID of the class- Returns:
- a list of `TimeTableResponse` objects representing the class's timetable Pre-condition: The `classId` must not be null. The class associated with the `classId` must exist. Post-condition: Returns a list of timetables for the specified class.
-