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

Handle HTTP request to add a new review #9

Open
EmadAghaei opened this issue Apr 17, 2019 · 2 comments
Open

Handle HTTP request to add a new review #9

EmadAghaei opened this issue Apr 17, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@EmadAghaei
Copy link
Member

EmadAghaei commented Apr 17, 2019

A user may write a review of an item, generating an HTTP request to add a new review for the item. The handler should look up the item based on the item id, add the review to the list of reviews, and persist the update item to the database. If the item cannot be found, a meaningful response should be returned with a description. The handler interacts with a persistence library to store the data. The handler should also check the validity of the input arguments. If any of the input arguments are empty or null, a 400 response should be returned with a description.

Important notes: The endpoint address is "/reviewAnItem". The URL query parameters are: "userId" , "itemId","comment", and "rating".

@EmadAghaei EmadAghaei added the enhancement New feature or request label Apr 17, 2019
@tlatoza tlatoza changed the title Implement a new HTTP request, write a review for an item Implement a new HTTP request to write a review for an item Sep 13, 2019
@tlatoza tlatoza changed the title Implement a new HTTP request to write a review for an item Implement a handler for an HTTP request to write a review for an item Sep 13, 2019
@tlatoza tlatoza changed the title Implement a handler for an HTTP request to write a review for an item Handle HTTP request to add a new review Sep 13, 2019
@EmadAghaei
Copy link
Member Author

In order to validate the input we need to make some assumptions:

  • max comment length: 254 characters
  • rating range: 1- 10
    Let me know, if these need to be adjusted

@EmadAghaei
Copy link
Member Author

For compatibility with REST API documentation, the review parameters should be passed via POST request instead of GET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant