Package it.astromark.attendance.service
Interface JustifiableService
- All Known Implementing Classes:
JustifiableServiceImpl
public interface JustifiableService
Service interface for managing justifications related to student absences and delays.
Provides methods to justify, retrieve, and calculate absences and delays.
-
Method Summary
Modifier and TypeMethodDescriptiongetAbsencesByYear
(UUID studentId, Year year) Retrieves a list of absences for a student in a specific year.getDelayByYear
(UUID studentId, Year year) Retrieves a list of delays for a student in a specific year.getTotalAbsences
(UUID studentId, Year year) Retrieves the total number of absences for a student in a specific year.getTotalDelays
(UUID studentId, Year year) Retrieves the total number of delays for a student in a specific year.Justifies an absence or delay for a student.
-
Method Details
-
justify
JustifiableResponse justify(UUID studentId, UUID justificationId, String justificationText, Boolean absence) Justifies an absence or delay for a student.- Parameters:
studentId
- the UUID of the studentjustificationId
- the UUID of the justificationjustificationText
- the text explaining the justificationabsence
- true if justifying an absence, false if justifying a delay- Returns:
- a `JustifiableResponse` object representing the justification details Pre-condition: The `studentId` and `justificationId` must not be null. The `justificationText` must not be null or empty. Post-condition: A justification is created or updated, and a response object with the justification details is returned.
-
getAbsencesByYear
Retrieves a list of absences for a student in a specific year.- Parameters:
studentId
- the UUID of the studentyear
- the year to filter absences- Returns:
- a list of `JustifiableResponse` objects representing the absences Pre-condition: The `studentId` and `year` must not be null. Post-condition: Returns a list of absences for the specified student and year.
-
getDelayByYear
Retrieves a list of delays for a student in a specific year.- Parameters:
studentId
- the UUID of the studentyear
- the year to filter delays- Returns:
- a list of `JustifiableResponse` objects representing the delays Pre-condition: The `studentId` and `year` must not be null. Post-condition: Returns a list of delays for the specified student and year.
-
getTotalAbsences
Retrieves the total number of absences for a student in a specific year.- Parameters:
studentId
- the UUID of the studentyear
- the year to filter absences- Returns:
- the total number of absences as an integer Pre-condition: The `studentId` and `year` must not be null. Post-condition: Returns the total number of absences for the specified student and year.
-
getTotalDelays
Retrieves the total number of delays for a student in a specific year.- Parameters:
studentId
- the UUID of the studentyear
- the year to filter delays- Returns:
- the total number of delays as an integer Pre-condition: The `studentId` and `year` must not be null. Post-condition: Returns the total number of delays for the specified student and year.
-