Interface IPreferenceController
- All Known Implementing Classes:
PreferenceController
public interface IPreferenceController
This interface is responsible for managing at business level the scheduling preferences of doctors
-
Method Summary
Modifier and TypeMethodDescriptionAdds a shceduling preference to a doctorAdds a set of preferences to a doctorvoidDeletes a preference of a doctorEdits the scheduling preferences of a doctor, eventually creating new ones and removing the not anymore needed onesRetrieves a user's scheduling preferencesRetrieves a doctor's scheduling preferences in DTO form
-
Method Details
-
addPreference
Adds a shceduling preference to a doctor- Parameters:
dto- DTO containing all the info about the preference and the doctor id- Returns:
- a Preference entity with a JPA-assigned id
- Throws:
DatabaseException- upon save errors
-
addPreferences
Adds a set of preferences to a doctor- Parameters:
dto- DTO containing a list with all the info about the preferences to be added and the doctor id- Returns:
- a list of PreferenceDTOOut with JPA-assigned ids
- Throws:
DatabaseException- upon save errors
-
deletePreference
Deletes a preference of a doctor- Parameters:
dto- DTO containing the ids of the preference to be deleted from the doctor and the id of the doctor- Throws:
DatabaseException- upon deletion errors
-
getUsersPreferenceDTOs
Retrieves a doctor's scheduling preferences in DTO form- Parameters:
dto- A DTO containing the doctor's id for the search- Returns:
- A list of PreferenceDTOOut representing the doctor's scheduling preferences
-
editPreferences
Edits the scheduling preferences of a doctor, eventually creating new ones and removing the not anymore needed ones- Parameters:
dto- a DTO containing all the edited preferences and the references to the preferences to delete. The newly added preferences are marked by their lack of an id- Returns:
- A list of
PreferenceDTOOutrepresenting the newly updated preferences (gives to the receiver the ids of the newly defined ones, too - Throws:
DatabaseException- upon deletion errors
-
getUserPreferences
Retrieves a user's scheduling preferences- Parameters:
dto- A DTO containing the doctor's id for the search- Returns:
- A list of doctor's scheduling preferences
-