Skip to content

Video Store API / Richelle (water) & Taylor (earth)#32

Open
r-spiel wants to merge 55 commits intoAda-C14:masterfrom
r-spiel:master
Open

Video Store API / Richelle (water) & Taylor (earth)#32
r-spiel wants to merge 55 commits intoAda-C14:masterfrom
r-spiel:master

Conversation

@r-spiel
Copy link

@r-spiel r-spiel commented Dec 4, 2020

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 knew we needed models/controllers for Customer, Video, Rental. And that Rental would belong to both Video & Customer and that Video & Customer would have many rentals.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. Well, we are ordering by index by default, so we think it's O(n log n) due to the .order method for our postgres data. Which we assume is something like the quicksort method.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. while we did use the "post" path it was really a patch request. We still have to search/find by the video/customer (look up for the given video/customer should be O(1)), but finding the matching rental object would be some kind of search algorithm, maybe it's O(log n)? Once the rental object is found it is edited and the found customer/video attributes are also edited.
Describe a specific set of positive and negative test cases you implemented for a model. In video model test: it can can be instantiated with the required fields. It is not valid and won't be instantiated if there is no title/release_date/ etc.
Describe a specific set of positive and negative test cases you implemented for a controller. In the rentals controller tests: it can get the overdue_path when there are overdue rentals and it can still get the path when there are no overdue rentals.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. It prints a json hash with error messages & the applicable HTTP status code.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We used model methods to increment/ decrement Customer videos_checked_out_count & same for Video. We put these in the application model so that it could be accessed by the rental controller. We chose to do this in a model method because it seemed like business logic.

TaylorMililani and others added 30 commits December 1, 2020 15:58
update toggle inventory/customer rental count methods and test
update rental controller and controller tests for error messaging
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