Package com.myhrcrmproject.service
Class VacancyService
java.lang.Object
com.myhrcrmproject.service.VacancyService
- All Implemented Interfaces:
CommonService<VacancyRequestDTO,VacancyResponseDTO>
@Service
public class VacancyService
extends Object
implements CommonService<VacancyRequestDTO,VacancyResponseDTO>
Service class that handles CRUD (Create, Read, Update, Delete) operations for vacancy entities.
This service provides methods to perform operations on vacancy entities, such as retrieving, creating, updating, and deleting vacancy records. It also includes extra methods for finding vacancies by status or employee.
- Version:
- 1.0
- Author:
- Denys Chaykovskyy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(VacancyRequestDTO requestDTO) Creates a new vacancy record based on the provided request DTO.voidDeletes a vacancy record based on the provided id.findAll()Retrieves a list of vacancy records.Retrieves a list of short response DTOs for vacancies associated with an employee.Retrieves a list of vacancy records by status.Retrieves a vacancy record based on the provided id.update(Integer id, VacancyRequestDTO requestDTO) Updates an existing vacancy record based on the provided id and request DTO.
-
Constructor Details
-
VacancyService
public VacancyService()
-
-
Method Details
-
findAll
Retrieves a list of vacancy records.- Specified by:
findAllin interfaceCommonService<VacancyRequestDTO,VacancyResponseDTO> - Returns:
- A list of response DTOs representing vacancy records.
-
findById
Retrieves a vacancy record based on the provided id.- Specified by:
findByIdin interfaceCommonService<VacancyRequestDTO,VacancyResponseDTO> - Parameters:
id- The identifier of the vacancy record to retrieve.- Returns:
- The response DTO representing the vacancy record.
- Throws:
NotFoundException- if the vacancy record with the specified id is not found.
-
create
Creates a new vacancy record based on the provided request DTO.- Specified by:
createin interfaceCommonService<VacancyRequestDTO,VacancyResponseDTO> - Parameters:
requestDTO- The request DTO containing information for creating the vacancy record.- Returns:
- The response DTO representing the created vacancy record.
-
update
Updates an existing vacancy record based on the provided id and request DTO.- Specified by:
updatein interfaceCommonService<VacancyRequestDTO,VacancyResponseDTO> - Parameters:
id- The identifier of the vacancy record to update.requestDTO- The request DTO containing information for updating the vacancy record.- Returns:
- The response DTO representing the updated vacancy record.
- Throws:
NotFoundException- if the vacancy record with the specified id is not found.
-
delete
Deletes a vacancy record based on the provided id.- Specified by:
deletein interfaceCommonService<VacancyRequestDTO,VacancyResponseDTO> - Parameters:
id- The identifier of the vacancy record to delete.- Throws:
NotFoundException- if the vacancy record with the specified id is not found.
-
findAllByStatusId
Retrieves a list of vacancy records by status.- Parameters:
id- The identifier of the vacancy status.- Returns:
- A list of response DTOs representing vacancy records with the specified status.
-
findAllByEmployeeId
Retrieves a list of short response DTOs for vacancies associated with an employee.- Parameters:
id- The identifier of the employee.- Returns:
- A list of short response DTOs representing vacancies associated with the specified employee.
-