Class ConsultationServiceImpl

java.lang.Object
com.mirna.hospitalmanagementapi.application.services.ConsultationServiceImpl
All Implemented Interfaces:
ConsultationService

@Service public class ConsultationServiceImpl extends Object implements ConsultationService
This class is an implementation of the ConsultationService interface. This class provides methods to perform operations on consultations
Version:
1.0
Author:
Mirna Gama
  • Constructor Details

    • ConsultationServiceImpl

      public ConsultationServiceImpl()
  • Method Details

    • addConsultation

      public Consultation addConsultation(ConsultationDTO consultationDTO) throws ConsultationValidationException
      Adds a new consultation to the repository.
      Specified by:
      addConsultation in interface ConsultationService
      Parameters:
      consultationDTO - A data transfer object representing a consultation to add.
      Returns:
      The saved consultation if successful, or throws an exception if there is an error.
      Throws:
      ConsultationValidationException - if there is a validation error
    • findConsultationById

      public Consultation findConsultationById(Long id)
      Finds a stored consultation by id.
      Specified by:
      findConsultationById in interface ConsultationService
      Parameters:
      id - A long representing the consultation's unique identifier
      Returns:
      The corresponding consultation if successful, or throws an exception if it is non-existent.
    • cancelConsultation

      public Consultation cancelConsultation(ConsultationCanceledDTO consultationCanceledDTO)
      Cancels and updates an existing query in the repository
      Specified by:
      cancelConsultation in interface ConsultationService
      Parameters:
      consultationCanceledDTO - A data transfer object representing the consultation that will be canceled.
      Returns:
      The canceled consultation if successful, or throws an exception if there is an error.