Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To have a real functioning shopping cart, a user must be able to do the following: 1. Add items to the shopping cart 2. Delete

To have a real functioning shopping cart, a user must be able to do the following:
1. Add items to the shopping cart
2. Delete items from the shopping cart
3. Update a quantity of a shopping cart entry
4. Perform a checkout operation by converting the shopping cart entriesinto an Order with its
respective Order Items and then delete all shopping cart entries for that particular user
(customer). This should happen all as part of a single transaction.
A user should never be able to perform a checkout on an empty shopping cart. Throw a custom
exception if this is tried and return that exception to the user.
In order to complete this assignment, you will need to implement the following:
CRUD operations for shopping cart entries.
Implement a checkout operation.
Be able to list all previous orders.
Be able to list all entriesin the shopping cart.
Implement all of the user needs stated above (like performing a checkout operation)
You will need a shopping cart service to implement the checkout operation.
You will also need a controller to handle all of the various CRUD and checkout operations.
Some urls might look like the following:
/users/{customerId}/shoppingcart/{shoppingcartentryid}
/users/{customerid}/shoppingcart?checkout=true
public class ShoppingCartEntry {
@Id
private Long id;
@Column(name="product_id")
private Long productId;
private int quantity;
@Column(name="customer_id")
private Long customerId;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago