gholamimohsen / StilGalleriet

StillGalleriet
3 stars 0 forks source link

48 reviews order reference #53

Closed Shumisen closed 5 months ago

Shumisen commented 5 months ago

Added helper method isOrderDone(). This method uses a query to see if an order between reviewer(buyer) and seller exists. It returns the value of field isSold in the found Order object. The returned boolean value is used in createReview() to create a new review if true. If false an exception will be thrown and notify user that they are not eligible for reviewing the target user.

How to test: First you need to have an order.

Then you can use the buyer(ratingUserId) and seller(ratedUserId) to create a review. createreview

If you try an order that doesn't exist or where the Order.isSold field is false, you get this response: createreviewfail