"Checkout" and "scanning" function that calculates the total sum to be paid for the checked out products
- Clone the repo
- Run
yarn
ornpm i
to install the required dependencies - Run
yarn start
ornpm start
to execute the function and view the result in the console - Scan any amount of products to get the total cost of them
- Function that calculates the total sum of the products in the database (mock data in our case)
- Is present a 2-for-1 promotion for the
Voucher
product (buy 2, get 1 free) - Is present a bulk offer for the
T-shirt
product (buy 3 or more, the price of that product is reduced by one) - The function uses TypeScript to ensure a smooth workflow regarding the data that is being received and computed against
- The app contains unit testing with Jest library
- To run the test, run
yarn test
ornpm test
- Node
- Typescript