Skip to content

Conversation

@elle-terch
Copy link

Video Store API

Congratulations! You're submitting your assignment!
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.

Comprehension Questions

Question Answer
Explain how you came up with the design of your ERD, based on the seed data. We looked at project requirements, matched the fields and figured out the relations between them.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. It would be O(n) because it depends on how many items are in that array.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. It would be O(n) + O(1) because it has to iterate through the collection to find one with the given id. And then it changes the single one, which is a constant time complexity. Overall it adds up to linear.
Describe a set of positive and negative test cases you implemented for a model. A positive case is checking to ensure that there is a title and inventory number for a given movie. A negative case is missing one or both of the two fields (should return an error).
Describe a set of positive and negative test cases you implemented for a controller. A positive test case is that the movies controller will create a new movie when given title, release date, overview and inventory. It will increase the movie count by one and respond with success. If any piece of the movie data is invalid (ex: the title being nil), the movie count won't change and it will respond with bad request.
How does your API respond when bad data is sent to it? It returns an error code and message describing what went wrong.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We wrote a custom controller method for checking out a rental that created a new instance of a rental valid rental params. It returns the id of the rental in json.
Do you have any recommendations on how we could improve this project for the next cohort? It would have been helpful to go over smoke tests more in class. Specifically, how they differ from other tests, how to identify errors in your code, and how to modify the smoke tests if your code did something slightly different.
Link to Trello https://trello.com/b/adS9OCOV/linday-carly-api
Link to ERD https://slack-files.com/files-pri-safe/TASRJV6S2-FDX7ATKB4/videostore_-_erd.pdf?c=1541807644-640fb5654e9e58ac5483d538923c2faf0b2be4b7 (also on trello board if link doesn't work)
Summary

@tildeee
Copy link

tildeee commented Nov 20, 2018

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene x
Comprehension questions x
General
Business Logic in Models didn't get to functionality that could demonstrate this
All required endpoints return expected JSON data good start
Requests respond with appropriate HTTP Status Code good start
Errors are reported
Testing
Passes all Smoke Tests
Model Tests - all relations, validations, and custom functions test positive & negative cases good start
Controller Tests - URI parameters and data in the request body have positive & negative cases good start
Overall

Hi y'all!

This project has a really solid start-- from what I can tell, the code that is there looks good.

I think there was one major hangup about creating a movie. Once that's fixed, most of Wave 2 is fixed! I'm adding a comment there.

Other than that, the parts that are missing are a lot of the update logic for Rentals... updating a rental (with checkin and checkout) also affects the movies and customers.

That being said, I see a good start: the tests for controllers and models feel good too.

Let me know if y'all have any questions

private

def movie_params
params.require(:movie).permit(:title, :overview, :release_date, :inventory)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Rails when we used forms, params would come back populated with a nested structure that had movie in it. In this API, we won't have that nested structure, so we need to take out the .require('movie') bit. When we do this, then most of Wave 2 starts working :)

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.

3 participants