public OrderStatus buy(int aItemId, int quantity) throws UnknownArticleException { Item orderedItem = stockDao.getItem(aItemId); if (orderedItem == null) { throw new UnknownArticleException(); } if (stockDao.addOrder(orderedItem, quantity)) { return new OrderStatus(orderedItem, ++orderId); } else { return new OrderStatus(orderedItem); } }
public List listStock() { return stockDao.getCurrentStock(); }