return info of product and stock (makes call to two tables) and returns json of combination data
-- search product table by productId, then if exist search stock table via productId
(HAPPY) if more than one type of stock entry for productId, ie different amounts ie 2 pack or 6 pack, return json array
-- (SAD) Catch no input for /productcheck? either wrong query key used or nothing used (unit??)
--- if both queries are present, use first only
M002 - Show all products with amounts in stock
GET /products
response (HAPPY) array of json objects like from M001a
response (HAPPY) empty array if no products in stock OR all products that stocked but with 0 amounts
No products exists -> not the case as this will always be filled and never deleted
M003 - Add a product with stock
Add product with no stock, set stock to default as 0
Add product with multiple stock
POST using JSON body to pass in ProductName, Amount, Description
ProductId is automatically generated and inserted
Returns 201
Two tables - Product and Stock OR one table?
If number of stocked products == 10, then return error, make configurable
M004 - Update a product
various fields (name/description/id)
POST
M005 - Update stock of a product
various fields (name/description/id)
POST
M006 - Remove stock of a particular product
One type of stock
two types of stock reduced to one
After removal, no more stock but product still there
POST
M007 - Add product
No stock to be added
POST
M009 - Get contents of basket
GET /basketcontents
repsonse json...
Epic - buy items
add products to basket (json list of product and amount and return amount of basket)
Checkout basket (create transaction event)
send details ( send json of address, payment etc)
confirm (send post no body, return ok, clear basket, )
Events - same aggregate
create basket with new items and total
add item, includes total
new transaction
confirm details
shopping completed
M008 - Add a product to the basket
POST /addtobasket
req body {productid: ..., amount:...}
in stock
out of stock
response is call to GET /basketcontents
update addToBasketEvent
M - Checkout basket contents
store details of customer
POST /checkout
M - confirm order
M - Refund
M - Remove products from basket
update addToBasketEvent
one item with amount
-- deal with remove too many ??
POST /addtobasket
req body {productid: ..., amount:...}
in stock
out of stock
response is call to GET /basketcontents
M - Get contents of basket for returning customer (not log in)
M- wishlist
MXXX - display suggestions for products based on past transactions and basket contents
MXXX - Registration and Login
MXXX - Have customer facing interface (GUI) to access shop
M001 - Check the stock by product name
M001a - Check the stock by product id
M002 - Show all products with amounts in stock
M003 - Add a product with stock
M004 - Update a product
M005 - Update stock of a product
M006 - Remove stock of a particular product
M007 - Add product
M009 - Get contents of basket
Epic - buy items
Events - same aggregate
M008 - Add a product to the basket
M - Checkout basket contents
M - confirm order
M - Refund
M - Remove products from basket
M - Get contents of basket for returning customer (not log in)
M- wishlist
MXXX - display suggestions for products based on past transactions and basket contents
MXXX - Registration and Login
MXXX - Have customer facing interface (GUI) to access shop