Question: Assignment 8 - Shopping Cart Implementation This assignment is to use the existing shopping cart code and turn it into a real functioning shopping To

Assignment 8 - Shopping Cart Implementation

This assignment is to use the existing shopping cart code and turn it into a real functioning shopping

To have a real functioning shopping cart, a user must be able to do the following:

Add items to the shopping cart

Delete items from the shopping cart

Update a quantity of a shopping cart entry

Perform a checkout operation by converting the shopping cart entries into 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 entries in 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/{customerld}/shoppingcart/{shopping cartentryid} /users/{customerid]/shoppingcart?checkout=true

public class ShoppingcartEntry

dId

private int id;

@Column (name="product id")

private int productid;

private int quantity;

@Column (name="customer _id")

private int customerId;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!