Skip to content

Branches & Leaves - Vi & Samantha#39

Open
iamsammysam wants to merge 35 commits intoAda-C12:masterfrom
iamsammysam:master
Open

Branches & Leaves - Vi & Samantha#39
iamsammysam wants to merge 35 commits intoAda-C12:masterfrom
iamsammysam:master

Conversation

@iamsammysam
Copy link

Video Store API

Congratulations! You're submitting your assignment!
If you didn't get to the functionality the question is asking about, reply with what you would have done if you had completed it.

Comprehension Questions

Question Answer
Explain how you came up with the design of your ERD, based on the seed data. We created a Rental Class that belongs to Movies and Customers, another class for Customer that has many Rentals and Movies through Rentals and a class for Movie that has many Rentals and Customers through Rentals.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. The Bio-O Time complexity for /customers and /movies endpoints is O(n) because we loop through the list of customers and movies to render the JSON.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. The Bio-O Time complexity for checkin method on rentals controller is O(n).
Describe a set of positive and negative test cases you implemented for a model. We implemented tests for Movies Model positive cases for validations "that is valid when all fields are preset" and negative tests for validations "it is invalid without a title, overview or release date" for example.
Describe a set of positive and negative test cases you implemented for a controller. For Customer Controller tests a positive example is that the "index will respond with an array of customers hashes and success" and a negative example is that the "index will respond with an empty array when no customers" for example.
How does your API respond when bad data is sent to it? It renders a bad_request error.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We decided to have a custom method on the movie model "update_available_inventory" that updated the inventory adding or subtracting as the checkout or checkin actions were called.
Do you have any recommendations on how we could improve this project for the next cohort? We loved the fact that we could work with folks from the other class on this project and collaborate to make this video store api.
Link to Trello https://trello.com/b/tEc5qPvv/videostore
Link to ERD
Summary

iamsammysam and others added 30 commits November 5, 2019 13:26
added controllers / added tests
updated tests after smoke test fixes
fixing bugs on model and controller test for movies
…ental model, and update methods in the customer and movie models - added tests for checkout - maybe want to continue adding more helper methods to rental model and refactor controller code
added checkin and checkout to rentals controller
@jmaddox19
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene It's great how frequent the commits are. One comment: I notice a few generic messages like "code added", "refectored", "test added", etc. that do not make it clear what actually changed. Most of your messages are clear and explicit. Making a point to always be explicit like that with every commit is important for when you end up needing to retrace your git history.
Comprehension questions Yup
General
Business Logic in Models Not as much as would be beneficial. This is most noticeable in the RentalsController. Breaking this code out into model methods is an area for improvement.
All required endpoints return expected JSON data yes
Requests respond with appropriate HTTP Status Code yes
Errors are reported
Testing
Passes all Smoke Tests Yep!
Model Tests - all relations, validations, and custom functions test positive & negative cases yes!
Controller Tests - URI parameters and data in the request body have positive & negative cases yes!
Overall Great job! Just a couple tips in the rubric above. You built an API! So awesome!

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.

3 participants