Skip to content

Comments

Kristy & Tiffany#15

Open
TiffanyChio wants to merge 27 commits intoAda-C12:masterfrom
TiffanyChio:master
Open

Kristy & Tiffany#15
TiffanyChio wants to merge 27 commits intoAda-C12:masterfrom
TiffanyChio:master

Conversation

@TiffanyChio
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 based our ERD off of the project requirements and instructions rather than the seed data. Though we did take a look at the seed data to verify that it contained all the attributes we expected for each model. For our model relationships, Customer has many Rentals and Movie has many Rentals. Rentals belong to both Customers and Movies.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. O(n). It appears that the index actions are pulling n total number of items from the database, where n is the total number of items 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. O(1) We believe that .find_by is a direct lookup in the database.
Describe a set of positive and negative test cases you implemented for a model. For the movie custom method in_stock, we tested a positive case where the method returned a Movie object if the movie was in stock and returned nil when the movie was not in stock.
Describe a set of positive and negative test cases you implemented for a controller. For the Customer controller's index method, we checked for an array of customer hashes and a success response code if customer records existed. If no customer records exist, then an empty array is returned.
How does your API respond when bad data is sent to it? With a JSON containing an error message and a status of bad request.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We decided to create a custom method, decrease_inventory, which decreased the available inventory of a movie by 1 whenever a new rental was checked-out. We did this because we did not want the Rental controller to have business logic, particularly business logic for another model.
Do you have any recommendations on how we could improve this project for the next cohort? Perhaps it would help to have additional clarity over the need for a Rentals controller. It seemed as though the controller was not needed if students did not intend to complete the optional enhancements.
Link to Trello The instructions did not mention a Trello board and this project was sufficiently small that we did not have to split up work. We pair programmed the entire way and thus never needed to use Trello.
Link to ERD Come find us for our hand copy.
Summary Yay! We are done and it seems that building APIs in Rails is pretty similar to building web apps in Rails.

kristyh32 and others added 27 commits November 5, 2019 13:06
added testing for customer model methods
added tests for custom model methods
@jmaddox19
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Great!
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 yes! at least for the checkin case I tested
Testing
Passes all Smoke Tests Yes!
Model Tests - all relations, validations, and custom functions test positive & negative cases missing relationships tests
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