Class PreferenceController
java.lang.Object
org.cswteams.ms3.control.preferences.PreferenceController
- All Implemented Interfaces:
IPreferenceController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPreference(@Valid PreferenceInWithUIDDTO dto) Adds a shceduling preference to a doctoraddPreferences(@Valid PreferenceListWithUIDDTO dto) Adds a set of preferences to a doctorvoiddeletePreference(@Valid PreferenceDoctorIDDTO dto) Deletes a preference of a doctoreditPreferences(@Valid EditedPreferencesDTOIn dto) Edits the scheduling preferences of a doctor, eventually creating new ones and removing the not anymore needed onesgetUserPreferences(@Valid DoctorIdDTO dto) Retrieves a user's scheduling preferencesgetUsersPreferenceDTOs(@Valid DoctorIdDTO dto) Retrieves a doctor's scheduling preferences in DTO form
-
Constructor Details
-
PreferenceController
public PreferenceController()
-
-
Method Details
-
addPreference
Description copied from interface:IPreferenceControllerAdds a shceduling preference to a doctor- Specified by:
addPreferencein interfaceIPreferenceController- 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
public List<PreferenceDTOOut> addPreferences(@Valid @Valid PreferenceListWithUIDDTO dto) throws DatabaseException Description copied from interface:IPreferenceControllerAdds a set of preferences to a doctor- Specified by:
addPreferencesin interfaceIPreferenceController- 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
Description copied from interface:IPreferenceControllerDeletes a preference of a doctor- Specified by:
deletePreferencein interfaceIPreferenceController- 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
Description copied from interface:IPreferenceControllerRetrieves a doctor's scheduling preferences in DTO form- Specified by:
getUsersPreferenceDTOsin interfaceIPreferenceController- Parameters:
dto- A DTO containing the doctor's id for the search- Returns:
- A list of PreferenceDTOOut representing the doctor's scheduling preferences
-
editPreferences
public List<PreferenceDTOOut> editPreferences(@Valid @Valid EditedPreferencesDTOIn dto) throws DatabaseException Description copied from interface:IPreferenceControllerEdits the scheduling preferences of a doctor, eventually creating new ones and removing the not anymore needed ones- Specified by:
editPreferencesin interfaceIPreferenceController- 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
Description copied from interface:IPreferenceControllerRetrieves a user's scheduling preferences- Specified by:
getUserPreferencesin interfaceIPreferenceController- Parameters:
dto- A DTO containing the doctor's id for the search- Returns:
- A list of doctor's scheduling preferences
-