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