Skip to content

hcz1/basketConversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basket Currency Conversion

Pre-req

  1. Node
  2. npm

Running

  1. npm install
  2. npm start
  3. npm test

Testing

  1. npm test

Usage

  • Can configure prices of items and discounts in config.js
  • REST API
  • POST to localhost:8081/basket
  • HEADER: Content-Type:application/json
  • POST BODY (JSON):
  {
    "items": Array<"Soup" | "Bread" | "Milk" | "Apples">,
    "currency" : "GBP" | "EUR" | "USD"
  }
  • Response:
  {
    "subTotal": number,
    "discounts": Array<"Apples 10% off" | "3 Milk 50 cents off"> | [],
    "discountAmt": number,
    "total": number,
    "currency": "GBP" | "EUR" | "USD"
  }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published