Class ConsultationServiceImpl
java.lang.Object
com.mirna.hospitalmanagementapi.application.services.ConsultationServiceImpl
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddConsultation(ConsultationDTO consultationDTO) Adds a new consultation to the repository.cancelConsultation(ConsultationCanceledDTO consultationCanceledDTO) Cancels and updates an existing query in the repositoryFinds a stored consultation by id.
-
Constructor Details
-
ConsultationServiceImpl
public ConsultationServiceImpl()
-
-
Method Details
-
addConsultation
public Consultation addConsultation(ConsultationDTO consultationDTO) throws ConsultationValidationException Adds a new consultation to the repository.- Specified by:
addConsultationin interfaceConsultationService- 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
Finds a stored consultation by id.- Specified by:
findConsultationByIdin interfaceConsultationService- 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
Cancels and updates an existing query in the repository- Specified by:
cancelConsultationin interfaceConsultationService- 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.
-