Skip to content

Sabrina & C. Gutierrez#36

Open
CEsGutierrez wants to merge 25 commits intoAda-C12:masterfrom
CEsGutierrez:master
Open

Sabrina & C. Gutierrez#36
CEsGutierrez wants to merge 25 commits intoAda-C12:masterfrom
CEsGutierrez:master

Conversation

@CEsGutierrez
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 used the data to list the attributes for the different classes, which needed to be reflected in the schema, which needed to be able to process the seed data.
What would be the Big-O time complexity of your /customers & /movies endpoints? What does the time complexity depend on? Explain your reasoning. O(n) The program must iterate over each row of the entire SQL table. This applies to both Customers and Movies. (n) in each case would be the number of customers or movies respectively.
What is the Big-O time complexity of the POST /rentals/check-in endpoint? What does the time complexity depend on? Explain your reasoning. O(m + n + o). O(m + n) are driven by non-nested “find_by” functions where the movie and customer are identified based on the params. O(o) is driven by “where” function trying to find the rental matching their IDs and in addition being “nil” which indicates that the rental is active and has not yet been returned
Describe a set of positive and negative test cases you implemented for a model. We tested validations for both valid and invalid inputs. However, we recognize that a lot of functionality currently in the controllers, especially the Rentals Controller, may be better done in the model, which would have been supported by model tests.
Describe a set of positive and negative test cases you implemented for a controller. Movies#show returns a JSON listing a movie’s particular information if there is a valid input. Otherwise, it returns an error message in the form of a JSON.
How does your API respond when bad data is sent to it? It returns error messages and corresponding error codes.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. We left our functionality (wrongly) in the Controller.
Do you have any recommendations on how we could improve this project for the next cohort? Wave 3 Postman tests tested things that were part of the optional endpoints, which makes it difficult to know if we had met Wave 3 requirements.
Link to Trello https://trello.com/b/Q2S4djDe/videostoreapi
Link to ERD https://trello-attachments.s3.amazonaws.com/5dc1d695a50759768ce098f5/5dc1e2ae2f81586eaed1eb64/5937e357d1c1394fb8263425751cf481/VideoStoreAPI.png
Summary Our API speaks for itself.

@CheezItMan
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good granular commits, good commit messages, both team members contributing
Comprehension questions Check
General
Business Logic in Models NONE
All required endpoints return expected JSON data Check
Requests respond with appropriate HTTP Status Code Check
Errors are reported Check
Testing
Passes all Smoke Tests Check
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 Nice work
Overall Really good work, you hit the learning goals here. Excellent job!

Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html

get "/zomg", to: "customers#success", as: "test"

Choose a reason for hiding this comment

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

You don't need to leave this route in?

end
end

def checkin

Choose a reason for hiding this comment

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

These long methods could be broken up into business logic methods in the models.

rental.checkin_date = Date.today
rental.save

movie.available_inventory += 1

Choose a reason for hiding this comment

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

It can be dangerous to keep a field like available_inventory because if other apps interact with the database the available inventory can get out of sync.

It would be better to calculate this value as a method by taking the total inventory and subtracting the number of active rentals.

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