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 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

      void deletePreference(PreferenceDoctorIDDTO dto) throws DatabaseException
      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

      List<PreferenceDTOOut> getUsersPreferenceDTOs(DoctorIdDTO dto)
      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 PreferenceDTOOut representing the newly updated preferences (gives to the receiver the ids of the newly defined ones, too
      Throws:
      DatabaseException - upon deletion errors
    • getUserPreferences

      List<Preference> getUserPreferences(DoctorIdDTO dto)
      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