Sunagatov / Iced-Latte

a online Marketplace for coffee retail (Backend)
https://iced-latte.uk
MIT License
610 stars 115 forks source link

Unclear error message. Post review with empty "rating". #309

Open TetianaPerinha opened 6 months ago

TetianaPerinha commented 6 months ago

Describe the bug When sent request post the review with empty rating, system should reject the request and return clear error message.

Precondition: user registered and got Bearer token, user has not posted a review on a product yet.

Step to reproduce: Execute a request like the below with a valid token : curl --location 'https://iced-latte.uk/backend/api/v1/products/ba5f15c4-1f72-4b97-b9cf-4437e5c6c2fa/reviews' \ --header 'Content-Type: application/json' \ --header 'Authorization: {token}' \ --data '{ "text": "Espresso is a beloved coffee that stands as the foundation of many coffee beverages, cherished for its rich, intense flavor and versatility. When crafted correctly, an espresso shot is a concentrated, full-bodied coffee experience that delights the senses. The perfect espresso shot starts with high-quality coffee beans, meticulously sourced and freshly ground just before brewing. ", "rating": "" }'

Expected behavior The system should reject a request and return an error message = "Rating or review should be filled in", "HTTP status code": 400

Actual result The system rejects a request with "HTTP status code": 400, and anunclear error message = "[{ ErrorMessage: must not be null }]

unclear message, post review with empty rating epic6 reviews fr6
palvaibhav commented 6 months ago

Hi @TetianaPerinha, I would like to work on this issue. Let me know If I can start on this.

TetianaPerinha commented 6 months ago

Hi @TetianaPerinha, I would like to work on this issue. Let me know If I can start on this.

Hi, @palvaibhav I have assigned this task to you, you can work on it.

palvaibhav commented 6 months ago

@TetianaPerinha I need some help with the project setup. I don't seem to find few files in the development branch. e.g. ProductReviewRequest This file is missing.

palvaibhav commented 5 months ago

@TetianaPerinha I need some help with the project setup. I don't seem to find few files in the development branch. e.g. ProductReviewRequest This file is missing.

It seems this com.zufar.icedlatte.openapi whole package is not there. Am I missing something ? @Sunagatov