---
id: catalog-api
name: Catalog API
version: 1.0.0
summary: |
  Internal HTTP and gRPC service for Catalog product management, hybrid
  discovery, and authoritative book metadata.
writesTo:
  - id: catalog-database
  - id: catalog-cache
  - id: catalog-blob
readsFrom:
  - id: catalog-database
  - id: catalog-cache
  - id: catalog-blob
  - id: catalog-vector
entities:
  - id: book
    version: 1.0.0
  - id: author
    version: 1.0.0
  - id: category
    version: 1.0.0
  - id: publisher
    version: 1.0.0
owners:
  - catalog-experience-team
badges:
  - content: Internal
    backgroundColor: gray
    textColor: gray
  - content: HTTP + gRPC
    backgroundColor: teal
    textColor: teal
receives:
  - id: CreatePublisher
    version: 1.0.0
    group: Publisher Management
  - id: UpdatePublisher
    version: 1.0.0
    group: Publisher Management
  - id: DeletePublisher
    version: 1.0.0
    group: Publisher Management
  - id: CreateCategory
    version: 1.0.0
    group: Category Management
  - id: UpdateCategory
    version: 1.0.0
    group: Category Management
  - id: DeleteCategory
    version: 1.0.0
    group: Category Management
  - id: CreateAuthor
    version: 1.0.0
    group: Author Management
  - id: UpdateAuthor
    version: 1.0.0
    group: Author Management
  - id: DeleteAuthor
    version: 1.0.0
    group: Author Management
  - id: CreateBook
    version: 1.0.0
    group: Book Management
  - id: UpdateBook
    version: 1.0.0
    group: Book Management
  - id: DeleteBook
    version: 1.0.0
    group: Book Management
  - id: ListPublishers
    version: 1.0.0
    group: Catalog Queries
  - id: ListCategories
    version: 1.0.0
    group: Catalog Queries
  - id: ListAuthors
    version: 1.0.0
    group: Catalog Queries
  - id: GetBook
    version: 1.0.0
    group: Catalog Queries
  - id: GetBookGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: GetBooksGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: GetDashboardGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: ListBooks
    version: 1.0.0
    group: Catalog Queries
  - id: ListBooksGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: GetBookDetailsGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: ListCategoriesGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: ListAuthorsGrpc
    version: 1.0.0
    group: Catalog Queries
  - id: FeedbackCreatedIntegrationEvent
    version: 1.0.0
    group: Feedback Projection
    from:
      - id: "bookworm.{env}.rating.feedback-create"
        parameters:
          env: development
  - id: FeedbackDeletedIntegrationEvent
    version: 1.0.0
    group: Feedback Projection
    from:
      - id: "bookworm.{env}.rating.feedback-delete"
        parameters:
          env: development
sends:
  - id: BookUpdatedRatingFailedIntegrationEvent
    version: 1.0.0
    to:
      - id: "bookworm.{env}.catalog.book-update-rating-failed"
        parameters:
          env: development
styles:
  icon: /icons/languages/dotnet.svg
specifications:
  - type: openapi
    path: openapi-v1.yml
    name: OpenAPI V1
  - type: asyncapi
    path: asyncapi-v1.yml
    name: AsyncAPI V1
repository:
  language: C#
  url: "https://github.com/foxminchan/BookWorm"
---

## Service Responsibility & Boundary

Catalog API is the system of record within the [[domain|catalog]] domain for [[entity|book]], [[entity|author]], [[entity|category]], and [[entity|publisher]] records, pricing, cover image references, and derived rating summaries. It serves versioned HTTP endpoints for storefront and backoffice workflows, exposes internal gRPC read contracts to peer services, and executes hybrid keyword-and-semantic search. Asynchronous vector index synchronization is delegated to [[service|catalog-ingestion]], while individual customer reviews remain owned by [[service|rating-api]].

## Service Profile

