Module CI

Class StockRW

java.lang.Object
com.shr4pnel.db.StockR
com.shr4pnel.db.StockRW

public class StockRW extends StockR
Implements read/write access to the stock database.
Since:
v0.1.0
Author:
shrapnelnet
See Also:
  • Constructor Details

    • StockRW

      public StockRW() throws com.shr4pnel.middleware.StockException

      Constructor for StockRW.

      Throws:
      com.shr4pnel.middleware.StockException - if any.
  • Method Details

    • addStock

      public void addStock(String pNum, int amount)
      Adds stock (Re-stocks) to the store. Assumed to exist in database.
      Parameters:
      pNum - Product number
      amount - Amount of stock to add
    • addOrder

      public void addOrder(UUID uuid)
      Adds a new order to the OrderTable.
      Parameters:
      uuid - A UUID, which is used as a primary key, as well as a foreign key in BasketTable
    • addBasket

      public void addBasket(UUID orderID, String pNum, int quantity)
      Add an item to the BasketTable
      Parameters:
      orderID - The ID of the order that the item belongs to
      pNum - The Product Number of the item
      quantity - The amount of the item to add
    • packOrder

      public boolean packOrder(String orderID)
      Deletes an order, and all associated basket items from the database to simulate the order being packed.
      Parameters:
      orderID - The order ID to be removed
      Returns:
      true, if successful