Skip to content

Conversation

@katemyer
Copy link

Assignment Submission: bEtsy

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions. These should be answered by all members of your team, not by a single teammate.

Reflection

Prompt Response
Each team member: what is one thing you were primarily responsible for that you're proud of? Jessica worked primarily on the cart and checkout process. I am most proud that I was able to make it function! I also did the styling and my team thinks it looks very Pinterest worthy!! // Kate as in charge of completing all the model validations, custom mode methods testing. I helped Jessica with order and order_item controller testing as well as doing parts of the crud for these controllers. Most proud of writing tests to pass getting simplecov to 90-100% for these controllers and models. // Nora made all the product display pages, including for category and merchant. I also did all the related controller testing. The thing I’m most proud of though is finally realizing how simple controller filters can be and actually using one. // Emily is proud of how the merchant dashboard turned out because I added several features that were outside of my knowledge. I learned a lot of new tools that will be helpful for future projects.
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? Kate mostly worked on tests, I would like feedback on how to do tests for sessions as that was one that was a difficult to wrap my head around. I understood what was happening in the methods that were written in the controllers but wasn't able to get that last 10% coverage in the order controller. // Jessica - the check out process. //Emily - Styling for the merchant dashboard. // Nora - Product controller testing.
How did your team break up the work to be done? We made an ERD first, then we went through the user stories to develop our Trello board. We pretty much just started grabbing parts that we thought were interesting to us and ran with tasks related to those parts. We were committed to daily standups to share our progress, what we were going to work on next, and any help we needed.
How did your team utilize git to collaborate? We were really amazing honestly at being diligent about creating branches when we worked on a feature. We had great communication when we submitted a PR and another team member quickly came in to check and merge. We then were great at pulling from the master and using branches for each new feature. In the grand scheme of git hygeine, we did well but sometimes we got caught up and did not commit as frequently. There was an incident where there was a merge conflict but Jessica and Nora were able to quickly mend the issue.
What did your group do to try to keep your code DRY while many people collaborated on it? Because we were able to work on our parts "seperately" and were great about continually meeting and merging, we managed to keep the code DRY throughout. However, we did our DRY-ing and cleaning up at the end. The code production was deliberately careful and thought out as much as possible. With our testing, we were able to consistently use the fixtures we created.
What was a technical challenge that you faced as a group? Deploying to Heroku was much more involved than we initially thought! DEPLOY EARLY, DEPLOY OFTEN!
What was a team/personal challenge that you faced as a group? This project was enormous and at different parts of the project, it felt like one or two people were getting doing the brunt of the work. Then towards the middle, things picked up for all of us, and at the end, we all came together to wrap things up really nicely. Our team was available for help, someone was there to jump in to help at all times even super late into the night. Couldn't have asked for a better team, we really did it!
What was your application's ERD? (upload this to Google Drive, change the share settings to viewable by everyone with a link, and include a link) https://drive.google.com/file/d/1RNkK9Z238OJaRnywiimgJSBKwnno-Mz1/view?usp=sharing
What is your Trello URL? https://trello.com/b/moXn53QI/plantsy
What is the Heroku URL of your deployed application? https://plantsy-2020.herokuapp.com/

thenora and others added 30 commits June 11, 2020 23:38
flash messages added to application
Order + order item functions km june11
@kaidamasaki
Copy link

bEtsy

Functional Requirements: Manual Testing