| Property                                  | Value                                                                                                                                                                                         |
| :---------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Bounded Context / Domain**              | [[domain\|catalog]]                                                                                                                                                                           |
| **Owner Team**                            | [[team\|catalog-experience-team]]                                                                                                                                                             |
| **Runtime Style**                         | REST API, gRPC Server, and Async Kafka Consumer/Producer                                                                                                                                      |
| **Public / Gateway Exposure**             | Yes via API Gateway (HTTP) and Internal Only (gRPC)                                                                                                                                           |
| **Authentication & Authorization Policy** | Microsoft Entra ID JWT via [[system\|identity-provider]]; public catalog reads, `business_user` policy for catalog writes, and `admin` policy for dashboard gRPC                              |
| **Owned Data Store(s)**                   | [[container\|catalog-database]] (authoritative), [[container\|catalog-blob]] (cover media), [[container\|catalog-cache]] (read cache), [[container\|catalog-vector]] (read-only search index) |
| **Key Resilience / Idempotency Pattern**  | Transactional outbox/inbox, soft-delete filtering, rate limiting, and dead-letter routing on [[channel\|bookworm.&#123;env&#125;.catalog.dead-letter-queue]]                                  |

## Contracts & Data Ownership

Catalog API owns [[entity|book]], [[entity|author]], [[entity|category]], and [[entity|publisher]] in [[container|catalog-database]], stores cover image bytes in [[container|catalog-blob]], caches selected reads in [[container|catalog-cache]], and queries candidate book IDs from [[container|catalog-vector]] during semantic search.

:::note
Catalog writes trigger database-queued vector updates for [[service|catalog-ingestion]] rather than writing embeddings synchronously. Semantic search always resolves final book details and filters from [[container|catalog-database]] so stale index entries never expose outdated prices or deleted books.
:::

:::warning
When [[service|catalog-api]] consumes [[event|FeedbackCreatedIntegrationEvent]] for a missing book, it publishes [[event|BookUpdatedRatingFailedIntegrationEvent]] so [[service|rating-api]] can execute a compensating delete on the orphaned review.
:::

<MessageTable format="all" limit={20} showChannels={true} />

<Accordion title="Sync & Async Integration Boundaries">
	- **Internal gRPC consumers:** [[service|basket-api]], [[service|order-api]], and
	[[service|mcp-server]] query book pricing, details, categories, authors, and dashboard counts over
	gRPC. - **Kafka feedback projections:** Consumes [[event|FeedbackCreatedIntegrationEvent]] and
	[[event|FeedbackDeletedIntegrationEvent]] from [[service|rating-api]] to maintain derived average
	rating and review count projections.
</Accordion>

## Architecture Visualizations & Specifications

### Catalog API Context

<MermaidFileLoader file="mermaids/CatalogAPI-diagram-1.mmd" />

### Service Interactions

<NodeGraph />

### Owned Entities

<EntityMap />

## Attached Resources & Related Docs

- [[doc|platform/006-api-and-contracts]] — Consolidated service, HTTP, gRPC, and Kafka directory.
- [[service|catalog-ingestion]] — Asynchronous vector-indexing worker.
- [[container|catalog-database]] — PostgreSQL schema, outbox, and vector queue triggers.
- [[container|catalog-cache]] — Redis read-caching strategy.
- [[container|catalog-vector]] — Vector search collection details.
- [[container|catalog-blob]] — Blob storage for book cover images.


 ## Raw Schema:openapi-v1.yml

openapi: 3.2.0
info:
  title: Catalog Service API
  description: "Manages the catalog of products for the BookWorm platform, including books, authors, and categories"
  contact:
    name: BookWorm Engineering
    url: https://github.com/foxminchan
    email: engineering@bookworm.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: "1.0"
  summary: A service responsible for managing the catalog of products for the BookWorm platform
paths:
  /api/v1/publishers:
    put:
      tags:
        - Publisher
      summary: Update Publisher
      description: Updates publisher if it exists
      operationId: UpdatePublisherEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdatePublisherCommand"
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
    get:
      tags:
        - Publisher
      summary: List Publishers
      description: Lists all publishers
      operationId: ListPublishersEndpoint
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PublisherDto"
    post:
      tags:
        - Publisher
      summary: Create Publisher
      description: Creates a new publisher
      operationId: CreatePublisherEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreatePublisherCommand"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublisherId"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
  "/api/v1/publishers/{id}":
    delete:
      tags:
        - Publisher
      summary: Delete Publisher
      description: Delete a publisher from the catalog system
      operationId: DeletePublisherEndpoint
      parameters:
        - name: id
          in: path
          description: The unique identifier of the publisher to be deleted
          required: true
          schema: {}
      responses:
        "204":
          description: No Content
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
  /api/v1/categories:
    put:
      tags:
        - Category
      summary: Update Category
      description: Update a category if it exists
      operationId: UpdateCategoryEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateCategoryCommand"
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
    get:
      tags:
        - Category
      summary: List Categories
      description: List all categories
      operationId: ListCategoriesEndpoint
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CategoryDto"
    post:
      tags:
        - Category
      summary: Create Category
      description: Create a new category in the catalog system
      operationId: CreateCategoryEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateCategoryCommand"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CategoryId"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
  "/api/v1/categories/{id}":
    delete:
      tags:
        - Category
      summary: Delete Category
      description: Delete a category from the catalog system
      operationId: DeleteCategoryEndpoint
      parameters:
        - name: id
          in: path
          description: The unique identifier of the category to be deleted
          required: true
          schema: {}
      responses:
        "204":
          description: No Content
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
  /api/v1/books:
    put:
      tags:
        - Book
      summary: Update Book
      description: Update a book if it exists
      operationId: UpdateBookEndpoint
      parameters:
        - name: If-Match
          in: header
          description: Expected entity tag for optimistic concurrency control; returns 412 Precondition Failed when stale
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/UpdateBookCommand"
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
        "412":
          description: Precondition Failed
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
    query:
      tags:
        - Book
      summary: List Books
      description: List all books with advanced filtering and pagination
      operationId: ListBooksEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ListBooksQuery"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/BookDto"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
    post:
      tags:
        - Book
      summary: Create Book
      description: Create a book
      operationId: CreateBookEndpoint
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/CreateBookCommand"
        required: true
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BookId"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
  "/api/v1/books/{id}":
    get:
      tags:
        - Book
      summary: Get Book
      description: Get a book by identifier
      operationId: GetBookEndpoint
      parameters:
        - name: id
          in: path
          description: The unique identifier of the book to be retrieved
          required: true
          schema: {}
        - name: If-None-Match
          in: header
          description: Entity tag for conditional requests; returns 304 Not Modified when the resource has not changed
          schema:
            type: string
      responses:
        "200":
          description: OK
          headers:
            ETag:
              description: Entity tag representing the current resource version
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BookDto"
        "304":
          description: Not Modified
          headers:
            ETag:
              description: Entity tag representing the current resource version
              schema:
                type: string
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
    delete:
      tags:
        - Book
      summary: Delete Book
      description: Delete a book if it exists
      operationId: DeleteBookEndpoint
      parameters:
        - name: id
          in: path
          description: The unique identifier of the book to be deleted
          required: true
          schema: {}
      responses:
        "204":
          description: No Content
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
  /api/v1/authors:
    put:
      tags:
        - Author
      summary: Update Author
      description: Update an author if it exists
      operationId: UpdateAuthorEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateAuthorCommand"
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
    get:
      tags:
        - Author
      summary: List Authors
      description: List all authors
      operationId: ListAuthorsEndpoint
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/AuthorDto"
    post:
      tags:
        - Author
      summary: Create Author
      description: Create a new author in the catalog system
      operationId: CreateAuthorEndpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAuthorCommand"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthorId"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpValidationProblemDetails"
  "/api/v1/authors/{id}":
    delete:
      tags:
        - Author
      summary: Delete Author
      description: Delete an author from the catalog system
      operationId: DeleteAuthorEndpoint
      parameters:
        - name: id
          in: path
          description: The unique identifier of the author to be deleted
          required: true
          schema: {}
      responses:
        "204":
          description: No Content
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
components:
  schemas:
    AuthorDto:
      required:
        - id
        - name
      type: object
      properties:
        id:
          $ref: "#/components/schemas/AuthorId"
        name: {}
    AuthorId:
      type: string
      format: uuid
    BookDto:
      required:
        - id
        - name
        - description
        - imageUrl
        - price
        - priceSale
        - status
        - category
        - publisher
        - authors
        - averageRating
        - totalReviews
      type: object
      properties:
        id:
          $ref: "#/components/schemas/BookId"
        name: {}
        description: {}
        imageUrl: {}
        price:
          format: double
        priceSale:
          format: double
        status:
          $ref: "#/components/schemas/Status"
        category:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/CategoryDto"
        publisher:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/PublisherDto"
        authors:
          type: array
          items:
            $ref: "#/components/schemas/AuthorDto"
        averageRating:
          pattern: "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"
          type:
            - number
            - string
          format: double
        totalReviews:
          pattern: "^-?(?:0|[1-9]\\d*)$"
          type:
            - integer
            - string
          format: int32
        version:
          pattern: "^-?(?:0|[1-9]\\d*)$"
          type:
            - integer
            - string
          format: int64
          default: 0
    BookId:
      type: string
      format: uuid
    CategoryDto:
      required:
        - id
        - name
      type: object
      properties:
        id:
          $ref: "#/components/schemas/CategoryId"
        name: {}
    CategoryId:
      type: string
      format: uuid
    CreateAuthorCommand:
      required:
        - name
      type: object
      properties:
        name: {}
    CreateBookCommand:
      type: object
      properties:
        name: {}
        description: {}
        image:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/IFormFile"
        price:
          format: double
        priceSale:
          format: double
        categoryId:
          type: string
          format: uuid
        publisherId:
          type: string
          format: uuid
        authorIds:
          type: array
          items:
            type: string
            format: uuid
    CreateCategoryCommand:
      required:
        - name
      type: object
      properties:
        name: {}
    CreatePublisherCommand:
      required:
        - name
      type: object
      properties:
        name: {}
    HttpValidationProblemDetails:
      type: object
      properties:
        type: {}
        title: {}
        status:
          pattern: "^-?(?:0|[1-9]\\d*)$"
          type:
            - "null"
            - integer
            - string
          format: int32
        detail: {}
        instance: {}
        errors:
          type: object
          additionalProperties:
            type: array
    IFormFile:
      type:
        - "null"
        - string
      format: binary
    ProblemDetails:
      type: object
      properties:
        type: {}
        title: {}
        status:
          pattern: "^-?(?:0|[1-9]\\d*)$"
          type:
            - "null"
            - integer
            - string
          format: int32
        detail: {}
        instance: {}
    PublisherDto:
      required:
        - id
        - name
      type: object
      properties:
        id:
          $ref: "#/components/schemas/PublisherId"
        name: {}
    PublisherId:
      type: string
      format: uuid
    Status:
      enum:
        - InStock
        - OutOfStock
    UpdateAuthorCommand:
      required:
        - id
        - name
      type: object
      properties:
        id:
          $ref: "#/components/schemas/AuthorId"
        name: {}
    UpdateBookCommand:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name: {}
        description: {}
        image:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/IFormFile"
        price:
          format: double
        priceSale:
          format: double
        categoryId:
          type: string
          format: uuid
        publisherId:
          type: string
          format: uuid
        authorIds:
          type: array
          items:
            type: string
            format: uuid
        isRemoveImage:
          type: boolean
    UpdateCategoryCommand:
      required:
        - id
        - name
      type: object
      properties:
        id:
          $ref: "#/components/schemas/CategoryId"
        name: {}
    UpdatePublisherCommand:
      required:
        - id
        - name
      type: object
      properties:
        id:
          $ref: "#/components/schemas/PublisherId"
        name: {}
    ListBooksQuery:
      type: object
      properties:
        pageIndex:
          pattern: "^-?(?:0|[1-9]\\d*)$"
          type:
            - integer
            - string
          description: Number of items to return in a single page of results
          format: int32
          default: 1
        pageSize:
          pattern: "^-?(?:0|[1-9]\\d*)$"
          type:
            - integer
            - string
          description: Number of items to return in a single page of results
          format: int32
          default: 20
        orderBy:
          type:
            - string
            - "null"
          description: Property to order results by
          default: Name
        isDescending:
          type: boolean
          description: Whether to order results in descending order
          default: false
        search:
          type:
            - string
            - "null"
          description: Search term to filter results by
        minPrice:
          type:
            - number
            - string
            - "null"
          description: Minimum price to filter results by
          format: double
        maxPrice:
          type:
            - number
            - string
            - "null"
          description: Maximum price to filter results by
          format: double
        categoryId:
          type:
            - array
            - "null"
          items:
            type: string
            format: uuid
          description: Category IDs to filter results by
        publisherId:
          type:
            - array
            - "null"
          items:
            type: string
            format: uuid
          description: Publisher IDs to filter results by
        authorIds:
          type:
            - array
            - "null"
          items:
            type: string
            format: uuid
          description: Author IDs to filter results by
tags:
  - name: Author
  - name: Book
  - name: Category
  - name: Publisher


 ## Raw Schema:asyncapi-v1.yml

---
asyncapi: 3.1.0
info:
  title: Catalog API integration events
  version: 1.0.0
  description: |
    AsyncAPI contract for the Catalog service's Kafka integration events.
    Catalog consumes rating changes from the Rating service and publishes a
    failure event when a feedback-created message references an unknown book.
defaultContentType: application/cloudevents+json
channels:
  feedbackCreated:
    address: bookworm.{env}.rating.feedback-create
    description: Rating service publishes this event when feedback is created.
    parameters:
      env:
        $ref: "#/components/parameters/env"
    messages:
      feedbackCreated:
        $ref: "#/components/messages/FeedbackCreatedIntegrationEvent"
  feedbackDeleted:
    address: bookworm.{env}.rating.feedback-delete
    description: Rating service publishes this event when feedback is deleted.
    parameters:
      env:
        $ref: "#/components/parameters/env"
    messages:
      feedbackDeleted:
        $ref: "#/components/messages/FeedbackDeletedIntegrationEvent"
  bookUpdatedRatingFailed:
    address: bookworm.{env}.catalog.book-update-rating-failed
    description: Catalog publishes this event when a feedback-created event cannot update a book.
    parameters:
      env:
        $ref: "#/components/parameters/env"
    messages:
      bookUpdatedRatingFailed:
        $ref: "#/components/messages/BookUpdatedRatingFailedIntegrationEvent"
operations:
  receiveFeedbackCreated:
    action: receive
    channel:
      $ref: "#/channels/feedbackCreated"
    summary: Consume feedback-created events
    messages:
      - $ref: "#/channels/feedbackCreated/messages/feedbackCreated"
  receiveFeedbackDeleted:
    action: receive
    channel:
      $ref: "#/channels/feedbackDeleted"
    summary: Consume feedback-deleted events
    messages:
      - $ref: "#/channels/feedbackDeleted/messages/feedbackDeleted"
  sendBookUpdatedRatingFailed:
    action: send
    channel:
      $ref: "#/channels/bookUpdatedRatingFailed"
    summary: Publish rating update failures
    messages:
      - $ref: "#/channels/bookUpdatedRatingFailed/messages/bookUpdatedRatingFailed"
components:
  parameters:
    env:
      description: BookWorm deployment environment.
      enum:
        - development
        - staging
        - production
      default: development
  messages:
    FeedbackCreatedIntegrationEvent:
      name: FeedbackCreatedIntegrationEvent
      title: Feedback created
      summary: A new rating was created for a book.
      contentType: application/json
      payload:
        $ref: "#/components/schemas/FeedbackRatingPayload"
    FeedbackDeletedIntegrationEvent:
      name: FeedbackDeletedIntegrationEvent
      title: Feedback deleted
      summary: An existing rating was deleted from a book.
      contentType: application/json
      payload:
        $ref: "#/components/schemas/FeedbackRatingPayload"
    BookUpdatedRatingFailedIntegrationEvent:
      name: BookUpdatedRatingFailedIntegrationEvent
      title: Book rating update failed
      summary: Catalog could not update a book rating for the feedback event.
      contentType: application/json
      payload:
        $ref: "#/components/schemas/BookUpdatedRatingFailedPayload"
  schemas:
    FeedbackRatingPayload:
      type: object
      additionalProperties: false
      required:
        - bookId
        - rating
        - feedbackId
      properties:
        bookId:
          type: string
          format: uuid
          description: Identifier of the book whose rating summary changes.
        rating:
          type: integer
          description: Rating value added to or removed from the book.
        feedbackId:
          type: string
          format: uuid
          description: Identifier of the feedback record.
    BookUpdatedRatingFailedPayload:
      type: object
      additionalProperties: false
      required:
        - feedbackId
      properties:
        feedbackId:
          type: string
          format: uuid
          description: Identifier of the feedback that could not be applied.
