Skip to content

Conversation

@HabenFoto
Copy link

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 Initially, we only had Customer and Video as model & controller. But after we started working on it, then we decided to add Rental in order to make the relationship between Customers and Videos through it.
What would be the Big-O time complexity of your /customers & /videos endpoints? What does the time complexity depend on? Explain your reasoning. For both the customer and video the time complexity should be O(n). It only increment by one as it goes through customers or and videos.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. Similarly time complexity of the post rental check-in is O(n) as it goes linearly to search for video and customer DB to find the current customer and video relatationship to the rental.
Describe a specific set of positive and negative test cases you implemented for a model. We wrote a test to make sure that a rental is valid given all the required fields and that it won’t if those requited fields are missing.
Describe a specific set of positive and negative test cases you implemented for a controller. All the controllers have both positive and negative tests, the Rental controller is the connection to customer and video. A positive example for rental would be, when the customer's id is provided, and a negative example would be when the customer's id isn't provided or is invalid.
Broadly, describe how an API should respond when it handles a request with invalid/erroneous parameters. When given invalid parameters, it should return an error message, maybe with a ’not found’ or ‘bad-request’.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We added a method in our Video model to increment or decrement the inventory of videos. We thought that it would DRY our code overall.

Copy link

@beccaelenzil beccaelenzil left a comment

Choose a reason for hiding this comment

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

Great work on this project. Your code is clear, concise, and well written. You made great choices about custom model methods that helped keep your controllers concise and focused on the task at hand. Your code is well tested. Keep up the hard work!

end
end

describe "check in" do

Choose a reason for hiding this comment

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

Just as in with checkout, you should check that the rental count does (or doesn't) differ as appropriate when you check in.

validates :phone, presence: true
validates :registered_at, presence: true

def add_checked_out

Choose a reason for hiding this comment

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

Great custom model methods that help make your controller super straightforward.

let (:shelley) { customers(:customer_1) }

describe "Validation" do
it "requires name, address, city, state, postal_code, phone, registered_at" do

Choose a reason for hiding this comment

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

Remember to include at least one test that's valid, and one that's not. The test that's not should show that it can not create the customer when each of the required fields is missing.

@beccaelenzil
Copy link

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 ✔️
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 ✔️
Uses controller tests to ensure quality code for every route, and checks for response status and content, with positive cases and negative cases ✔️
Uses controller tests to ensure correctness for check out and check in requirement, and that checked out counts and inventories appropriately change Check-in test doesn't check that the counts change.

Functional Requirements

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

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?
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

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