Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi-Backend/llms.txt

Use this file to discover all available pages before exploring further.

The Reviews API lets customers rate bakeries after completing an order. Each completed order allows exactly one review. Submitting a review automatically recalculates and updates the bakery’s rating and totalReviews fields.

Review object

id
string
Unique review ID.
bakeryId
string
ID of the reviewed bakery.
userId
string
Firebase UID of the reviewer.
userName
string
Reviewer’s display name.
orderId
string
ID of the completed order being reviewed.
rating
integer
Rating from 1 to 5.
comment
string
Review text.
createdAt
integer
Creation epoch ms.

GET /api/v1/reviews

Returns paginated reviews for a bakery. Public endpoint. Auth required: No
bakeryId
string
required
ID of the bakery.
page
integer
Page number. Default: 1.
pageSize
integer
Results per page. Default: 20.
curl "http://localhost:8080/api/v1/reviews?bakeryId=bak001&page=1&pageSize=10"

POST /api/v1/reviews

Creates a review for a bakery. Requires a completed order from the authenticated user. Auth required: Yes — CUSTOMER
Pass the reviewer’s display name in the X-User-Name request header. It is stored on the review and shown publicly. If omitted, it defaults to "Cliente".
orderId
string
required
ID of the completed order to review.
rating
integer
required
Rating from 1 to 5.
comment
string
Optional review text.
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"orderId":"ord789","rating":5,"comment":"Excelente pan artesanal!"}' \
  http://localhost:8080/api/v1/reviews
Returns 400 if the order is not in COMPLETED status, does not belong to the user, or has already been reviewed.

GET /api/v1/reviews/me

Returns all reviews written by the authenticated customer. Auth required: Yes — CUSTOMER
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/reviews/me

GET /api/v1/reviews/can-review/

Checks whether the authenticated user can review a given order (order is COMPLETED and not yet reviewed). Auth required: Yes — CUSTOMER
orderId
string
required
Order ID to check.
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/reviews/can-review/ord789
Response:
{ "success": true, "data": { "canReview": true } }
canReview: true means the order is reviewable (completed and not yet reviewed).

Build docs developers (and LLMs) love