Skip to content

Comments

heat::sandy and mackenzie#13

Open
crypt0kitty wants to merge 13 commits intoAda-C14:masterfrom
crypt0kitty:master
Open

heat::sandy and mackenzie#13
crypt0kitty wants to merge 13 commits intoAda-C14:masterfrom
crypt0kitty:master

Conversation

@crypt0kitty
Copy link

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 relied on the information provided in the seed data: customer and video seed data.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. It would depend on the methods used on the objects (.all, .as_json etc.) because we are creating a new local variable that is querying a index. This would be constant, O(1). As for a full table lookup, like listing all customers, this would be O(N) because it is querying a column without an index.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. We think this would be constant, O(1) because we are looking up two models by their id and are not creating a new object.
Describe a specific set of positive and negative test cases you implemented for a model. For the video model, we had a test that checked to see if all fields were present. We had the attribute set to nil for the negative test cast and all present for the positive.
Describe a specific set of positive and negative test cases you implemented for a controller. For the customer controller, it would return 404 status not found for a non-existent customer. Then for the positive, it would return an empty array if there were not customers with a status of okay.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. The API should respond with an error message for the user. This provides a better user experience and the code for this is rendered as JSON in the controller.
Describe one of your custom model methods and why you chose to wrap that functionality into a method.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Video Store API

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
Practices git with at least 10 small commits and meaningful commit messages ✔️, but try to do commit messages describing functionality and not just wave numbers
Understands the importance of how APIs handle invalid/erroneous data in their reflection questions ✔️
Practices Rails best practices and well-designed separation, and encapsulates business logic around check-out and check-in in models ✔️, you only really have creating videos and listing customers so... not really needed at this stage.
Uses controller tests to ensure quality code for every route, and checks for response status and content, with positive cases and negative cases ✔️, for the most part
Uses controller tests to ensure correctness for check out and check in requirement, and that checked out counts and inventories appropriately change NA

Functional Requirements

Functional Requirement yes/no
All provided smoke tests for Wave 1 pass ✔️
All provided smoke tests for Wave 2 pass NA

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 3+ in Code Review && 2 in Functional Requirements 💚

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Descriptive/Readable
Concise
Logical/Organized

Summary

This hits the learning goals for the requirements here.

Comment on lines +2 to +4
def zomg
render json: { message: "it works!" }, status: :ok
end

Choose a reason for hiding this comment

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

🤣

Comment on lines +36 to +38
render json: { #ok: false,
errors: video.errors.messages}, status: :bad_request
return

Choose a reason for hiding this comment

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

👍


must_respond_with :ok
# Edge case
it "will return 404 with JSON for a non-existent customer" do

Choose a reason for hiding this comment

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

No check for a response code

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