Currently, we initialize CartItem within addItemToCart(:), and provide it with an unique ID. This acts as unique identifier to differentiate between multiple items in the cart that could share the same product ID
We should consider if, for testability, we should create the CartItem and it's ID not as a side effect of "adding items to cart", but as a separate method. On the other end, this UUID is exclusively of internal usage for the CartView, so perhaps is not needed to expose it.
Currently, we initialize CartItem within
addItemToCart(:)
, and provide it with an unique ID. This acts as unique identifier to differentiate between multiple items in the cart that could share the same product IDWe should consider if, for testability, we should create the
CartItem
and it's ID not as a side effect of "adding items to cart", but as a separate method. On the other end, this UUID is exclusively of internal usage for the CartView, so perhaps is not needed to expose it.