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

cactus&clover | pauline&roshni - fire | mackenzie&leah - water #76

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

Conversation

scottzec
Copy link

@scottzec scottzec 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? Mackenzie: “I am proud of the bootstrap work that I did, I'm very interested in learning more about front end development, and while I was not able to spend as long as I would have liked to get a better understanding and make it look how I'd hoped, I was able to find and use a template, and build some features.” –– Roshni: “I was primarily responsible for the orders controller and model. I’m proud of the custom methods/helper methods I wrote. For example, I used the concept of active record transactions for my checkout and cancel methods so that an order is only checked out or cancelled if all the requirements to do so are met.” –– Pauline: “I was primarily responsible for working on the merchants controller — I’m particularly proud of the “stat table” and the filter button on the dashboard for order fulfillments! Did not know that you could create URL params directly within a controller method.” –– Leah: “I was responsible for the product tests, which I’m proud of because I’ve always shrunk in terror before writing tests, but here I was, testing the controller, testing the model, testing testing.
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? Mackenzie: I was primarily responsible for orderitems, I would appreciate feedback on my methods. They got a bit large, but I also find that sometimes when I use too many helper methods, I lose track of the logic involved. I would appreciate any insight into how to strike a balance there –– Roshni: I would like feedback on my controller and model tests. I would also like feedback on my use of the :on option with the validates in the order model, which I used to create a custom context so that the validations would only happen during checkout. –– Pauline: “Definitely would love feedback on redundancy and more elegant solutions, especially views I had where the view changed depending on whether you were signed in or signed out.” –– Leah: “I’m proud of the product tests but I could certainly use some feedback. Additionally, I spent so much time stuck on the actions for product because of the nested routes (originally, all was nested under merchant except index & show). I would really appreciate any feedback or insight on how to improve my clarity with nested routes and routing.”
How did your team break up the work to be done? Each person was essentially responsible for a major model with its accompanying controller, tests, and views.
How did your team utilize git to collaborate? Our team primarily made use of branching and pull requests. During the initial stages of the project, we reviewed pull requests together, and as we became more comfortable with our git hygiene/practices as well as with the interactions between our controllers/models, we were able to do our code reviews much more quickly and avoid merge conflicts.
What did your group do to try to keep your code DRY while many people collaborated on it? We all applied controller filters. We had one person (shout out to Mackenzie!) who was responsible for putting all the aesthetics together, which helped for a cohesive design. We reviewed the entire project’s code and kept all our eyes open for any opportunities for some DRYing.
What was a technical challenge that you faced as a group? Earlier in the process, we had many merge conflicts when models and controller actions were still being put together.
What was a team/personal challenge that you faced as a group? We struggled writing our code while coordinating certain models’ actions and methods due to overlap. Particularly in the first days, we were still more unclear on what all the other models did, so we weren't as sure on how to coordinate smoothly with each other or make sure we didn’t impact another part of the code, particularly for cases so intertwined as order & order item, or merchant & product. Also, a lot of code was still being written so sometimes we needed to reach into each other’s “areas” to get our own code working. However, constant communication on Slack never left anything too confusing for long.
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/1Nij_cde6BTMU3qii11ee_vYy7M8GXE8I/view?usp=sharing
What is your Trello URL? https://trello.com/b/PAneYMIR/the-garden-club-cactus-clover
What is the Heroku URL of your deployed application? https://cactusandclover.herokuapp.com/

scottzec and others added 30 commits November 20, 2020 09:22
Form orderitem product into cart - not pulling quantity
Orders controller and model updated
Mvl - orderitem creates orderitem from product show
orderitems talk to cart, need to add cancel/update orderitem
Complete purchase form - still needs work, running into order empty error
mvlofthus and others added 27 commits November 25, 2020 00:30
Copy link

@dHelmgren dHelmgren 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) ✔️
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 don't let people even get to the form! prevent them from looking at someone else's form
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 ✔️
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) see comment
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 ✔️
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
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
✔️
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
✔️

Overall Feedback

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 +54 to +70
@orderitem = Orderitem.new
@orderitem.order_id = @cart.id
@orderitem.product_id = product.id
@orderitem.quantity = quantity
@orderitem.shipped = false


if @orderitem.save!
flash[:success] = 'Product successfully added to cart!'
redirect_to cart_path
return
else
flash[:warning] = 'A problem occurred: could not add item to cart'
redirect_back(fallback_location: root_path)
return
end
end

Choose a reason for hiding this comment

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

This will create a ton of bloat data! why not just store info in session until you need to save all of it? (as in during a checkout?)

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