Giter VIP home page Giter VIP logo

monster_shop_final's Introduction

Monster Shop Extensions - Bulk Discount

Instructions

  • Fork this repository or use your existing project.
  • Clone your fork if you have forked.
  • When you are finished, push your code to your fork. (if you have forked)

Bulk Discount

General Goals

Merchants add bulk discount rates for all of their inventory. These apply automatically in the shopping cart, and adjust the order_items price upon checkout.

Completion Criteria

  1. Merchants need full CRUD functionality on bulk discounts, and will be accessed a link on the merchant's dashboard.
  2. You will implement a percentage based discount:
    • 5% discount on 20 or more items
  3. A merchant can have multiple bulk discounts in the system.
  4. When a user adds enough value or quantity of a single item to their cart, the bulk discount will automatically show up on the cart page.
  5. A bulk discount from one merchant will only affect items from that merchant in the cart.
  6. A bulk discount will only apply to items which exceed the minimum quantity specified in the bulk discount. (eg, a 5% off 5 items or more does not activate if a user is buying 1 quantity of 5 different items; if they raise the quantity of one item to 5, then the bulk discount is only applied to that one item, not all of the others as well)
  7. When there is a conflict between two discounts, the greater of the two will be applied.
  8. Final discounted prices should appear on the orders show page.

Mod 2 Learning Goals reflected:

  • Database relationships and migrations
  • Advanced ActiveRecord
  • Software Testing

Additional Extensions

Users have multiple addresses

General Goal

Users will have more than one address associated with their profile. Each address will have a nickname like "home" or "work". Users will choose an address when checking out.

Completion Criteria

  1. When a user registers they will still provide an address, this will become their first address entry in the database and nicknamed "home".
  2. Users need full CRUD ability for addresses from their Profile page.
  3. An address cannot be deleted or changed if it's been used in a "shipped" order.
  4. When a user checks out on the cart show page, they will have the ability to choose one of their addresses where they'd like the order shipped.
  5. If a user deletes all of their addresses, they cannot check out and see an error telling them they need to add an address first. This should link to a page where they add an address.
  6. If an order is still pending, the user can change to which address they want their items shipped.

Implementation Guidelines

  1. Existing tests should still pass. Since you will need to make major changes to your database schema, you will probably break many tests. It's recommended that you focus on the completion criteria described above before going back and refactoring your code so that your existing tests still work.
  2. Every order show page should display the chosen shipping address.
  3. Statistics related to city/state should still work as before.

Merchant To-Do List

General Goals

Merchant dashboards will display a to-do list of tasks that need their attention.

Completion Criteria

  1. Merchants should be shown a list of items which are using a placeholder image and encouraged to find an appropriate image instead; each item is a link to that item's edit form.
  2. Merchants should see a statistic about unfulfilled items and the revenue impact. eg, "You have 5 unfulfilled orders worth $752.86"
  3. Next to each order on their dashboard, Merchants should see a warning if an item quantity on that order exceeds their current inventory count.
  4. If several orders exist for an item, and their summed quantity exceeds the Merchant's inventory for that item, a warning message is shown.

Implementation Guidelines

  1. Make sure you are testing for all happy path and sad path scenarios.

Mod 2 Learning Goals reflected:

  • MVC and Rails development
  • Database relationships and migrations
  • ActiveRecord
  • Software Testing

Rubric

Feature Completeness Rails ActiveRecord Testing and Debugging
4: Exceptional One or more additional extension features complete. Students implement strategies not discussed in class to effectively organize code and adhere to MVC. Highly effective and efficient use of ActiveRecord beyond what we've taught in class. Even .each calls will not cause additional database lookups. Very clear Test Driven Development. Test files are extremely well organized and nested. Students utilize before :each blocks. 100% coverage for features and models
3: Passing Bulk discount feature 100% complete, including most sad paths and edge cases Students use the principles of MVC to effectively organize code. Students can defend any of their design decisions. ActiveRecord is used in a clear and effective way to read/write data using no Ruby to process data. 100% coverage for models. 98% coverage for features. Tests are well written and meaningful. All preexisting tests still pass. TDD Process is clear throughout commits. Sad paths and edge cases are covered in testing.
2: Passing with Concerns One to two of the completion criteria for Bulk Discount feature is not complete or fails to handle a big sad path or edge case Students utilize MVC to organize code, but cannot defend some of their design decisions. Or some functionality is not limited to the appropriately authorized users. Ruby is used to process data that could use ActiveRecord instead. Feature test coverage between 90% and 98%, or model test coverage below 100%, or tests are not meaningfully written or have an unclear objective. Missing sad path or edge case testing.
1: Failing More than two of the completion criteria for Bulk Discount feature is not complete or fails to handle a sad path or edge case Students do not effectively organize code using MVC. Or students do not authorize users. Ruby is used to process data more often than ActiveRecord Below 90% coverage for either features or models. TDD was not used.

monster_shop_final's People

Contributors

priyapower avatar memcmahon avatar brianzanti avatar megstang avatar mikedao avatar

monster_shop_final's Issues

User Story 22: Final Heroku Check

  • Confirm Heroku deployment
  • Confirm Heroku database is well filled
  • Confirm other users can access
  • Have list of admin/merchant users with passwords

User Story 14: A Cart can Automatically remove Discounts when conditions no longer apply

