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

💤 Team 1Z - Iris, Kal, Ringo, and Sophia #80

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

Conversation

kashenafi
Copy link

@kashenafi kashenafi commented Nov 25, 2020

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? (Ringo) I was primarily responsible for setting up the filter by order status functionality on the merchant’s dashboard. I am proud of it because it took a few false starts and a lot of debugging before I could get it to work the way I wanted to but it came out exactly how I wanted. (Sophia) I was primarily responsible for setting up OAuth, Reviews, merchant/user navigation, and Categories View. I take forever to work through problems but I am really proud of the work I did on this project, and was able to get better at debugging too. (Iris) I was responsible for a lot of the styling for merchants/products/category pages. I had to teach myself lots of bootstrap along the way. I’m proud of how good the site ended up looking. I was also responsible for much of the OrderItems controller/model, which as complicated to implement and test - I’m proud of getting those to work.(Kal) Was mainly tasked with working on the orders controller actions & partly styling the merchant show page (the user dashboard). I was proud of some of the business logic code I wrote in the model for order and products (stock adjustments) + cart relationship checks for view authorizations.
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? (Sophia) Reviews, I set this up as a table, but if i had more time it would be nice to know how to make it read as individual elements. I didn’t end up finishing controller tests for this element, but did write the reviews model test validations. (Iris) I’d love some feedback on the OrderItemsController create action and tests, and the products index and category show views. (Kal) I was primarily tasked with creating the confirmation page and setting up some logic for cart views, as well as some merchant dashboard conditional views. I would like some feedback around how well our views restrictions work (i.e. cannot view another merchant’s dashboard or order, and cannot access past order confirmation page or pending cart not from your session). (Ringo) I was primarily responsible for many of the merchant model methods that were used by the merchant show view to calculate statistics, organize products, or filter other merchants’ order items out of an order. I would appreciate feedback on those in particular because at times the merchant show view felt very convoluted (particularly with filter_order) and made me wonder if I was missing a way of simplifying and streamlining.
How did your team break up the work to be done? We used the trello board to assign tasks every morning or as needed. Also, when we met up to merge, we would usually check in on whether everyone felt they had enough to do in the immediate future or if they should add something else to their plate.
How did your team utilize git to collaborate? We made sure to meet up everytime we merged, making sure there was a consensus on what the code should look like if there were any conflicts.
What did your group do to try to keep your code DRY while many people collaborated on it? Partials were a big help in DRYing up view code.
What was a technical challenge that you faced as a group? One big challenger: deciding how certain pages should look, and what functionality they should have, based on the context (is the user signed in as a merchant, does this user have permission to see a certain order, etc). We cycled through a few different approaches for this before finalizing our approach.
What was a team/personal challenge that you faced as a group? We occasionally ran into situations where the card that one of us had chosen overlapped with a card that someone else was working on. This made it difficult for the programmer in question to move forward with their assignment, not wanting to create incompatible versions or do unnecessary duplicate work. As the project went on we did more coworking which made it easier to speak up in the moment when an overlap was discovered, so the programmers could decide on a separation of tasks, or one could move on to a different card. (Also, we are all sleepy and do not like being awake in the mornings in time for stand up. (Or, whoops, maybe that was just Ringo who was late every day.) Another point in case: Sophia slept through a stand up. )
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/1MI8md3vjwjtLGKldysZkgj2UKg1Xkbot/view?usp=sharing The ERD was made early in the process. At the time we had not decided to make categories its own model with controller. By the time we made that decision, we all felt comfortable enough with the overall design scheme we did not feel the need to update the ERD.
What is your Trello URL? https://trello.com/b/daObgnf3/the-board
What is the Heroku URL of your deployed application? Etzzz is currently offline, but it will live on in your dreams.

