Skip to content

Fire & Earth - Ida & Kal#26

Open
kashenafi wants to merge 28 commits into
Ada-C14:masterfrom
kashenafi:master
Open

Fire & Earth - Ida & Kal#26
kashenafi wants to merge 28 commits into
Ada-C14:masterfrom
kashenafi:master

Conversation

@kashenafi

@kashenafi kashenafi commented Dec 4, 2020

Copy link
Copy Markdown

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 got the column names for videos and customers from the seed data, then reasoned about what rentals should hold based on the functionality the spec described. We noticed that rentals were associated with a video_id and customer_id, and that we could connect Customer and Video though Rental.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. Index endpoints - O(n) because we are going through an (n-sized) array and returning a list of the elements. Show endpoints - O(n) - where ‘n’ represents total number of customer/video objects. The amount of time the function takes is proportional to n items (a linear relationship).
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(n) because we would be querying the rentals database to see if it has the right combination of customer_id and video_id.
Describe a specific set of positive and negative test cases you implemented for a model. Positive - We checked to see if a video was valid if all fields were properly filled in. Negative - We created multiple tests for when certain attributes were not filled in and checked to see if error messages were returned correctly.
Describe a specific set of positive and negative test cases you implemented for a controller. N/A
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. It should respond with an error status, typically either not_found or bad_request.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. In the Video model, we created an instance method in order to increase or decrease the inventory count.

kashenafi and others added 28 commits December 1, 2020 17:04
added create action and updated index action and create tests. index …
Customer index test + show for videos
Customer validations + relationships
rental checkout positive and negative cases passing
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