As a user I want to be able to rate a game on a scale of one to ten, ten being the best, so others can know what people think of the game.
Acceptance criteria:
if a user is logged in, on the game details view they see a simple form with two fields, a number field for rating with min=1 and max=10, and a text area that allows them to write a review.
the rating field is required and must be an integer between 1 and 10, the review is optional and in provided can contain anything.
anyone (guest or logged in user) can see an average rating and previous reviews on the game details view.
the previous reviews should list by newest first, and show the username that wrote the review and what date they wrote it.
Tech notes:
we will have to update the create_game_user_table migration to include a text field called "review" that can be null, and a "on_wishlist" boolean field that defaults to false
we should rename the Wishlist pivot table to GameUser since it represents not only the wishlist but also the game rating and review
we will have to update the logic of the toggleWishlist and getWishlistByUserId methods, as we can no longer rely on the relationship simply existing; we will have to look at the "on_wishlist" field to know if the game is on the user's wishlist or not. Refer to the documentation for the various methods of updating many-to-many relationships
this will involve creating a new controller endpoint for posting the form data. that endpoint should call a new GameService method to save the data, and then redirect back to the game details view (regardless of save success or failure). Any validation errors should display accordingly. Validation should occur in a FormRequest
As a user I want to be able to rate a game on a scale of one to ten, ten being the best, so others can know what people think of the game.
Acceptance criteria:
Tech notes: