Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branches - Fruit Loops (Paige, Xinran, Vi, Emily) #96

Open
wants to merge 435 commits into
base: master
Choose a base branch
from

Conversation

eaball35
Copy link

@eaball35 eaball35 commented Nov 1, 2019

bEtsy

Congratulations! You're submitting your assignment! These comprehension questions should be answered by all members of your team, not by a single teammate.

Comprehension Questions

Question Answer
Each team member: what is one thing you were primarily responsible for that you're proud of? Emily: many to many categories, reviews, validation testing, seeding data. Vi: I really enjoyed working on custom methods; some of those included doing total earnings, which had to span across class and know about order status. Paige: I helped to make OrderItems function within our orders and also checking that we had sufficient test coverage for all our models, controllers, and custom methods. Xinran: I did orders functions including placing and filtering orders, searching products feature and refactoring.
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? Vi & Paige: OrderItems, and controller functions design implementation. Xinran: search products and filter order. Emily: how could it be cleaner/ more efficient?
How did your team break up the work to be done? We created tasks with trello and assigned due dates and persons to work on tasks. During/after stand up each day we prioritized tasks and who was working on what to see if we needed to pair.
How did your team utilize git to collaborate? We all had our own branches and we have two subbranches subgroups pushed to before pushing to master.
What did your group do to try to keep your code DRY while many people collaborated on it? We collaborated on where we felt overlaps occured before starting to code to make sure not to duplicate work. After we had functioning code we assigned refactoring tasks to clean up repeated code. We tried to utilize partial views and controller filters to keep code DRY.
What was a technical challenge that you faced as a group? We had issues with the forms inside tables and needing to add turbolink. Sometimes we were accidentally overwriting each others code if we didn't merge correctly. We also had issues with deploying to Heroku and needing secret keys and accidentally seeding heroku twice.
What was a team/personal challenge that you faced as a group? See technical challenges above.
What was your application's ERD? (include a link) https://live.staticflickr.com/65535/48997857413_e3fdd65bb7_b.jpg
What is your Trello URL? https://trello.com/b/YQC1quyV/fruitsy
What is the Heroku URL of your deployed application? https://fruitsy.herokuapp.com/

criacuervos and others added 30 commits October 28, 2019 15:53
user total earnings/ cart subtotal / order total
added links to product images
…ck to use 'find_order' method, refactored the orders controller tests
@jmaddox19
Copy link

bEtsy

What We're Looking For

Manual testing

Workflow yes / no
Deployed to Heroku x
Before logging in
Browse all products, by category, by merchant yes, and by fruit! However, the "All fruits" button results in an error.
Leave a review x
Verify unable to create a new product x
After logging in
Create a category It's not clear to me how to add a category
Create a product in that category with stock 10 Yes! However, when I created a product with an invalid URL, it says it's successful but the product doesn't show up anywhere. I made another product with a valid image to verify that fixed the problem. Also, I get an error when I try to create a Merchant Name.
Add the product you created to your cart x
Add it again (should update quantity) x
Verify unable to increase quantity beyond stock I was able to checkout with more in stock than there was in quantity
Add another merchant's product x
Check out x
Check that stock was reduced The stock was not reduced
Change order-item's status on dashboard I unfortunately can't access the dashboard anymore. I'm guessing that's because I added the product with an invalid image.
Verify unable to leave a review for your own product x
Verify unable to edit another merchant's product by manually editing URL I can't edit the product but that seems to be because I can't edit any product, including my own.
Verify unable to see another merchant's dashboard by manually editing URL x

Code Review

Area yes / no
Routes
No un-needed routes generated (check reviews) yes!
Routes not overly-nested (check products and merchants) yes!
Merchant dashboard and cart page use a non-parameterized routes (should pull merchant or cart ID from session) yes!
Controllers
Controller-filter to require login by default yes!
Helper methods or filters to find logged-in user, cart, product, etc x
No excessive business logic In general y'all did a great job of this! There are a couple small comments I left in the code review about more opportunities.
Business logic that ought to live in the model
Add / remove / update product on order yes, to the extent it makes sense to me
Merchant's total revenue x

Selected Model Tests |
Add item to cart:
- Can add a good product
- Can't add a product w/o enough stock
- Can't add a retired product
- Can't add to an order that's not in cart mode
- Logic specific to this implementation | A lot of this validation when adding a product to a cart doesn't seem to be present.
Get orders for this merchant:
- Includes all orders from this merchant
- Doesn't include orders from another merchant
- Orders are not included more than once
- Does something reasonable when there are no orders for this merchant | I wish I hadn't broken the dashboard but from looking at the HTML there doesn't seem to be built-out functionality for viewing all the orders I've received as a merchant. If there is it isn't in the model.
Selected Controller Tests |
Add item to cart:
- Empty cart (should be created)
- Cart already exists (should add to same order)
- Product already in cart (should update quantity)
- Bad product ID, product is retired, quantity too high, or something like that (error) | yes! great!
Leave a review:
- Works when not logged in
- Works when logged in as someone other than the product's merchant
- Doesn't work if logged in as this product's merchant
- Doesn't work if validations fail | yes! great!

Overall Feedback

Great work overall! You've built a fully functional web store from top to bottom. This represents a huge amount of work, and you should be proud of yourselves!. Vi and Paige, the OrderItems controller and model look great! Xinran, the search and filter_order_items methods look great! They're both so succinct and clear. Emily, hopefully the feedback I gave throughout help to give input on code cleanliness/efficiency.

I am particularly impressed by the way that you implemented a search! Also the row of fruits at the top looks so good and adds a lot to the feel of the website!

I do see some room for improvement around checking edge cases (ie. uploading a product with an invalid image) and validating all features on your final version. (I assume editing a product and the "All fruits" page both worked at some point.) I am going to mark this as "approaches standard" because of the number of things that didn't work when I tested them.

bEtsy is a huge project on a very short timeline, and this feedback should not at all diminish the magnitude of what you've accomplished. Keep up the hard work!

Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it.

Comment on lines +36 to +38
@order.order_items.each do |item|
item.product.stock = item.product.update_quantity(item.quantity, @order.status)
item.product.save

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved to a model method.
As a rule of thumb, when I see more than a line or two that isn't related to control flow (render, redirect, etc.) or defining variables for views, I'm going to feel inclined to put the code in a model.

Comment on lines +67 to +69
@order.order_items.each do |item|
item.product.stock = item.product.update_quantity(item.quantity, @order.status)
item.product.save

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be moved to the model

Comment on lines +12 to +15
existing_quantity = self.quantity
new_quantity = existing_quantity + quantity

return self.update(quantity: new_quantity)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where it'd be important to check the quantity against the quantity in stock.

@jmaddox19
Copy link

I looked at it again with y'all and found that when things weren't broken due to the url issue the following things worked:

  • Adding merchant name
  • I wasn't able to checkout with more stock than there was quantity
  • I can view the dashboard and edit my products there
  • I can only edit my own products

Because of all of these things working and the acknowledgement that it was only one edge case that was causing problems, I will change the color grade to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants