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

Ports - Sopheary, Stephanie, Kim, Kate #71

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

Conversation

sophearychiv
Copy link

@sophearychiv sophearychiv commented May 10, 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? Kim: Orderitems/Cart - Desiging the logic for the cart updating quantity based on stock. Sopheary: Second half of the cart! Stephanie: Oauth/Login. It was difficult to get it working and there were many errors! Kate:
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? Kim: Look at any action in the orderitems controller. Am I going overboard with flash messages and logic? Sopheary: Orders controller show action. Stephanie: Uses of classes and IDs CSS Kate:
How did your team break up the work to be done? We divided tasks based on comfort level and what everyone wanted practice on. As the project progressed, we grabbed tasks that were free on the trello board and worked on those.
How did your team utilize git to collaborate? We made a processs to do a pull request and make sure there were no merge conflicts and that all tests were passing.
What did your group do to try to keep your code DRY while many people collaborated on it? We collaborated on making tests helpers like perform_login (Steph, and require_login (Sopheary), create_cart (Kim).
What was a technical challenge that you faced as a group? Oauth login debugging was a challenge for all of us. Sometimes it would work for one person, and then another. It was difficult to get to the root of the problem and correct it so that it works for everyone.
What was a team/personal challenge that you faced as a group? There were points where team communication was a bit opaque. We could make some improvements on the communicative aspects of our team dynamic.
What was your application's ERD? (include a link) https://www.lucidchart.com/documents/edit/ea783f89-ce2c-41b6-9eda-89f67ceb97a3/0?shared=true&
What is your Trello URL? https://trello.com/b/uLVeGLni/itsy-betsy
What is the Heroku URL of your deployed application? https://itsy-store.herokuapp.com/

goblineer and others added 30 commits May 4, 2019 12:56
@sophearychiv sophearychiv changed the title Ports - Sopheary, Stephenie, Kim, Kate Ports - Sopheary, Stephanie, Kim, Kate May 10, 2019
@CheezItMan
Copy link

bEtsy

What We're Looking For

Manual testing

Workflow yes / no
Deployed to Heroku Yes
Before logging in
Browse all products, by category, by merchant Yes
Leave a review Yes
Verify unable to create a new product Yes
After logging in
Create a category Yes
Create a product in that category with stock 10 Yes
Add the product you created to your cart Yes
Add it again (should update quantity) NOPE This give me two orderitems of the same type
Verify unable to increase quantity beyond stock NOPE With two OrderItems with the same Product, I can go over the limit
Add another merchant's product Yes
Check out Yes
Check that stock was reduced NOPE
Change order-item's status on dashboard Yes
Verify unable to leave a review for your own product Yes
Verify unable to edit another merchant's product by manually editing URL NOPE I can edit anyone's product!
Verify unable to see another merchant's dashboard by manually editing URL It only shows me my dashboard after I edit the URL

Code Review

Area yes / no
Routes
No un-needed routes generated (check reviews) See notes
Routes not overly-nested (check products and merchants) Mostly
Merchant dashboard and cart page use a non-parameterized routes (should pull merchant or cart ID from session) Merchant Dashboard has a route param and doesn't need it.
Controllers
Controller-filter to require login by default MISSING in some areas
Helper methods or filters to find logged-in user, cart, product, etc Yes
No excessive business logic Yes
Business logic that ought to live in the model Yes
Add / remove / update product on order Yes
Checkout -> decrease inventory NOPE
Merchant's total revenue NOPE
Find all orders for this merchant (instance method on Merchant) Yes
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
Yes, but missing test to see if you can add to an order which isn't in pending mode. However these aren't really model tests, but done in the controller.
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
No model tests for this, no model methods for these actions
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, but adding the same product to a cart leads to duplicate orderItems.
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

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!.

I am particularly impressed by the way that you styled the app and had good test coverage.

I do see some room for improvement around handling duplicate items in the orders, and not having unneeded route parameters. Further you needed a bit of work to prevent unauthorized users from performing actions on your site.

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

# post "/orders/checkout", to: "orders#checkout"
resources :sessions, only: [:new, :create]
resources :merchants, except: [:new, :create]
resources :merchants do

Choose a reason for hiding this comment

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

You are defining the merchants routes twice!

resources :merchants do
resources :orders, only: [:index]
end
get "/merchants/:id/dashboard", to: "merchants#dashboard", as: "dashboard"

Choose a reason for hiding this comment

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

You don't need the merchant's ID, as it's in session

@@ -0,0 +1,114 @@
class OrdersController < ApplicationController
before_action :find_order, only: [:edit, :update, :show, :review, :confirmation]

Choose a reason for hiding this comment

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

No require_login filter?

@@ -0,0 +1,101 @@
class OrderitemsController < ApplicationController
def create

Choose a reason for hiding this comment

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

You might need a require_login filter for some OrderItems actions

redirect_to root_path
else
@order.update(status: Order::PAID)
session[:order_id] = nil

Choose a reason for hiding this comment

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

You are not changing the quantity of the products which is available.

expect(flash[:result_text]).must_equal "An itsy problem occurred: Can't find product"
end

it "will flash an error and redirect if not enough stock is available" do

Choose a reason for hiding this comment

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

You should also test to see if you can add multiple OrderItems with the same product to take it over the total

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