Package com.myhrcrmproject.service
Class CompensationService
java.lang.Object
com.myhrcrmproject.service.CompensationService
- All Implemented Interfaces:
CommonService<CompensationRequestDTO,CompensationResponseDTO>
@Service
public class CompensationService
extends Object
implements CommonService<CompensationRequestDTO,CompensationResponseDTO>
Service class that handles CRUD (Create, Read, Update, Delete) operations for compensation entities.
This service provides methods to perform operations on compensation entities, such as retrieving, creating, updating, and deleting communication records. It also includes additional methods for finding compensation records based on different criteria.
- Version:
- 1.0
- Author:
- Denys Chaykovskyy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(CompensationRequestDTO requestDTO) Creates a new compensation record based on the provided data.voidDeletes a compensation record by its unique identifier.findAll()Retrieves a list of all compensation records.Retrieves a list of compensation records based on the candidate's unique identifier.Retrieves a list of compensation records based on the contract's unique identifier.Retrieves a compensation record by its unique identifier.update(Integer id, CompensationRequestDTO requestDTO) Updates an existing compensation record with new data.
-
Constructor Details
-
CompensationService
public CompensationService()
-
-
Method Details
-
findAll
Retrieves a list of all compensation records.- Specified by:
findAllin interfaceCommonService<CompensationRequestDTO,CompensationResponseDTO> - Returns:
- A list of response DTOs representing all compensation records.
-
findById
Retrieves a compensation record by its unique identifier.- Specified by:
findByIdin interfaceCommonService<CompensationRequestDTO,CompensationResponseDTO> - Parameters:
id- The identifier of the compensation record to retrieve.- Returns:
- The response DTO representing the retrieved compensation record.
- Throws:
NotFoundException- if the compensation record with the specified id is not found.
-
create
Creates a new compensation record based on the provided data.- Specified by:
createin interfaceCommonService<CompensationRequestDTO,CompensationResponseDTO> - Parameters:
requestDTO- The request DTO containing data for the new compensation record.- Returns:
- The response DTO representing the newly created compensation record.
-
update
Updates an existing compensation record with new data.- Specified by:
updatein interfaceCommonService<CompensationRequestDTO,CompensationResponseDTO> - Parameters:
id- The identifier of the compensation record to update.requestDTO- The request DTO containing updated data for the compensation record.- Returns:
- The response DTO representing the updated compensation record.
- Throws:
NotFoundException- if the compensation record with the specified id is not found.
-
delete
Deletes a compensation record by its unique identifier.- Specified by:
deletein interfaceCommonService<CompensationRequestDTO,CompensationResponseDTO> - Parameters:
id- The identifier of the compensation record to delete.- Throws:
NotFoundException- if the compensation record with the specified id is not found.
-
findAllByCandidateId
Retrieves a list of compensation records based on the candidate's unique identifier.- Parameters:
id- The identifier of the candidate.- Returns:
- A list of
CommunicationShortResponseDTOrepresenting compensation records associated with the candidate.
-
findAllByContractId
Retrieves a list of compensation records based on the contract's unique identifier.- Parameters:
id- The identifier of the contract.- Returns:
- A list of
CompensationShortResponseDTOrepresenting compensation records associated with the contract.
-