about cart

  • what need to be considered?
  • use id as key or user id as key?
    • domain class will create id automatically
    • not sure which id will be assigned to specific user
    • user id is uniqueue
  • 1 device have 1 cart?
    • no, may have more user use the same device
    • for local storage, how to address it?
      • empty all the storage when logout or
      • have different variable for local storage
        • other people can see the other user’s token etc., not safe
    • => empty all local storage once logout
  • one user just have 1 cart?
    • yes
  • when the same user login from different device
    • the cart will be loaded and updated
  • keep cart in client?
    • no, need to be persisted in server
    • when to update?
      • whenever the change is done
  •  cart ds
    • state
    • userid
    • itemlist
      • productId
      • added date
      • #
      • unit price
      • attribute
      • notes
    • shipping address
    • total price
  •  operation
    • check if cart exist or not
    • empty cart
    • create cart
    • load cart
    • update cart
    • delete cart ?
  •  id
    • is it needed?
    • relationship btw. this id & the domain class id?
  • user id => createBy
  • create time => createDate
  • product list
    • product id
    • do we need product details?
      • what if the product changed?
      • product attribute selected
    • amount entered
    • shipping address for each product or for 1 cart?
  • for cart
    – use local storage or not?
    – if no, how to update the cart?
    – http cache just give the existing cart

    – read cart -> update obj -> post the cart ->
    – worthy it spend so much time?
    – just update server each time, there won’t be many update
    – or after each post, run another get to update cache
    – leave the update in the server side only
    – cw do it in the server side
    – for add2cart
    . just post the new prod there and leave it to server side to handle
    . why need to load? no need

This entry was posted in Design. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s