Skip to content

Leaves - Daniela and Morgan#26

Open
morganschuler wants to merge 42 commits intoAda-C12:masterfrom
morganschuler:master
Open

Leaves - Daniela and Morgan#26
morganschuler wants to merge 42 commits intoAda-C12:masterfrom
morganschuler:master

Conversation

@morganschuler
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. After looking at the relationships, we realized that both the customers and the movies have a relationship with the rentals, so we set up a many to many relationship that way, with each rental only having one customer and movie.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. We think it is O(n) because we are dealing with arrays, there are n elements and there are not any nested loops.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. We think it would be O(n) because it goes through the array of rentals. It depends on the number of rentals.
Describe a set of positive and negative test cases you implemented for a model. In the rental model tests, we test that the available inventory will decrease if the available inventory is greater than zero, and for the negative case we test that it won't decrease if the available_inventory is zero or less.
Describe a set of positive and negative test cases you implemented for a controller. For the rentals controller, we tested that it will checkout a rental with a valid customer and movie id so that it will return JSON and the rental count will change. In the negative case, we tested that the rental count won't change if a rental has an invalid movie or customer id.
How does your API respond when bad data is sent to it? It will respond with an error.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We created custom model methods for check-in and check-out to handle the calculations of the available_inventory and the movies_check_out_count. We thought that was more closely related to business logic and it would make more sense to put this in a model method.
Do you have any recommendations on how we could improve this project for the next cohort? We thought that the smoke tests were a little hard to understand and we weren't exactly sure of what was being tested. Seeing as we saw Postman several weeks ago, we thought that it would have been nice at the start of this project to get more of a refresher.
Link to Trello https://trello.com/b/EK0hftX3/videostoreapi
Link to ERD https://www.lucidchart.com/documents/edit/7851b069-b9f8-4b9a-84a5-b45760034d04/0_0?shared=true&existing=1&token=3e614e3918c8d1515a198b759b2dece31840a62a-eml%3Dmorganlschuler%2540gmail.com%26ts%3D1573253268797%26uid%3D137055172&docId=7851b069-b9f8-4b9a-84a5-b45760034d04
Summary It was interesting to see how are APIs are made and better understand Postman!

@beccaelenzil
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene yes
Comprehension questions yes
General
Business Logic in Models yes
All required endpoints return expected JSON data yes
Requests respond with appropriate HTTP Status Code yes
Errors are reported yes
Testing
Passes all Smoke Tests yes
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 work! The learning goals around creating a web api and putting business logic in the models were clearly met. I've left one comment noting where your relations tests could be more thorough. Keep up the hard work!

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

Comments