Interface MenuApi


public interface MenuApi
MenuApi contains all the api operations handling Menu in the DzidziApp.
  • Method Details

    • findMenuById

      Menu findMenuById(UUID menuId)
      Finds a menu by id.
      Parameters:
      menuId - the id of the menu
      Returns:
      the menu found
      Throws:
      com.dzidzi.exception.EntityNotFoundException - when the menu is not found
    • createMenu

      Menu createMenu(AddMenuRequest addMenuRequest)
      Adds/create a new menu by the logged in restaurant user.
      Parameters:
      addMenuRequest - the AddMenuRequest containing the properties to create/add a new menu.
      Returns:
      the menu created/added
      Throws:
      com.dzidzi.exception.DzidziException - when image is unable to load
    • editMenu

      Menu editMenu(ChangeMenuRequest changeMenuRequest)
      Changes a field/all fields of an existing extra.
      Parameters:
      changeMenuRequest - the ChangeMenuRequest containing the properties to change the existing menu.
      Returns:
      the updated menu.
      Throws:
      com.dzidzi.exception.DzidziException - when image is unable to load
    • deleteMenu

      void deleteMenu(UUID menuId)
      Removes an extra by extra id and logged in restaurant. You can only delete a restaurant only if you are logged in as UserRole.RESTAURANT_ADMIN or UserRole.RESTAURANT_BRANCH and the extra belongs to the logged in restaurant.
      Parameters:
      menuId - the id of the menu
    • findMenus

      DzidziPaginationDTO<Menu> findMenus(FindMenuRequest findMenuRequest)
      The paged results of the provided request.
      Parameters:
      findMenuRequest - the request used for filtering menus
      Returns:
      the DzidziPaginationDTO
    • bulkAddMenuJob

      com.dzidzi.job.dto.Job bulkAddMenuJob(com.dzidzi.job.dto.MenuJobRequest menuJobRequest)
      An async job is triggered to make bulk addition of menus
      Parameters:
      menuJobRequest - the request body
      Returns:
      the Job
    • enableMenusVisibilityJob

      com.dzidzi.job.dto.Job enableMenusVisibilityJob(List<UUID> menuIds)
      An async job that enables the visibility of bulk extras to users.
      Parameters:
      menuIds - the menu ids to enable
      Returns:
      the Job
    • disableMenusVisibilityJob

      com.dzidzi.job.dto.Job disableMenusVisibilityJob(List<UUID> menuIds)
      An async job that disabled the visibility of bulk menus to users.
      Parameters:
      menuIds - the menu ids to disable
      Returns:
      the Job
    • enableMenuVisibility

      void enableMenuVisibility(UUID menuId)
      An menu is enabled to be visible by users.
      Parameters:
      menuId - the menu id to enable
    • disableMenuVisibility

      void disableMenuVisibility(UUID menuId)
      A menu is disabled to be invisible to users.
      Parameters:
      menuId - the menu id to disable