Package com.myhrcrmproject.service
Class InterviewService
java.lang.Object
com.myhrcrmproject.service.InterviewService
- All Implemented Interfaces:
CommonService<InterviewRequestDTO,InterviewResponseDTO>
@Service
public class InterviewService
extends Object
implements CommonService<InterviewRequestDTO,InterviewResponseDTO>
Service class that handles CRUD (Create, Read, Update, Delete) operations for interview entities.
This service provides methods to perform operations on interview entities, such as retrieving, creating, updating, and deleting interview records. It also includes additional methods for finding interview records based on different criteria.
- Version:
- 1.0
- Author:
- Denys Chaykovskyy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(InterviewRequestDTO requestDTO) Creates a new interview record based on the provided data.voidDeletes an interview record by its unique identifier.findAll()Retrieves a list of all interview records.findAllByDate(InterviewDateRequestDTO requestDTO) Retrieves a list of interview records based on a specific date.findAllByDateAndEmployeeId(InterviewDateRequestDTO requestDTO, Integer id) Retrieves a list of interview records based on a specific date and associated with a specific employee.Retrieves a list of interview records associated with a specific employee.Retrieves a list of interview records based on the status.Retrieves an interview record by its unique identifier.update(Integer id, InterviewRequestDTO requestDTO) Updates an existing interview record with new data.
-
Constructor Details
-
InterviewService
public InterviewService()
-
-
Method Details
-
findAll
Retrieves a list of all interview records.- Specified by:
findAllin interfaceCommonService<InterviewRequestDTO,InterviewResponseDTO> - Returns:
- A list of response DTOs representing all interview records.
-
findById
Retrieves an interview record by its unique identifier.- Specified by:
findByIdin interfaceCommonService<InterviewRequestDTO,InterviewResponseDTO> - Parameters:
id- The identifier of the interview record to retrieve.- Returns:
- The response DTO representing the retrieved interview record.
- Throws:
NotFoundException- if the interview record with the specified id is not found.
-
create
Creates a new interview record based on the provided data.- Specified by:
createin interfaceCommonService<InterviewRequestDTO,InterviewResponseDTO> - Parameters:
requestDTO- The request DTO containing data for the new interview record.- Returns:
- The response DTO representing the newly created interview record.
-
update
Updates an existing interview record with new data.- Specified by:
updatein interfaceCommonService<InterviewRequestDTO,InterviewResponseDTO> - Parameters:
id- The identifier of the interview record to update.requestDTO- The request DTO containing updated data for the interview record.- Returns:
- The response DTO representing the updated interview record.
- Throws:
NotFoundException- if the interview record with the specified id is not found.org.springframework.web.server.NotAcceptableStatusException- if the authenticated user does not have permission to update this entity.
-
delete
Deletes an interview record by its unique identifier.- Specified by:
deletein interfaceCommonService<InterviewRequestDTO,InterviewResponseDTO> - Parameters:
id- The identifier of the interview record to delete.- Throws:
NotFoundException- if the interview record with the specified id is not found.
-
findAllByStatusId
Retrieves a list of interview records based on the status.- Parameters:
id- The identifier of the interview status.- Returns:
- A list of response DTOs representing interview records with the specified status.
-
findAllByEmployeeId
Retrieves a list of interview records associated with a specific employee.- Parameters:
id- The identifier of the employee to filter by.- Returns:
- A list of response DTOs representing interview records associated with the specified employee.
- Throws:
NotFoundException- if the employee with the specified id is not found.org.springframework.web.server.NotAcceptableStatusException- if the authenticated user does not have permission to access this entity.
-
findAllByDateAndEmployeeId
public List<InterviewShortResponseDTO> findAllByDateAndEmployeeId(InterviewDateRequestDTO requestDTO, Integer id) Retrieves a list of interview records based on a specific date and associated with a specific employee.- Parameters:
requestDTO- The request DTO containing the date.id- The identifier of the employee to filter by.- Returns:
- A list of response DTOs representing interview records with the specified date and associated with the specified employee.
- Throws:
NotFoundException- if the employee with the specified id is not found.org.springframework.web.server.NotAcceptableStatusException- if the authenticated user does not have permission to access this entity.
-
findAllByDate
Retrieves a list of interview records based on a specific date.- Parameters:
requestDTO- The request DTO containing the date.- Returns:
- A list of response DTOs representing interview records with the specified date.
-