Skip to content

Conversation

@KatherineJF
Copy link

@KatherineJF KatherineJF commented Nov 9, 2018

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 white-boarded video-store architecture and determined that rentals belonged to customers and movies and it was a has-many relationship. We referenced the seed data to understand the attributes we needed to build the models.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. O(c) time complexity because our movie and customer index methods use Customer.all and Movie.all which we think returns the entire and doesn't loop through each record individually if it doesn't loop through each record individually the time complexity would be O(n).
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. When you post /rentals/check-in you have to check every element so the time complexity is O(n).
Describe a set of positive and negative test cases you implemented for a model. Can our rental model find the rental when given a valid customer and a movie and the negative test case would be given an invalid customer or movie it returns nil.
Describe a set of positive and negative test cases you implemented for a controller. In movie controller we create a new movie given valid data and we verified that given invalid data the controller returns an error message.
How does your API respond when bad data is sent to it? Yes, it responds with "message": "Invalid customer or movie or movie not available" or "not found".
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We put increment and decrement inventory in the movie model to increase or decrease inventory when the rental check-in and check-out occurs. We decided to do this to put less logic in our rental controller which handles those actions.
Do you have any recommendations on how we could improve this project for the next cohort? None
Link to Trello https://trello.com/b/5Fj5mMbV/videoapi
Link to ERD https://www.lucidchart.com/documents/edit/2b2d8947-1121-4fcb-87ad-b55a0c3293ef/0?shared=true&
Summary

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.

2 participants