Giter Site home page Giter Site logo

alecla / shopping-cart-discount-code-kata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stiltet/shopping-cart-discount-code-kata

0.0 2.0 0.0 52 KB

This is a code kata in both C# and JavaScript to be used for developer team training.

License: MIT License

C# 4.41% HTML 0.53% JavaScript 95.05%

shopping-cart-discount-code-kata's Introduction

Shopping Cart Discount Code Kata

What is this?

This is a code kata in both C# and JavaScript to be used for developer team training. The code kata are exactly the same in all languages. I use this kata primarly for so called Randori Katas, see more bellow. :)

Shopping cart code kata requirements:

The system shall allways chose the best possible discount for the customer. If multiple discounts are valid shall the system allways chose the largest discount first and there after the other in descending order.

  1. Calculate cart with items price and add a shipping cost of 50SEK.
  2. a) Free shipping when total price of all items in cart exceeds 400SEK.
    b) Free shipping when the cart contains more than 5 different items.
  3. If there are 5+ of the same item there should be a volume discount of 10% that's only valid on that specific item.
  4. Regular custumers gets 10% discount on the whole cart.
  5. Winter holidays sale (Mellandagsrea) 50% on all items in cart between boxing day and new years eve. (Can't be combined with 3 or 4)
  6. Expired items with a stock balance of less then 10 gives 40% discount. (Can't be combined with 3, 4 or 5)
  7. Discount voucher gives customers 15% total cart disount on one purchase. (Can't be combined with 4, 5 or 6)

Rules of a Randori Session

  • The presenter explains the coding challenge and devides the group into teams of approx. 5 persons
  • The presenter starts the Randori with a pair from audience.
  • The pair will use TDD (Test-Driven Development).
  • Only one in the pair are allowed to touch the keyboard.
  • One half of the pair is changed every 5 minutes. The one coding goes in the audience and the other part of the pair starts coding with a new partner.
  • The pair on the keyboard should continuously explain what they are doing.
  • The audience are not allowed to intervene in the coding, but are allowed to ask the coding pair questions.
  • The pair coding should stop when someone from the audience falls off the sled โ€” and only continue when that someone is back on track again.

Happy coding! :)

Open source?

This code kata are created by Stellan Lindell. The code kata source code are completly open source and free to use, both for personal and comercial purposes. Licensed under the MIT Licence.

shopping-cart-discount-code-kata's People

Contributors

stiltet 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.