Package UI.InventoryPages
Class InventoryManagementPage
java.lang.Object
Common.UserInterface
UI.InventoryPages.InventoryManagementPage
The
InventoryManagementPage
class provides functionality for managing
the inventory of medicines. It extends UserInterface
and interacts
with the InventoryManager
to perform operations such as viewing,
adding, updating, and removing medicines.-
Field Summary
Fields inherited from class Common.UserInterface
scanner
-
Constructor Summary
ConstructorsConstructorDescriptionInventoryManagementPage
(InventoryManager inventoryManager) Constructs anInventoryManagementPage
with the specifiedInventoryManager
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Displays options for managing the inventory and handles user input.void
Prompts the user to add a new medicine to the inventory.void
handleAddStock
(String medicine) Prompts the user to add stock for a specified medicine.void
handleEditStock
(String medicine) Prompts the user to change the stock value of a specified medicine.void
Prompts the user to remove a medicine from the inventory.void
handleRemoveStock
(String medicine) Prompts the user to remove stock from a specified medicine.void
handleUpdateAlertLevel
(String medicine) Prompts the user to update the alert level for a specified medicine.void
Allows updating of stock levels for medicines in the inventory.void
Displays all items in the inventory.Methods inherited from class Common.UserInterface
displayError, displaySuccess, getIntInput, getNumericString, getValidatedInt, getValidatedString, pauseAndView
-
Constructor Details
-
InventoryManagementPage
Constructs anInventoryManagementPage
with the specifiedInventoryManager
instance.- Parameters:
inventoryManager
- the manager used to handle inventory operations
-
-
Method Details
-
displayOptions
public void displayOptions()Displays options for managing the inventory and handles user input. -
handleViewInventory
public void handleViewInventory()Displays all items in the inventory. -
handleAddMedicine
public void handleAddMedicine()Prompts the user to add a new medicine to the inventory. -
handleRemoveMedicine
public void handleRemoveMedicine()Prompts the user to remove a medicine from the inventory. -
handleUpdateStock
public void handleUpdateStock()Allows updating of stock levels for medicines in the inventory. -
handleAddStock
Prompts the user to add stock for a specified medicine.- Parameters:
medicine
- the name of the medicine for which stock is being added
-
handleRemoveStock
Prompts the user to remove stock from a specified medicine.- Parameters:
medicine
- the name of the medicine from which stock is being removed
-
handleEditStock
Prompts the user to change the stock value of a specified medicine.- Parameters:
medicine
- the name of the medicine whose stock value is being changed
-
handleUpdateAlertLevel
Prompts the user to update the alert level for a specified medicine.- Parameters:
medicine
- the name of the medicine whose alert level is being updated
-