Skip to content

Conversation

@nerdyistrendy
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 figured out the relationship between customer and video firs, and then we compared it to Media Ranker and decided that they have an indirect relationship through rental.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. For get (index) request, it's O(n) time complexity which wee will loop through all instances once to list everything. For get (show), we will find the instance by id, which in worst case scenario, will also be O(n). For post request, it is not dependent on the size of our customers/videos, so we think it is constant O(1).
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 will try to find the customer and the video first (get request), so it will take O(n+m) time complexity, and O(1) to send the post request.
Describe a specific set of positive and negative test cases you implemented for a model. Our model validation tests test if we have all the required fields and will return errors if they are missing.
Describe a specific set of positive and negative test cases you implemented for a controller. In our rental controller, we will be able to post checkin/checkout request when we can find the customer and the video. It will respond with not_found if one of them is missing.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. We can tell it to respond with not_found/bad_request and return the error message.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We have increase/decrease_available_inventory in the video model because it is a business logic to video class.

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