/**
  * Returns the amount of money that the customer with the given customer ID has available for
  * making purchases.
  *
  * @param customerId the customer ID
  * @return the customer's credit amount
  */
 @Transactional(readOnly = true)
 public double getCustomerCredit(String customerId) {
   Customer customer = storeDAO.getCustomer(customerId);
   return customer.getCredit();
 }
 /**
  * Sets the amount of money that the customer with the given customer ID has available for making
  * purchases.
  *
  * @param customerId the customer ID
  * @param credit the new customer credit amount
  */
 @Transactional
 public void setCustomerCredit(String customerId, double credit) {
   Customer customer = new Customer(customerId, credit);
   storeDAO.save(customer);
 }
 /**
  * Returns the price of the product with the given product ID.
  *
  * @param productId the product ID
  * @return the product's price
  */
 @Transactional(readOnly = true)
 public double getPrice(String productId) {
   Product product = storeDAO.getProduct(productId);
   return product.getPrice();
 }
 /**
  * Returns the number of items in stock of the product with the given product ID.
  *
  * @param productId the product ID
  * @return number of items
  */
 @Transactional(readOnly = true)
 public long getInventory(String productId) {
   Product product = storeDAO.getProduct(productId);
   return product.getInventory();
 }
 /**
  * Sets the inventory and price for the product with the given product ID. Any previous inventory
  * and price values for the product are replaced.
  *
  * @param productId the product ID
  * @param price the price of the product
  * @param inventory the number of items in stock
  */
 @Transactional
 public void stock(String productId, double price, long inventory) {
   Product product = new Product(productId, price, inventory);
   storeDAO.save(product);
 }
 /**
  * Returns a list ids of products out of stock
  *
  * @return list of product ids
  */
 @Transactional(readOnly = true)
 public List<String> getOutOfStock() {
   return storeDAO.getOutOfStockProductIds();
 }