Interface ConsultationService
- All Known Implementing Classes:
ConsultationServiceImpl
public interface ConsultationService
-
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.
-
Method Details
-
addConsultation
Consultation addConsultation(ConsultationDTO consultationDTO) throws ConsultationValidationException Adds a new consultation to the repository.- 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.- Parameters:
id- A long representing the consultation's unique identifier- Returns:
- The corresponding consultation if successful, or null if it is non-existent.
-
cancelConsultation
Cancels and updates an existing query in the repository- 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.
-