Skip to content

Christabel and Sophie#31

Open
steve-messing wants to merge 45 commits intoAda-C14:masterfrom
steve-messing:master
Open

Christabel and Sophie#31
steve-messing wants to merge 45 commits intoAda-C14:masterfrom
steve-messing:master

Conversation

@steve-messing
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 made the decision that customers and videos both have rentals, but there is no direct relationship between customer and video. The seed data made it pretty clear how it was going to be structured, and made clear the need for checkin and checkout actions for Rental.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. If it was a .all it would be O(n), but because we are sorting with the parameterized_list, it has a time complexity of O(n log n)
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(3n log n) or O(n log n) because we are chaining .where, .order and .filter methods and .order is a merge sort which is n log n
Describe a specific set of positive and negative test cases you implemented for a model. checking that increment_checkout_count in Customer increments the checkout count as expected, and returns a NoMethodError if given nil or invalid params.
Describe a specific set of positive and negative test cases you implemented for a controller. show#customer should respond with a :ok or :200 for valid params, and should respond with a :404 :not_found for invalid params.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. should respond with a .json hash with a descriptive status code and error messages.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. increment_checkout_count and decrement_checkout_count are eponymous model methods that are called in customers_controller and affects videos_checked_out_count when a customer checks out or checks in a video.

steve-messing and others added 30 commits December 1, 2020 16:20
…query params for videos#index and customers#index actions
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

Comments