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 Details

    • InterviewService

      public InterviewService()
  • Method Details

    • findAll

      public List<InterviewResponseDTO> findAll()
      Retrieves a list of all interview records.
      Specified by:
      findAll in interface CommonService<InterviewRequestDTO,InterviewResponseDTO>
      Returns:
      A list of response DTOs representing all interview records.
    • findById

      public InterviewResponseDTO findById(Integer id)
      Retrieves an interview record by its unique identifier.
      Specified by:
      findById in interface CommonService<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

      public InterviewResponseDTO create(InterviewRequestDTO requestDTO)
      Creates a new interview record based on the provided data.
      Specified by:
      create in interface CommonService<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

      public InterviewResponseDTO update(Integer id, InterviewRequestDTO requestDTO)
      Updates an existing interview record with new data.
      Specified by:
      update in interface CommonService<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

      public void delete(Integer id)
      Deletes an interview record by its unique identifier.
      Specified by:
      delete in interface CommonService<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

      public List<InterviewShortResponseDTO> findAllByStatusId(Integer id)
      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

      public List<InterviewShortResponseDTO> findAllByEmployeeId(Integer id)
      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

      public List<InterviewShortResponseDTO> findAllByDate(InterviewDateRequestDTO requestDTO)
      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.