SHARE
TWEET

Untitled

a guest Jun 16th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module shoppingCart{
  2.     struct Product{
  3.         long productId;
  4.         string productName;
  5.         double productPrice;
  6.         long productQuanity;
  7.     };
  8.  
  9.     struct ProductOrder {
  10.         long productOrderId;
  11.         Product product;
  12.         long productOrderQuanity;
  13.     };
  14.  
  15.     typedef sequence<Product> ListOfProducts;
  16.     typedef sequence<ProductOrder> Orders;
  17.    
  18.     struct Cart {
  19.      Orders orders;
  20.     };
  21.  
  22.     interface Shop {
  23.         ListOfProducts showAvailableProducts();
  24.         string createNewCart();
  25.     };
  26.  
  27.     interface CartManager {
  28.         string createNewCart();
  29.         Cart addToCart(in ProductOrder productOrder);
  30.         Cart removeFromCart(in ProductOrder productOrder);
  31.         Cart checkOutCart();
  32.     };
  33. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top