Skip to content

The promotions resource is a representation of a special promotion or sale that is running against a product or perhaps the entire store. Some examples are "buy 1 get 1 free", "20% off", etc. Discount promotions usually apply for a given duration (e.g., sale for 1 week only). It's up to you to get creative. You should use Python enumerations to …

License

Notifications You must be signed in to change notification settings

CSCI-GA-2820-FA22-001/promotions

Repository files navigation

Promotions Service

Build Status Build Status codecovLicense made-with-python

This repository contains sample code for Customer promotions for an e-commerce web site. This shows how to create a REST API with subordinate resources.

Information about this repo

These are the RESTful routes for promotions

Endpoint          Methods  Rule
----------------  -------  -----------------------------------------------------
index             GET      /

list_promotions     GET      /promotions
create_promotion   POST     /promotions
get_promotion     GET      /promotions/<promotion_id>
update_promotion   PUT      /promotions/<promotion_id>
delete_promotion   DELETE   /promotions/<promotion_id>

The test cases have 95% test coverage and can be run with nosetests

Deployment

  • Open in DevContainer

make login Logs into ibmcloud (you must have your api key in your host ~/.bluemix/apikey.json to be mounted by dev container)

kubectl get all See everything thats running

kubectl get svc See services

ibmcloud ks workers --cluster nyu-devops Get public ip of Kube worker node

Runs on WORKERNODE_PUBLIC_IP:31000

On first deploy:

make build

kubectl apply -f deploy/postgresql.yaml Deploys postgres db

kubectl create -f deploy/deployment.yaml Deploys app using our promotions image, creates deployment, replicaset and pods

kubectl create -f deploy/service.yaml Make accessible through service

License

About

The promotions resource is a representation of a special promotion or sale that is running against a product or perhaps the entire store. Some examples are "buy 1 get 1 free", "20% off", etc. Discount promotions usually apply for a given duration (e.g., sale for 1 week only). It's up to you to get creative. You should use Python enumerations to …

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published