- https://blog.logrocket.com/build-rest-api-node-express-mysql/
- https://www.youtube.com/watch?v=SccSCuHhOw0
- Logic: Given a specific genre, return a list of books for that genre.
- HTTP Request Type: GET
- Parameters Sent: Genre
- Response Data: JSON List of book objects
- Logic: Return the top 10 books that have sold the most copies in descending order (most copies sold would be #1)
- HTTP Request Type: GET
- Parameters Sent: None
- Response Data : JSON List of book objects
- Logic: Filter by rating higher or equal to the passed rating value.
- HTTP Request Type: GET
- Parameters Sent: Rating
- Response Data: JSON List of book objects
- Logic: Update the price of all books under a publisher by a discount percent.
- HTTP Request Type: PUT or PATCH
- Parameters Sent: Discount percent, Publisher
- Response Data: None
- Logic: Provided the user fields, create the user in the database.
- HTTP Request Type: POST
- Parameters Sent: User Object
- Response Data: None
- Logic: Given a specific username, retrieve the user details.
- HTTP Request Type: GET
- Parameters Sent: Username
- Response Data: JSON User object.
- Logic: Given the username as a key lookup value and any other user field, update that user field with the new param value.
- HTTP Request Type: PUT / PATCH
- Parameters Sent: Username
- Response Data: None
- Logic: Given a user name and credit card details, create a credit card for that user.
- HTTP Request Type: POST
- Parameters Sent: User name, Credit Card Object
- Response Data: None
- Logic: Give a user Id,return the subtotal of the books in the cart.
- HTTP Request Type: GET
- Parameters Sent: User Id
- Response Data: Calculated Subtotal
- Logic: Provided with a book Id and a User Id, add the book to the user’s shopping cart.
- HTTP Request Type: POST
- Parameters Sent: Book Id, User Id
- Response Data: None
- Logic: Give a user Id, return a list of books that are in the shopping cart.
- HTTP Request Type: GET
- Parameters Sent: User Id
- Response Data: List of Book Objects
- Logic: Given a book If and a User Id, remove the book from the user’s shopping cart.
- HTTP Request Type: DELETE
- Parameters Sent: Book Id, User Id
- Response Data: None
price, author, genre, publisher , year published and copies sold.
- Logic: Given a Book’s info, add it to the system.
- HTTP Request Type: POST
- Parameters Sent: Book Object
- Response Data: None
- Logic: Given a book id, retrieve the book information
- HTTP Request Type: GET
- Parameters Sent: Book Id
- Response Data: Book object JSON
publisher
- Logic: Given an Author’s Info, add it to the system.
- HTTP Request Type: POST
- Parameters Sent: Author Object
- Response Data: None
- Logic: Given an Author’s Id, return the list of books for that author.
- HTTP Request Type: GET
- Parameters Sent: Author Id
- Response Data: JSON list of Book Objects
- Logic: Create a rating for a book given by a user.
- HTTP Request Type: POST
- Parameters Sent: Rating, User Id, Book Id
- Response Data: None
- Logic: Create a comment for a book given by a user.
- HTTP Request Type: POST
- Parameters Sent: Comment, User Id, Book Id
- Response Data: None
- Logic: Retrieve a list of comments for the book
- HTTP Request Type: GET
- Parameters Sent: Book Id
- Response Data: JSON list of comments
- Logic: Given a book Id, calculate the average rating as a decimal.
- HTTP Request Type: GET
- Parameters Sent: Book Id
- Response Data: Computed Average rating (decimal)
- Logic: Given a user Id and a wish list name, create the wishlist.
- HTTP Request Type: POST
- Parameters Sent: Wish list name, User Id
- Response Data: None
- Logic: Given a book Id and a wish list Id, add the book to that wish list.
- HTTP Request Type: POST
- Parameters Sent: Book Id, Wishlist Id
- Response Data: None
- Logic: : Given a book Id and a wish list Id, remove the book to that wish list.
- HTTP Request Type: DELETE
- Parameters Sent: Book Id, Wishlist Id
- Response Data: None
- Logic: Given a wishlist Id, return a list of the books in that wishlist.
- HTTP Request Type: GET
- Parameters Sent: Wishlist Id
- Response Data: JSON LIST of books in the user’s wishlist.