Question: Create a shopping cart application me application must do the following: List products for sale User can add products to a shopping cart (We can
Create a shopping cart application
me application must do the following:
List products for sale
User can add products to a shopping cart (We can hardcode the user, no need for Spring Security)
A User can update quantities ot a particular object in their shopping cart
A User can checkout (which will turn a shopping cart into an order and associated order items).
A user can view their shopping cart
A user can view previous orders
A user can view a particular order and see its order items.
An Admin can add products since there is no actual security, simply put admin functions behind the /admin url. An example might be /admin/products/new).
An Admin can delete products
An admin canupdate products
An admin can add product types
An admin can view all orders in the system.
Main Data Types create table countries (
id int auto increment primary key
varchar (60)
create table users
id bigint auto increment primary key, first name varchar (60) , last _name varchar (60) username varchar (60) ,
password varchar (20)
country id bigint
create tabli e product types
id , bigint auto increment primary Key, type name varchar (40)
create table products
id bigint auto increment primary key,
sku varchar (30), name varchar (60) ,
description varchar (255), product_type _id bigint, price numeric
create table shopping cart (
id bigint auto increment primary key, product id bigint, quantity int, customer id bigint
create table orders (
id bigint auto increment primary key, order date datetime,
credit card last four varchar (4), customer id bigint, order amount numeric, tax numeric, shipping numeric
create table order items (
id bigint auto increment primary key order id bigint, product id bigint, quantity int, price numeric
Notes
Use the H2 in Memory Database. Go ahead and pre-populate some of the database tables like Users, Products, Product Types, old Orders and associated order items.
Use a simple web interface with either Thymeleaf or JSPs. It doesn't have to be fancy or use sophisticated JavaScript.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
