Class InterviewController

java.lang.Object
com.myhrcrmproject.controller.InterviewController

@RestController @RequestMapping("api/interviews") public class InterviewController extends Object
Controller class for managing interview-related operations in the HR CRM system.

This class defines RESTful APIs for various interview actions, including retrieving all interviews, finding interviews by ID, creating new interviews, updating existing interviews, and deleting interviews.

Additionally, it provides endpoints to retrieve interviews based on different criteria such as status ID, employee ID, date, etc.

Version:
1.0
Author:
Denys Chaykovskyy
  • Constructor Details

    • InterviewController

      public InterviewController()
  • Method Details

    • findAll

      @GetMapping public org.springframework.http.ResponseEntity<List<InterviewResponseDTO>> findAll()
      Endpoint to retrieve a list of all interviews.
      Returns:
      A ResponseEntity with a list of InterviewResponseDTO representing all interviews.
    • findById

      @GetMapping("/{id}") public org.springframework.http.ResponseEntity<InterviewResponseDTO> findById(@PathVariable("id") Integer id)
      Endpoint to retrieve a interview by its ID.
      Parameters:
      id - The ID of the interview to retrieve.
      Returns:
      A ResponseEntity with the InterviewResponseDTO representing the retrieved interview.
    • createNew

      @PostMapping public org.springframework.http.ResponseEntity<InterviewResponseDTO> createNew(@RequestBody InterviewRequestDTO requestDTO)
      Endpoint to create a new interview.
      Parameters:
      requestDTO - The request body containing interview details.
      Returns:
      A ResponseEntity with the InterviewResponseDTO representing the newly created interview.
    • update

      @PutMapping("/{id}") public org.springframework.http.ResponseEntity<InterviewResponseDTO> update(@PathVariable("id") Integer id, @RequestBody InterviewRequestDTO requestDTO)
      Endpoint to update an existing interview.
      Parameters:
      id - The ID of the interview to update.
      requestDTO - The request body containing updated interview details.
      Returns:
      A ResponseEntity with the InterviewResponseDTO representing the updated interview.
    • deleteCandidate

      @DeleteMapping("/{id}") @ResponseStatus(NO_CONTENT) public void deleteCandidate(@PathVariable("id") Integer id)
      Endpoint to delete a interview.
      Parameters:
      id - The ID of the interview to delete.
    • findAllByStatusId

      @GetMapping("/findAllByStatus/{id}") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByStatusId(@PathVariable("id") Integer statusId)
      Retrieves a list of interviews by status ID.
      Parameters:
      statusId - The ID of the status.
      Returns:
      A ResponseEntity with the list of interviews and HTTP status code 200 (OK).
    • findAllByEmployeeId

      @GetMapping("/findAllByEmployee/{id}") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByEmployeeId(@PathVariable("id") Integer id)
      Endpoint to retrieve a list of interviews by employee ID.
      Parameters:
      id - The ID of the employee.
      Returns:
      A ResponseEntity with a list of InterviewResponseDTO representing interviews by employee ID.
    • findAllByEmployeeId

      @PutMapping("/findAllByDateAndEmployee/{id}") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByEmployeeId(@PathVariable("id") Integer id, @RequestBody InterviewDateRequestDTO requestDTO)
      Retrieves a list of interviews by date and employee ID.
      Parameters:
      id - The ID of the employee.
      requestDTO - The request body containing the date.
      Returns:
      A ResponseEntity with the list of interviews and HTTP status code 200 (OK).
    • findAllByDate

      @PutMapping("/findAllByDate") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByDate(@RequestBody InterviewDateRequestDTO requestDTO)
      Retrieves a list of interviews by date.
      Parameters:
      requestDTO - The request body containing the date.
      Returns:
      A ResponseEntity with the list of interviews and HTTP status code 200 (OK).