Skip to content

Conversation

@roshni-patel
Copy link

Assignment Submission: Video Store API

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

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.

Reflection

Prompt Response
Explain how you came up with the initial design of your ERD, based on the seed data and reading through the API endpoints We used the seed data to determine what the fields of the customers and videos tables would look like. We also used the endpoints to help identify the models/controllers we would need.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. These endpoints would have a time complexity of O(n) because the time it takes depends on how many customers or videos we have.
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 time complexity would be O(m + n) because rental check in depends on both the videos (m) and customers (n).
Describe a specific set of positive and negative test cases you implemented for a model. In validations for our models, an example of a negative case was checking that a video/customer was invalid without all the required fields. A positive test case was checking that a video/customer was valid when they had all the required fields.
Describe a specific set of positive and negative test cases you implemented for a controller. In the rentals controller, we had a positive test case that confirmed that a rental could be created ("checked out") if there was a customer and video. Similarly, we a negative test case that confirmed that a rental could not be created if either the customer or video does not exist.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. An API should respond with not_found and display the error messages (e.g. "not found").
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We wrote helper methods in our rental model that handled check in and check out. We did this in order to remove business logic (e.g. changing videos checked out count or available inventory) from the controller.

roshni-patel and others added 24 commits December 1, 2020 19:41
added video model validations test
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