Git Product home page Git Product logo

tm-react-checkout's Introduction

The problem

TextMaster's quest for global domination has prompted us to open a supermarket - we sell only three products:

+--------------|--------------|---------+
| Product Code |     Name     |  Price  |
+--------------|--------------|---------+
|     FR1      |   Fruit tea  |  $3.11  |
|     AP1      |   Apple      |  $5.00  |
|     CF1      |   Coffee     | $11.23  |
+--------------|--------------|---------+

Our CEO is a big fan of buy-one-get-one-free offers and of fruit tea. He wants us to add a rule to do this.

The COO, though, likes low prices and wants people buying apple to get a price discount for bulk purchases. If you buy 3 or more apples, the price should drop to $4.50. Our check-out can scan items in any order, and because the CEO and COO change their minds often, it needs to be flexible regarding our pricing rules.

Contained within this repository is a working React/Redux application which when running looks like this:

checkout image

Clicking the product buttons adds items to the basket, the items in the basket are listed and the total is displayed.

Extend this system so that it supports the buy-one-get-one-free and three-or-more discounts. Ideally the system will show the user which discounts are being applied, but it's not essential.

Running the project

The project uses create-react-app as a starter kit. To run it the steps should be:

  • ensure you have a recent version of node and npm
  • npm install
  • npm run start

Submitting your solution

Please send a zip archive containing your code (without the node_modules directory) and any relevant materials in an email along with your resume and motivations to [email protected], please add [email protected] in CC. Please do not put your solutions on GitHub.

The purpose of this test is to verify your abilities to code and see how you architect an application.

Finally, please note that even if you have questions about the test we will not answer them, do what you think is best.

tm-react-checkout's People

Contributors

lukesaunders avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.