xepps / GET-total

Another TDD champions challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The GET /total Challenge

You have been tasked with making an API for a shopping cart.

Your api should take a list of one or more items by id or slug, reduce the total by any supplied discount code (only one code can be applied) and provide a total price for those items.

You should check that there are enough items availble to buy and return a suitable error.

You can find the item and discount data in the data directory

Notes

You should write your solution in node JS.

The design of the API is up to you, so long as it works, is sensible and starts with /total - anything goes!

You can use any node libraries to complete this exercise (it's a good idea to start with something like express or koa)!

We expect an adequate level of unit/integration testing for this application - for example, jest with supertest works well, but the choice is yours!

Your application should be able to be run locally, and have adequate instructions to allow us to run the server locally.

Please host your code on github and send us the link for us to verify.

About

Another TDD champions challenge