Class ClassAgendaServiceImpl

java.lang.Object
it.astromark.agenda.schoolclass.service.ClassAgendaServiceImpl
All Implemented Interfaces:
ClassAgendaService

@Service public class ClassAgendaServiceImpl extends Object implements ClassAgendaService
  • Constructor Details

  • Method Details

    • getTotalHour

      public Integer getTotalHour(Integer classId)
      Description copied from interface: ClassAgendaService
      Retrieves the total teaching hours for a given class.
      Specified by:
      getTotalHour in interface ClassAgendaService
      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

      public void addTimeslot(Integer classId, TeachingTimeslotRequest request)
      Description copied from interface: ClassAgendaService
      Adds a teaching timeslot for a given class.
      Specified by:
      addTimeslot in interface ClassAgendaService
      Parameters:
      classId - the ID of the class
      request - 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 interface ClassAgendaService
      Parameters:
      classId - the ID of the class
      request - 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

      public boolean isSigned(Integer signedId, LocalDate date)
      Description copied from interface: ClassAgendaService
      Checks if a timeslot is signed for a given ID and date.
      Specified by:
      isSigned in interface ClassAgendaService
      Parameters:
      signedId - the ID of the signed timeslot
      date - 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 interface ClassAgendaService
      Parameters:
      classID - the ID of the class
      date - 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 interface ClassAgendaService
      Parameters:
      classId - the ID of the class
      localDate - 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

      @PreAuthorize("hasRole(\'SECRETARY\')") public void createTimeTable(ClassTimeTableRequest request)
      Description copied from interface: ClassAgendaService
      Creates a timetable for a given class.
      Specified by:
      createTimeTable in interface ClassAgendaService
      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

      public List<TeachingTimeslotResponse> getClassTimeslot(Integer classId, LocalDate now)
      Description copied from interface: ClassAgendaService
      Retrieves the teaching timeslots for a specific class at the current date.
      Specified by:
      getClassTimeslot in interface ClassAgendaService
      Parameters:
      classId - the ID of the class
      now - 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

      public List<TimeTableResponse> getTimeTable(Integer classId)
      Description copied from interface: ClassAgendaService
      Retrieves the timetable for a specific class.
      Specified by:
      getTimeTable in interface ClassAgendaService
      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.