/** * 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); }
/** * 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); }