- 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?
- 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
- added date
- unit price
- shipping address
- total price
- check if cart exist or not
- empty cart
- create cart
- load cart
- update cart
- delete cart ?
- 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