Skip to content

Sophia🥯 ➕ Aimee👾 📼📺📼 Water💦 ➕ Fire🔥#18

Open
marks214 wants to merge 36 commits intoAda-C14:masterfrom
marks214:master
Open

Sophia🥯 ➕ Aimee👾 📼📺📼 Water💦 ➕ Fire🔥#18
marks214 wants to merge 36 commits intoAda-C14:masterfrom
marks214:master

Conversation

@marks214
Copy link

@marks214 marks214 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 read through the readme and the seed data. The videos and customer seed data showed what attributes (and data type) were needed. The rental requirements came from the wiki-page and the postman tests. Overall, the relationship between customers/videos and rentals is many to many.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. Time complexity would be O(n) because the length of the data would change based on how many customers/videos the database has.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. Time complexity would be O(1) because .find_by directly looks up the relevant video and customer for the rental check-in. Even if the length of the data changed, it wouldn’t affect directly looking up the information.
Describe a specific set of positive and negative test cases you implemented for a model. For the video and customer models, we used ‘false’ to make sure the certain fields are completed for a valid model. And ‘true’ to determine if a model is valid. Not all fields had to be validated for a customer/video to be made. For example, in the video model test we checked to see if we could create a valid video by including the required fields. For the negative test case we invalidated the title and the video was unable to save.
Describe a specific set of positive and negative test cases you implemented for a controller. These tests were already included. For example, the create action test can successfully increment the video count and also responds with created. In a negative test, the video path does not exist (-1) and the test responds with a 404 and an error message.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. An API should respond with error messages. For example, if a video doesn’t exist the json errors are ‘Not Found’ and the status is not_found (404).
Describe one of your custom model methods and why you chose to wrap that functionality into a method. The business logic, such as incrementing/decrementing available inventory and/or the videos checked out count, are in the video and customer models. For example, checkin is a method that decrements videos_checked_out_count for the customer. We put the method in the customer model to dry up code in the controller(s) and store the method in its corresponding model.

marks214 and others added 30 commits November 29, 2020 20:36
related rentals to customer and video
added validations to video and customer model
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