Interface HolidayService
-
Method Summary
Modifier and TypeMethodDescriptionchangeStatus
(Long id, Status status) Changes the status of an existing holiday request.createHoliday
(CreateHolidayDto createHolidayDto, String token) Creates a new holiday request.getHolidayDto
(Long id) Retrieves a holiday DTO by its ID.getHolidays
(HolidaySpecificationDto holidaySpecificationDto) Retrieves a list of holidays matching the provided specification.getHolidaysByDate
(String token, LocalDateTime startDate, LocalDateTime endDate) Retrieves a list of holidays for the authenticated user between specified dates.
-
Method Details
-
createHoliday
Creates a new holiday request.- Parameters:
createHolidayDto
- DTO containing the holiday details to be createdtoken
- Authentication token of the user creating the holiday- Returns:
- The ID of the created holiday
-
changeStatus
-
getHolidayDto
Retrieves a holiday DTO by its ID.- Parameters:
id
- The ID of the holiday request- Returns:
- The HolidayDto corresponding to the given ID
-
getHolidays
Retrieves a list of holidays matching the provided specification.- Parameters:
holidaySpecificationDto
- DTO containing criteria to filter holidays- Returns:
- A list of HolidayDto matching the specification
-
getHolidaysByDate
Retrieves a list of holidays for the authenticated user between specified dates.- Parameters:
token
- Authentication token of the userstartDate
- The start date/time to filter holidays (inclusive)endDate
- The end date/time to filter holidays (inclusive)- Returns:
- A list of HolidayDto within the specified date range for the user
-