Currently, the system requires additional logic to differentiate between individual products and carts containing collections of products, which complicates its maintenance and scalability. To address this, we propose implementing the Composite design pattern, allowing products and carts to be treated uniformly through a common interface. This will simplify cart manipulation, removing unnecessary conditionals and improving system flexibility.
