implement simple cart and promotion
https://medium.com/analytics-vidhya/virtual-environment-6ad5d9b6af59
pip install -r requirements.txt
create new database, in this case we're using postgresql
create file .env in the root of the folder, and fill with you credential of your database
DB_USER = ""
DB_PASSWORD = ""
DB_HOST = ""
DB_PORT = ""
DB_NAME = ""
FLASK_DEBUG = true
run flask create
to create tables from models.
run this query from your db client
INSERT INTO public.product (sku,brand,"name",description,price,non_discountable) VALUES
('ABCKM5','ABC','kecap manis ABC 500ml','kecap manis abc 500ml',25000.0,false),
('INDOSKM25','Indofood','Susu kental manis 250ml','Susu kental manis 250ml',15000.0,false),
('LIOML1','Lion','Mamalemon 1000ml ','Mamalemon 1000ml ',21000.0,false),
('INDOBR','Indofood','Bumbu racik','Bumbu racik',2500.0,false),
('ABCS25','ABC','Sambal 250ml','Sambal 250ml',15000.0,false),
('INDOIGS','Indofood','Indomie goreng special','Indomie goreng special',3000.0,false),
('MYRLM1','mayora','le minerale 1000ml','le minerale 1000ml',8000.0,true);
to run the web app simply use
flask run
to access swagger use url localhost:5000/apidocs
- Cart Update
- Same product validation on cart
- Unit test
- Unit test coverage
- CI setup