As a non-admin user
When I visit my cart
And it has items from a merchant with an enabled discount
And the quantity of merchant items meets the discount conditions
I will see a new section for "Saved from discounts" with the total price discounted in the cart
I will automatically see the discounted total instead of the "normal" total
When I delete enough items in my cart to remove the discount
I no longer see the section about discounted amount
I will automatically see the normal price and no longer see any discounted prices

User Story 17: A Cart will only discount the bulk item

As a non-admin user
When I visit my cart
And it has items from a merchant with at least 2 enabled discounts
And the quantity of merchant items meets the the lower quantity discount condition
I will see a new section for "Saved from discounts" with the total price discounted in the cart
I will automatically see the discounted total instead of the "normal" total
If I update my items quantity to meet the higher quantity discount condition
The cart will calculate the greater of the 2 discounts
Apply only the greater to the cart total
I will see the new updated total with the greater discount applied (greater means a better value for the user)

User Story 6: Discounts Index Page

As a merchant user
When I visit the merchant dashboard
I see a link for "My Discounts"
When I click on "My Discounts"
I am taken to /merchant/discounts
I see at least one discount
The discount is listed by discount_id and is a link to the discount show page
I see a link to delete the discount
I see a enabled/disabled check box that can be updated
The discount description, quantity, percent are only visible on the discount show page (later user story), NOT the discount index page

User Story 16: A Cart will only discount the bulk item

As a non-admin user
When I visit my cart
And it has items from a merchant with an enabled discount
And the quantity of merchant items meets the discount conditions
I will see a new section for "Saved from discounts" with the total price discounted in the cart
I will automatically see the discounted total instead of the "normal" total
This discounted price will only take a percentage off the bulk item and not a percentage off the total amount in the cart

User Story 5: The cart will show bulk discounts in a new column

This application will update the Cart.rb PORO
A cart that has items from a merchant that has an enabled discount(s) will show the discount.description in a New Column ("Bulk Discounts Offered by Merchants) on /cart view page

  • If no bulk discounts are available, show "-------"
  • If a bulk discount is applied, show "This item has a bulk discount applied"
  • If a bulk discount available, but no applied, show "This merchant is offering a <discount.description>"

User Story 7: Merchants can Enable/Disable Discounts from Index Page

As a merchant user
When I visit the merchant dashboard
I see a link for "My Discounts"
When I click on "My Discounts"
I am taken to /merchant/discounts
I see at least one discount
I see a link to delete the discount
I see a enabled/disabled check box that can be updated
When I click the check_box for enable/disable and save
The page is refreshed
I now see the updated status of the discount

User Story 10: Merchants can Create Discounts (CRUD Discounts)

As a merchant user
When I visit the merchant dashboard
I see a link for "My Discounts"
When I click on "My Discounts"
I am taken to /merchant/discounts
This discounts index page will have a link "Create new Discount"
When I click on "Create new Discount"
I am taken to /merchant/discounts/new
I see a form to fill out

  • description: string
  • quantity: integer
  • percent: integer
  • enabled: boolean, default: true
    This discount is automatically saved with merchant_id
    When I click submit
    I am taken back to the discounts index page
    Where I can see the new discount by id (with link), enabled is true, and delete discount button

User Story 13: A Cart can Automatically Update Totals for Discounts

As a non-admin user
When I visit my cart
And it has items from a merchant with an enabled discount
And the quantity of merchant items meets the discount conditions
I will see a new section for "Saved from discounts" with the total price discounted in the cart
I will automatically see the discounted total instead of the "normal" total

User Story 8: Merchants can see Discounts Show Page

As a merchant user
When I visit the merchant dashboard
I see a link for "My Discounts"
When I click on "My Discounts"
I am taken to /merchant/discounts
I see at least one discount
When I click on a unique discount "discount_id"
I am taken to /merchant/discounts/show
I see the discount description, quantity, percent, enabled status
I see a link to delete the discount
I see a link to update the discount
I see a enabled/disabled check box that can be updated

User Story 9: Merchants can Enable/Disable Discounts from Show Page

As a merchant user
When I visit the merchant dashboard
I see a link for "My Discounts"
When I click on "My Discounts"
I am taken to /merchant/discounts
I see at least one discount
When I click on a unique discount "discount_id"
I am taken to /merchant/discounts/show
I see the discount description, quantity, percent, enabled status
I see a link to delete the discount
I see a link to update the discount
I see a enabled/disabled check box that can be updated
When I click the check_box for enable/disable and save
The page is refreshed
I now see the updated status of the discount

User Story 19: Update for Monster Theme

  • Ensure seeds are displaying from factorybot/faker OR Create seeds that are monster themed
  • Update all colors/banners/nav bars for monster theme
  • Update all flash messages for monster theme

User Story 15: A Cart will show possible bulk discounts as a new column on page

As a non-admin user
When I visit my cart
I see a new column called "Bulk Discounts offered by merchant"

  • If no discounts available from merchant, show "---"
  • If discounts available, conditions not met, show "discount.description"
  • If discounts available, conditions YES met, show "Congrats! You've applied a bulk discount" (this will also show a new section called Discounts applied or something, see user story 13)

User Story 11: Merchants can Update Discounts (CRUD Discounts)

As a merchant user
When I visit /merchant/discounts/<discount.id>
When I click the link to update the discount
I am taken to a form with prepopulated fields
I can update any field

  • description: string
  • quantity: integer
  • percent: integer

When I click submit

  • If saved, flash success
  • If missing field, flash failures
    I am taken back to the discount show page
    Where I can see the updated information about the discount

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.