An extension to the project Little Esty Shop
Report Bug
·
Request Feature
Table of Contents
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
To get a local copy up and running follow these simple example steps
» Ruby version 2.7.2
» Rails version 5.2.6
- Clone the repo
git clone https://github.com/lcpulzone/bulk-discounts.git
- Install gems
bundle install
- Run
rails db:{create,migrate}
- To run testing suite
bundle exec rspec
See the open issues for a list of proposed features (and known issues)
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/RadFeature
) - Commit your Changes (
git commit -m 'Add some RadFeature'
) - Push to the Branch (
git push origin feature/RadFeature
) - Open a Pull Request
Leigh Cepriano Pulzone - Linkedin - GitHub - Email
Project Link: Bulk Discounts
Group Project Link: Little Esty Shop
Group Project Contacts: Little Esty Shop