Giter Site home page Giter Site logo

makers-test's Introduction

Honeycomb Engineering Test - Makers Edition

The challenge

From Honeycomb:
"We have a system that delivers advertising materials to broadcasters.

Advertising Material is uniquely identified by a 'Clock' number e.g.

  • WNP/SWCL001/010
  • ZDW/EOWW005/010

Our sales team have some new promotions they want to offer so we need to introduce a mechanism for applying Discounts to orders.

Promotions like this can and will change over time so we need the solution to be flexible."

My approach

There were some example code provided by Honeycomb.
My idea was to pretend this code was the one already in production.

Therefore, I used the same approach that I would take in a real environment.
I started with changing the implementation as less as possible, writing tests first, then 'go to green' and after refactor.

The outcome

A Discount can be initialized and then used with several Orders.

Also, a DiscountManager can be initialized and many Discount objects can be registered within it.
Then, the same DiscountManager can be used on several Order objects, thus making it easier to create a discount campaign and apply it to several Orders.
Because DiscountManager share a similar interface to Discount, it's implementation doesn't add any extra levels of complexity on top the code.

Installation

  • Download repo: git clone [email protected]:mrenrich84/makers-test.git
  • You might need to install used Ruby version: rvm install ruby-2.3.3
  • Install all dependencies: bundle install

Running

You can either run it through:

  • rspec
  • ruby run.rb

Backlog

Having more time I would have liked to:

  • extrapolate abstract behaviours from PrinterOrder, so to have a more dynamic Printer system
  • add name properties to the Discount objects in order to be able to show them in the order report

makers-test's People

Contributors

antstorm avatar erikologic avatar worldofchris avatar

Watchers

 avatar  avatar

Forkers

shezdev

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.