area1707/grace-shopper

Data Validations - Orders

Opened this issue · 1 comments

Orders must belong to a user OR guest session
Orders must contain line items that capture the price, current product ID and quantity
If a user completes an order, that order should keep the price of the item at the time when they checked out even if the price of the product later changes

Implementation:
Create orders schema in sequelize
A new order request creates a new order instance in our db, which will include user or guest information
<How to associate accessories with orders?>

Outstanding:

  1. Order must belong to a guest session - need to do this on the frontend - to always show order in cart in the current session of browser
  2. Orders must contain line items...: front end
  3. save history of price: look into redux-state-history https://www.npmjs.com/package/redux-state-history