Skip to content

Conversation

@jacquelynoelle
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 started out with movie and customer models and then realized they had a many to many relationship, so they would need a join table. After realizing that rental data would need to be saved somewhere, we made that join table a full blown model.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. Without sorting and paginating, the time complexity is O(n) because we are simply going through the full list in the database. If we sort, the time complexity because O(n log n). Pagination would be O(n) time complexity (we think) because it would be a matter of simply going through the array linearly and selecting certain values, and the length of the pages depend on the length of the content. So O(n) for non-sorting with or without pagination, and O(n log n) with any sorting where n is the number of customers or movies in the database.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. Our rentals/check-in endpoint would be O(n log n) time complexity, where n is the number of rentals in the database (worst case scenario), because we have to sort the rentals to find the oldest one for checkin.
Describe a set of positive and negative test cases you implemented for a model. For our customer checkout? method in movie.rb, we implemented a positive test case for when the movie could be checked out (there is enough available inventory), and when it could not be (0 available).
Describe a set of positive and negative test cases you implemented for a controller. For the movies controller current action, our positive test case was checking that it returned a list of currently checked out movies for the designated customer, and the negative test case checked that it returned an empty array if a customer had no current rentals.
How does your API respond when bad data is sent to it? Pagination parameters are modified so that the user will just get an empty array if they give the url a bad parameter. Sorting works for all fields, and the API will just return a list sorted by id if given an invalid sorting criteria.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We created custom model methods that updated their respective models' attributes -- this seemed like it better followed OOD principles than updating those values from the controller or from another model.
Do you have any recommendations on how we could improve this project for the next cohort? The rabl documentation is erroneous in some cases (e.g. the video shows the files as show.json.rabl instead of show.rabl), which made it tough to use. Given how much project time we have this week, it might've been good to do a class exercise together if use of the gem is encouraged.
Link to Trello https://trello.com/b/0F1FyM3V/leanne-jackie-videostoreapi
Link to ERD image from ios
Summary :)

jacquelynoelle and others added 30 commits November 5, 2018 11:01
…ecked in if a customer has more than one of the same movie out
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