Skip to content

lcpulzone/bulk-discounts

 
 

Repository files navigation

Bulk Discounts

An extension to the project Little Esty Shop
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Schema
  4. Contributing
  5. Contact
  6. Acknowledgements

About The Project

forthebadge
tested with rspec

This solo project is an extension of a group project called Little Esty Shop

This project added functionality for merchants to create bulk discounts for their items. A “bulk discount” is a discount based on the quantity of items the customer is buying, for example “20% off orders of 10 or more items”.

Project Goals:

  • Write migrations to create tables and relationships between tables Implement CRUD functionality for a resource using forms (form_tag or form_with), buttons, and links
  • Use MVC to organize code effectively, limiting the amount of logic included in views and controllers
  • Use built-in ActiveRecord methods to join multiple tables of data, make calculations, and group data based on one or more attributes
  • Write model tests that fully cover the data logic of the application
  • Write feature tests that fully cover the functionality of the application

Bulk Discounts are subject to the following criteria:

  • Bulk discounts should have a percentage discount as well as a quantity threshold
  • Bulk discounts should belong to a Merchant
  • A Bulk discount is eligible for all items that the merchant sells. Bulk discounts for one merchant should not affect items sold by another merchant
  • Merchants can have multiple bulk discounts
  • If an item meets the quantity threshold for multiple bulk discounts, only the one with the greatest percentage discount should be applied
  • Bulk discounts should apply on a per-item basis
  • If the quantity of an item ordered meets or exceeds the quantity threshold, then the percentage discount should apply to that item only
  • Other items that did not meet the quantity threshold will not be affected
  • The quantities of items ordered cannot be added together to meet the quantity thresholds, e.g. a customer cannot order 1 of Item A and 1 of * Item B to meet a quantity threshold of 2. They must order 2 or Item A and/or 2 of Item B

Getting Started

To get a local copy up and running follow these simple example steps

Prerequisites

» Ruby version 2.7.2
» Rails version 5.2.6

Installation

  1. Clone the repo
    git clone https://github.com/lcpulzone/bulk-discounts.git
  2. Install gems
    bundle install
  3. Run
    rails db:{create,migrate}

Testing

RSpec

  1. To run testing suite
    bundle exec rspec

Schema

Little Esty Shop

See the open issues for a list of proposed features (and known issues)

Contributing

Contributions are what make the open source community such an amazingly rad place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/RadFeature)
  3. Commit your Changes (git commit -m 'Add some RadFeature')
  4. Push to the Branch (git push origin feature/RadFeature)
  5. Open a Pull Request

Contact

Leigh Cepriano Pulzone - Linkedin - GitHub - Email

Project Link: Bulk Discounts
Group Project Link: Little Esty Shop
Group Project Contacts: Little Esty Shop

Acknowledgements

» README Template Source
» Turing Requirements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 91.4%
  • HTML 7.8%
  • Other 0.8%