Create feedback
Creates a feedback rating for a Catalog book and returns its generated UUID.
/api/v1/feedbacksCreateFeedback creates an individual FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs record for a Catalog book in Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and
summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs (POST /rating/api/v1/feedbacks), persists it to Azure Cosmos DB, publishes Feedback createdEventv1.0.0Feedback createdIndicates that a customer feedback rating was created for a book. Rating API
publishes this event so Catalog can update ...Ownercatalog-experience-teamSchemaDiagramOpen docs to Kafka, and returns the generated UUIDv7 feedback identifier (200 OK).
Overview
| Property | Value |
|---|---|
| Bounded Context | Reviews |
| Owner Service | Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs |
| Protocol / Format | HTTP POST, application/json request and response |
| Gateway Endpoint | POST /rating/api/v1/feedbacks (service path /api/v1/feedbacks) |
| Authentication & Authorization | None enforced (optional Microsoft Entra ID JWT partitions per-user rate limiting when present) |
| Idempotency / Concurrency | Not idempotent; Cosmos DB ETag optimistic concurrency on persistence |
| Rate Limit / Caching | Global concurrency (100), per-IP fixed-window (30 req/min), and per-user token bucket (30 tokens, +20 per 10s, queue 5); invalidates feedback list and empty summary caches |
| Contract Version | 1.0.0 (ApiVersions.V1) |
Request & Response Contract
Request Headers
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | JSON request media type |
Authorization | string | No | Bearer <access-token> | Optional Entra ID JWT used to partition per-user rate limiting |
Request Body (application/json)
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
bookId | string (uuid) | Yes | Non-empty UUID; Cosmos DB partition key | Identifier of the Catalog book being reviewed |
firstName | string | Yes | Non-empty, max 50 characters; PII-redacted in logs | Reviewer’s first name |
lastName | string | Yes | Non-empty, max 50 characters; PII-redacted in logs | Reviewer’s last name |
comment | string | null | No | Max 1000 characters when provided | Optional written review comment |
rating | integer | Yes | Inclusive range 0-5 | Whole-number star rating for the book |
Success Response (200 OK)
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
| Root value | string (uuid) | Yes | UUIDv7 | Generated unique identifier of the created feedback record |
Behavior & Side Effects
- Azure Cosmos DB persistence: Persists the FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs document to Cosmos DB (
ratingdb/feedbacks, partitioned by/bookId). - Kafka integration event: Publishes Feedback createdEventv1.0.0Feedback createdIndicates that a customer feedback rating was created for a book. Rating API publishes this event so Catalog can update ...Ownercatalog-experience-teamSchemaDiagramOpen docs to Feedback Created ChannelChannelv1.0.0Feedback Created ChannelKafka topic owned by the contributor team carrying Rating API feedback-created events consumed by Catalog API to update ...Ownercatalog-experience-teamOpen docs so Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs updates the book’s derived rating summary.
- Compensating rollback: If Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs cannot find the target book and emits Book rating update failedEventv1.0.0Book rating update failedIndicates that Catalog could not apply a feedback-created event because the referenced book was not found. Ownercatalog-experience-teamSchemaDiagramOpen docs, Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs deletes the orphaned feedback record and invalidates caches.
- Cache invalidation: Clears cached feedback list entries tagged for
bookIdand clears any cached AI summary whosereviewCountis0. - PII log redaction:
firstNameandlastNameare automatically redacted in structured logs.
Error Responses
| Status / Code | Condition | Client Recovery Action |
|---|---|---|
400 Bad Request | Empty bookId, empty or >50-char firstName/lastName, >1000-char comment, rating outside 0-5, or malformed JSON | Fix the failing fields and resubmit |
409 Conflict | Cosmos DB conflict or concurrency exception | Refresh state or verify whether feedback already exists before retrying |
429 Too Many Requests | Rate limit quota exceeded (Retry-After header included) | Wait for the Retry-After interval before retrying |
500 Internal Server Error | Unexpected Cosmos DB, Kafka, or server failure (traceId included) | Retry with exponential backoff; inspect service logs using traceId |
Related Documentation
- Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs — Service overview, Azure Cosmos DB storage, and AI summarizer.
- FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs — Feedback document model.
- Delete feedbackCommandv1.0.0Delete feedbackDeletes an existing feedback record by its UUID.Ownercatalog-experience-teamSchemaDiagramOpen docs — Remove a feedback record as an administrator.
- Feedback createdEventv1.0.0Feedback createdIndicates that a customer feedback rating was created for a book. Rating API publishes this event so Catalog can update ...Ownercatalog-experience-teamSchemaDiagramOpen docs — Kafka event published on creation.
- List feedbacksQueryv1.0.0List feedbacksReturns feedback for a book with pagination, sorting, and validation responses.Ownercatalog-experience-teamSchemaDiagramOpen docs — Paginate feedback records for a book.
Create feedback schema
not allowedIdentifier of the Catalog book being reviewed.
First name of the reviewer.
150Last name of the reviewer.
150Optional written feedback.
1000Rating value from 0 through 5.
05