Skip to content

Conversation

@Naltrexone
Copy link

@Naltrexone Naltrexone 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. When we looked at the project requirements and saw that paths in Wave 3, that specified the 'checkin' and 'checkout' methods, we knew that we would need the Rentals controller. This had to be tied to Movies and Customers through Composition. Movies and Customers have many Rentals.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. /customers endpoint would have the Big-O notation of O(c * r) where 'c' is the number of customers. 'movies_checked_out_count' would require an iteration through all the rentals to get the result for each movie. Therefore the Big-O for the index method in Customers controller would be O(c * r), where r is the total number of rentals. The /movies path - index method would have the Big - O notation of O(m), the show method would have time complexity of O(m * r).
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 Big - O notation is O(r) where 'r' is the number of rental instances. The time complexity is dependent on the number of instances of Rentals. The 'checkin' method would have to iterate through the table to find the movie and customer id that corresponds to the instance of the movie for which we are trying to update the status.
Describe a set of positive and negative test cases you implemented for a model. We tested the customer method in Movie model for 'available_inventory' method. We tested for situations where the movie had been rented before and when it had never been rented.
Describe a set of positive and negative test cases you implemented for a controller. In the Rental controller we checked both the 'checkin' and 'checkout' methods working for valid and not working for invalid data.
How does your API respond when bad data is sent to it? It gives back a status code along with an error message that describes the error.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. The Customer model had a movies_checked_out method that helped calculated total number of rentals still checked out by that particular customer. The Movies model had available_inventory method to help calculate the movies that were available for rent per movie. We decided to make it a custom method as opposed to adding columns in the database, to eliminate dependencies between the classes.
Do you have any recommendations on how we could improve this project for the next cohort? Choosing between optionals to decide which ones to do was hard.
Link to Trello https://trello.com/b/fuG3WUa4/trang-divya-videostore
Link to ERD https://www.lucidchart.com/invitations/accept/8cc838b3-6b00-4bc6-8543-7fad6e92051f
Summary We felt that it was good practice to be able to see how an API is created, sort of in reverse to how it is to pull data from another API source.

Naltrexone and others added 30 commits November 5, 2018 11:01
# Conflicts:
#	test/controllers/movies_controller_test.rb
@CheezItMan
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits and good commit messages, also both team members contributed.
Comprehension questions Check
General
Business Logic in Models Check
All required endpoints return expected JSON data Check
Requests respond with appropriate HTTP Status Code Check
Errors are reported Check
Testing
Passes all Smoke Tests Check
Model Tests - all relations, validations, and custom functions test positive & negative cases Check
Controller Tests - URI parameters and data in the request body have positive & negative cases Check
Overall Nice work you hit all the learning goals for the project. Well done.

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