SoCodeDo and others added 30 commits November 23, 2020 17:14
ringolingo and others added 28 commits November 25, 2020 00:31
pull in Iris' pull request
completed review validations
troubleshoot product and orderitemscontroller tests
@kashenafi kashenafi changed the title Team 1Z - Iris, Kal, Ringo, and Sophia 💤 Team 1Z - Iris, Kal, Ringo, and Sophia Nov 26, 2020
Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

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

bEtsy

Functional Requirements: Manual Testing

Workflow yes / no
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) Adds a second copy.
Verify unable to increase quantity beyond stock ✔️ (Though adding a second copy can confuse this logic.)
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 Can view another merchant's dashboard.

Major Learning Goals/Code Review

Criteria yes / no
90% reported coverage for all controller and model classes using SimpleCov 71.68% ☹️
Routes
No un-needed routes generated (check reviews) Reviews has routes for edit and update but no corresponding actions.
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) Merchants uses parameterized routes.
Controllers
Controller-filter to require login is applied to all merchant-specific actions (update/add item, add category, view merchant dashboard, etc.) - filter method is not duplicated across multiple files ✔️
Helper methods or filters to find logged-in user, cart, product, etc ✔️
No excessive business logic Some of the cart logic lives in the controller.
Business logic that ought to live in the model
Add / remove / update product on order
Checkout -> decrease inventory ✔️
Merchant's total revenue ✔️
Find all orders for this merchant (instance method on Merchant) ✔️
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
No (logic in 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
Missing some.
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)
No (order controller tests commented out)
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
No reviews controller tests.

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 made excellent use of partials.

I do see some room for improvement around test coverage. As you may have learned throughout this project changing untested code is way scarier than changing code that has tests.

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 +3 to +6
before_action :set_current_order
before_action :current_merchant
before_action :find_merchants
before_action :find_categories

Choose a reason for hiding this comment

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

I see that you made great use of controller filters, that's awesome!

@order = Order.find_by(id: params[:order_id])
elsif params[:id]
@order = Order.find_by(id: params[:id])
else session[:order_id] && session[:order_id] != nil

Choose a reason for hiding this comment

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

I think you meant this to be an elsif as well since you listed a condition.

end
end

def is_this_your_cart?

Choose a reason for hiding this comment

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

XD

end

def construct_error_messages(errors)
return errors ? errors.messages.map{|error_type, msg| "#{error_type.to_s.gsub('_', ' ')}: #{msg.join(" - ")}" unless msg.empty?} : []

Choose a reason for hiding this comment

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

I would have liked to have seen this split this across multiple lines this line is really dense.

Comment on lines +26 to +27
merchant = Merchant.find_by(uid: auth_hash[:uid],
provider: params[:provider])

Choose a reason for hiding this comment

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

Funky indentation.

Comment on lines +7 to +18
def acceptable_avatar
return unless avatar.attached?

unless avatar.byte_size <= 1.megabyte
errors.add(:avatar, "must be under 1MB")
end

acceptable_types = ["image/png", "image/jpeg"]
unless acceptable_types.include?(avatar.content_type)
errors.add(:avatar, "must be a JPEG or PNG")
end
end

Choose a reason for hiding this comment

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

Woah, avatars, fancy!

<p>Sorry, no products!</p>

<% else %>
<div class="card-columns" style="margin-top:30px">

Choose a reason for hiding this comment

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

This is a really intense partial. Well done!

<p>Name: <%= order.name %></p>
<p>Email Address: <%= order.email %></p>
<p>Mailing Address: <%= order.address %></p>
<p>Credit Card: **** **** **** <%= order.credit_card_number.to_s[-4..-1]%></p>

Choose a reason for hiding this comment

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

The asterisks here are fun.

Comment on lines +8 to +9
<th style="width: 17%">Quantity</th>
<th style="width: 17%">Price</th>

Choose a reason for hiding this comment

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

Inline styles ☹️


require "test_helper"

describe OrdersController do

Choose a reason for hiding this comment

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

?

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