Skip to content

Earth + Fire: Emily & Anna#12

Open
annakim93 wants to merge 72 commits intoAda-C14:masterfrom
annakim93:master
Open

Earth + Fire: Emily & Anna#12
annakim93 wants to merge 72 commits intoAda-C14:masterfrom
annakim93:master

Conversation

@annakim93
Copy link

@annakim93 annakim93 commented Dec 3, 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 organized our ERD by looking at the requirements (endpoints) and thinking about how the different models should interact with each other. For Rental, we thought about the associations and whether or not it needed to be a Model of its own.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. Index: O(n); listing all customer and video items; show: O(n); assuming find_by is a linear search; Create: 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. O(n) to find the correct rental with the passed in customer and video ids.
Describe a specific set of positive and negative test cases you implemented for a model. Positive: all required fields are present; negative: missing a required field
Describe a specific set of positive and negative test cases you implemented for a controller. JSON we render when something exists vs doesn't exist
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. Render JSON error message and appropriate status code
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We added custom model methods to Rental so that pieces that go under a specific theme fall together and the controller code is easier to read. (ex. initialize_rental, rental_checkin, is_valid?)

emirry and others added 30 commits December 2, 2020 11:09
annakim93 and others added 30 commits December 3, 2020 15:26
…ations; add status code not_found for invalid video or customer
…not Active Record Relation so that customer methods apply
…o and user in check_in custom action since rental will be nil if those items were invalid
…on't need a class name check; update initialize_rental model method to use snapshot of rental vs finding new video and customer
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