Package Controllers

Class InventoryRequestManager

java.lang.Object
Controllers.InventoryRequestManager

public class InventoryRequestManager extends Object
The InventoryRequestManager class manages inventory requests. It allows adding new requests, approving existing requests, and displaying all requests.
  • Constructor Details

    • InventoryRequestManager

      public InventoryRequestManager(InventoryRequestDatabase inventoryRequestDatabase)
      Constructs an InventoryRequestManager for handling requests only.
      Parameters:
      inventoryRequestDatabase - the InventoryRequestDatabase used to manage inventory requests
    • InventoryRequestManager

      public InventoryRequestManager(InventoryRequestDatabase inventoryRequestDatabase, InventoryManager inventoryManager)
      Constructs an InventoryRequestManager for handling both requests and approvals.
      Parameters:
      inventoryRequestDatabase - the InventoryRequestDatabase used to manage inventory requests
      inventoryManager - the InventoryManager used to manage inventory stock
  • Method Details

    • addRequest

      public boolean addRequest(String medicine, int value)
      Adds a new inventory request.
      Parameters:
      medicine - the name of the medicine requested
      value - the quantity of the medicine requested
      Returns:
      true if the request was added successfully; false if the value is less than or equal to zero
    • approveRequest

      public boolean approveRequest(String medicine, int value)
      Approves an existing inventory request and updates the stock accordingly.
      Parameters:
      medicine - the name of the medicine to approve
      value - the quantity of the medicine to approve
      Returns:
      true if the request was approved successfully; false if not found
    • displayAllRequests

      public void displayAllRequests()
      Displays all current inventory requests.