Giter VIP home page Giter VIP logo

checkoutsystemwithdynamicpricingrule's Introduction

Checkout System WIth Dynamic Pricing Rule

We want to offer below products to customers:

Name Description Retail Price
Small Pizza 10” pizza for one person $269.99
Medium Pizza 12” pizza for two people $322.99
Large Pizza 15” pizza for four people $394.99

We have established a number of special pricing rules for a small number of privileged. customers:

  1. Infosys
    • Gets a 3 for 2 deal for Small Pizzas
  2. Amazon
    • Gets a discount on Large Pizza where the price drops to $299.99 per pizza
  3. Facebook
    • Gets a 5 for 4 deal on Medium Pizza
    • Gets a discount on Large Pizza where the price drops to $389.99 per pizza

These details are regularly renegotiated, so we need the pricing rules to be as flexible as possible as they can change in the future with little notice.

The interface to our checkout module looks like this pseudocode:

Checkout co = Checkout.new(pricingRules)
co.add(item1)
co.add(item2)
co.total()

Example scenarios:

Customer: default
Items: `small pizza`, `medium pizza`, `large pizza`
Total: $987.97

Customer: Infosys
Items: ` small pizza `, ` small pizza `, ` small pizza `, ` large pizza `
Total: $934.97

Customer: Amazon
Items: ` medium pizza `, ` medium pizza `, ` medium pizza `, ` large pizza `
Total: $1294.96

checkoutsystemwithdynamicpricingrule's People

Contributors

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