E-commerce sites are pretty complicated, but when you get to the core functionality, they really only do a few things:
- Display a product with some details
- Allow you to indicate that you want to purchase it by "adding" it to your "cart"
- Allow you to manage your "cart"
- Present you the cart, with any additional fees, for purchasing
- Collect your address and payment information
- Charge your credit card
We don't want to complicate this too much but we really want to be able to see a list of categories of products and then a list of products in that category. Also, we should be able to see a specific product.
GET /categories
<- shows a list of categoriesGET /categories/{category}
<- shows a list of products for that categoryGET /products/{product}
<- shows detail of a given product
You can add products to the cart, update product quantity in the cart, delete products from the cart and list the cart contents and total
GET /cart
<- shows cart with total/status/etcPOST /cart
<- add product to cart (creates cart if not created)PUT /cart
<- update product in cart (delete)
For checkout, you'll be shown the cart total/items and then enter your shipping address and billing information
GET /checkout
<- show cart with address informationPOST /checkout
<- process checkout and redirect to order
GET /orders/{order}
<- show order details and statusGET /orders
<- show all orders
- uuid
- name
- timestamps
- uuid
- sub_total
- shipping_cost
- total
- user_id
- status
- order_date
- order_ip
- timestamps
holds information about the products in an order
- uuid
- order_id
- product_id
- sku
- name
- description
- price
- quantity
- subtotal
- timestamps
holds information about the changes in statii for an order
- uuid
- order_uuid
- previous_status
- new_status
- notes
- timestamps
- uuid
- sku
- name
- description
- regular_price
- discounted_price
- stock_quantity
- lead_time
- timestamps
xref between products and categories - a category "has many" products and a product can "belong to" many categories
- id
- category_uuid
- product_uuid
- timestamps
- uuid
- product_uuid
- image_url
- default
- timestamps
- uuid
- product_uuid
- tag_uuid
- timestamps
- uuid
- tag
- timestamps
- uuid
- encrypted_password
- first_name
- last_name
- one_time_signin_token
- one_time_signin_token_sent_at
- sign_in_count
- current_sign_in_at
- last_sign_in_at
- current_sign_in_ip
- last_sign_in_ip
- failed_attempts
- locked_at
- timestamps
- uuid
- user_uuid
- provider
- provider_user_id
- provider_details
- timestamps