Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Natalia & Cynthia #19

Open
wants to merge 79 commits into
base: master
Choose a base branch
from
Open

Natalia & Cynthia #19

wants to merge 79 commits into from

Conversation

natalia-ku
Copy link

@natalia-ku natalia-ku commented May 13, 2017

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 seed data and and figured out that we need not only movie and customer tables, but also create relationship between them and have rentals join table
List all the completed endpoints of your application. GET 'customers', GET 'movies', GET 'rentals/overdue', GET '/movies/:title', POST '/rentals/:title/check-out', '/rentals/:title/check-in'
Describe a set of positive and negative test cases you implemented for a model. Positive: customer/movie/rental can be created with all attributes, Negative: customer/movie/rental cannot be created if even one attribute is not presented or if attribute is not valid; movie cannot have negative inventory, movie cannot have duplicates in title. For overdue_movies we positive test was: return rentals with status overdue, return instance of Array; negative: return empty array if no overdue rentals was found
Describe a set of positive and negative test cases you implemented for a controller. Positive: api route is working, inventory is updated in create rental action, rental status is changed. Negative: rental would not be created if customer already has that movie checked out or if customer/title DNE; rental would not be created if available inventory is 0
How does your API respond when bad data is sent to it? We decided to give back to user JSON with status bad_request if something went wrong. JSON contains short explanation of errors that has occurred
Describe one of your custom model methods and why you chose to wrap that functionality into a method. Overdue_rentals -finds rentals that are checkout and have due date before today. We put this method in Model in order to separate business logic and controller actions
Do you have any recommendations on how we could improve this project for the next cohort?
Link to Trello
Link to ERD https://www.lucidchart.com/documents/edit/8fc36ed3-de45-4634-8613-d72456229259#

@PilgrimMemoirs
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Well Done
Comprehension questions Well done
General
Business Logic in Models Well Done
All 3 required endpoints return expected JSON data Well Done
Requests respond with appropriate HTTP Status Code Well done
Errors are reported Well Done
Testing
Passes all Smoke Tests Well Done
Model Tests - all relations, validations, and custom functions test positive & negative cases Well Done
Controller Tests - URI parameters and data in the request body have positive & negative cases Mostly Good - relationships not tested
Optionals
POST routes use URI parameter and request body to add a new record to the database Well Done
GET /customers shows how many movies are checked out by a customer Well Done
GET /movies/:title shows updated inventory Well Done
Overall
Instead of having an integer saved to movies and customers based on rentals/inventory - could that number be tracked more dynamically through active record relationships & methods?
Great work completing all required tasks, and the optional post, to expectations. Nice handling of with the various errors that can occur with check-out.

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.

5 participants