Workflow yes / no
Deployed to Heroku ✔️
Before logging in
Browse all products, by category, by merchant ✔️
Leave a review ✔️
Verify unable to create a new product ✔️
After logging in
Create a category ✔️
Create a product in that category with stock 10 ✔️
Add the product you created to your cart ✔️
Add it again (should update quantity) ✔️ (Though changing quantity doesn't work from the cart.)
Verify unable to increase quantity beyond stock ✔️
Add another merchant's product ✔️
Check out ✔️
Check that stock was reduced ✔️
Change order-item's status on dashboard ✔️
Verify unable to leave a review for your own product ✔️
Verify unable to edit another merchant's product by manually editing URL ✔️
Verify unable to see another merchant's dashboard by manually editing URL ✔️

Major Learning Goals/Code Review

Criteria yes / no
90% reported coverage for all controller and model classes using SimpleCov 88.41% (It looks like your merchants controller was light on tests. Maybe some late additions there?)
Routes
No un-needed routes generated (check reviews) ✔️
Routes not overly-nested (check products and merchants) ✔️
Merchant dashboard and cart page use a non-parameterized routes (should pull merchant or cart ID from session) ✔️
Controllers
Controller-filter to require login by default ✔️
Helper methods or filters to find logged-in user, cart, product, etc ✔️
No excessive business logic ✔️
Business logic that ought to live in the model
Add / remove / update product on order Order items have their own controller instead and use standard CRUD patterns. (Which seems reasonable to me personally.)
Checkout -> decrease inventory ✔️
Merchant's total revenue ✔️
Find all orders for this merchant (instance method on Merchant) Renders order items instead of full orders.
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
Logic was 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
N/A
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)
✔️
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
✔️

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

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 worked together as a team and how thorough your tests were of the things you did test.

I do see some room for improvement around putting more logic in the model and attention to detail. There were some small things that slipped through the cracks (see comments).

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!

Overall: Meets or Exceeds Standard

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


#Login
get "/auth/github", as: "github_login"
get "/auth/:provider/callback", to: "merchants#create"

Choose a reason for hiding this comment

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

To of your tests fail because this isn't named.

Suggested change
get "/auth/:provider/callback", to: "merchants#create"
get "/auth/:provider/callback", to: "merchants#create", as: "auth_callback"

Comment on lines +8 to +17
def index
if params[:product_id] # This is the nested route, /products/:product_id/order_items
product = Product.find_by(id: params[:product_id])
order_items = product.order_items.as_json(only: [:id, :name, :price, :quantity])
render json: order_items, status: :ok
else # This is the 'regular' route, /order_items
order_items = OrderItem.all.as_json(only: [:id, :name, :price, :quantity])
render json: order_items, status: :ok
end
end

Choose a reason for hiding this comment

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

Inconsistent indentation.


if @order_item.nil?
# head :not_found
redirect_to dashboard_path

Choose a reason for hiding this comment

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

Adding a flash message here would be nice.

end

if @product.status == false && @product.merchant_id != session[:user_id]
flash[:error] = "Oops. That plant isn't available. Let's find you another beautiful plant."

Choose a reason for hiding this comment

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

I like this message. :)

@@ -0,0 +1,3 @@
class Category < ApplicationRecord

Choose a reason for hiding this comment

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

You should probably require a name to exist.

<%= link_to "Merchants", merchants_path %>
</nav>

<section class="navigation-bar--right-side">

Choose a reason for hiding this comment

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

You should avoid things like right-side in class names.

You might want to move this to the left side at some point and then that would be confusing or require a rename.

<button type="button" class="btn btn-primary"><%= link_to "Add a product", new_product_path %></button>
<button type="button" class="btn btn-primary"><%= link_to "Add a category", new_category_path %></button>
</section>
<br />

Choose a reason for hiding this comment

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

You should avoid using <br />s if you can. It's cleaner just to add a margin-bottom or margin-top to something.

<% if @cart_items %>
<% @cart_items.each do |item| %>
<section class="cart-item">
<%= image_tag(item.photo_url, alt: "photo of the cart item") %>

Choose a reason for hiding this comment

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

For an alt tag it would probably be better to make it a little more specific, maybe:

Suggested change
<%= image_tag(item.photo_url, alt: "photo of the cart item") %>
<%= image_tag(item.photo_url, alt: "photo of the #{item.name}") %>

<h2>Confirmation: Order placed!</h2>
<ul>
<li>
<strong>Order Placed At: </strong><%= @cart.updated_at.strftime('%a %b %d %H:%M:%S %Z %Y').in_time_zone("Pacific Time (US & Canada)") %>

Choose a reason for hiding this comment

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

I like that you specified the time zone.

<% @products.each do |product| %>
<ul class="product-listing">
<li>
<% if product.photo_url == nil || product.photo_url.length < 1 %>

Choose a reason for hiding this comment

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

It's clearer to use empty? instead of length < 1:

Suggested change
<% if product.photo_url == nil || product.photo_url.length < 1 %>
<% if product.photo_url == nil || product.photo_url.empty? %>

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.

6 participants