Giter VIP home page Giter VIP logo

smile-widget-code-challenge's Introduction

smile-widget-code-challenge

The Smile Widget Company currently sells two types of smile widgets: a Big Widget and a Small Widget. We'd like to add more flexibility to our product pricing.

Setup with Docker

  1. Install Docker (https://docs.docker.com/install/)
  2. Fork this repository.
  3. >>> docker-compose up --build

Setup without Docker

  1. Install Python (>3.4)
  2. Install postgres. By default the Django app will connect to the database named 'postgres'. See settings.DATABASES.
  3. Fork this repository, then clone your repository locally.
  4. Install requirements.
  • >>> pip install -r requirements.txt
  1. Run migrations.
  • >>> python manage.py migrate
  1. Load data from fixtures:
  • >>> python manage.py loaddata 0001_fixtures.json

Technical Requirements

  • We currently have two products with the following prices:
    • Big Widget - $1000
    • Small Widget - $99
  • These products, along with existing gift cards are already setup in the database. Study the existing models and initial data.
  • Create a new ProductPrice model and setup the following price schedule:
    • Black Friday Prices (November 23, 24, & 25)
      • Big Widget - $800
      • Small Widget - FREE!
    • 2019 Prices (starting January 1, 2019)
      • Big Widget - $1200
      • Small Widget - $125
  • Build a JSON API endpoint that accepts a product code, date, and (optional) gift card and returns product price.
    • The endpoint should live at api/get-price and accept the following parameters:
      • "productCode"
      • "date"
      • "giftCardCode"
  • Make all of your changes in a new feature branch and submit a pull request to your own forked repo.

Additional Information

  • Please use Django Rest Framework or a Python HTTP framework of your choice to create the endpoint.
  • Just as a general guideline, we've designed this exercise to take less than 4 hours.

smile-widget-code-challenge's People

Contributors

johnwquarles avatar

Watchers

James Cloos avatar D Sri Rama Krishna Vardhan 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.