Skip to main content

Class Diagram

Built on develop, not deployed

Derived from model/model.yaml. The product-content service is built on develop (IQVO/product-content at 2f09dc0, checked 2026-10-27) and not deployed (no warehouse-infra entry). Every Err... name, REST route and CloudEvents type of this context named on this page exists in the service; where the built service differs from the model's design, the page says so (As built) or the context's Service and operations section lists it.

UML class diagrams of the internal/domain/** packages as the model designs them, plus the hexagonal ports and adapters. Type names come from the model's code identifiers (content.ProductContent, content.Media.RolePrimary, category.Tree, category.Category) and value objects. Fields are unexported in Go and shown with -; methods are shown with +.

As built (IQVO/product-content develop 2f09dc0): the domain packages are internal/domain/category, internal/domain/content. Exported types per package: category: Category, Tree, Snapshot, CategoryTreePublished; content: ID, State, RetiredReason, Role, ItemStatus, Categories, Attribute, Media, Body, ProductContent, Snapshot, ProductContentPublished, ProductContentRetired. Application packages: internal/application/idempotency, internal/application/outbox, internal/application/ports, internal/application/readmodel, internal/application/usecases, internal/application/views; adapters: internal/adapters/inbound/http, internal/adapters/inbound/kafka, internal/adapters/inbound/requestlog, internal/adapters/outbound/clock, internal/adapters/outbound/ids, internal/adapters/outbound/kafka, internal/adapters/outbound/memory, internal/adapters/outbound/outbox, internal/adapters/outbound/postgres, internal/adapters/outbound/repocontract, internal/adapters/outbound/telemetry. Where a type name below differs (the UML keeps the design names), the Ubiquitous Language page carries the built identifier.

1. ProductContent aggregate​

Derived from: model.yaml → contexts[product-content].aggregates[ProductContent] (states, value_objects, commands, invariants, description).

Omitted: read accessors, the Err... variables (ErrUnknownCatalogItem, ErrItemDiscontinued, ErrIncompleteContent, ErrUnknownCategory, ErrContentRetired, ErrTooManyBullets, ErrTooManyAttributes, ErrTooManyMedia; listed on the Aggregate Design Canvas), and the publication timestamps the REST read returns. itemKnown and categoryKnown stand for the existence checks against CatalogItemView and the CategoryTree, and itemDiscontinued for the discontinued flag read from CatalogItemView; the aggregate decides, the use case supplies the facts. The collection bounds (0..10 bullets, 0..50 attributes, 0..12 media) come from the aggregate description and the API schema; they are the named invariants ErrTooManyBullets, ErrTooManyAttributes and ErrTooManyMedia. RetireContent(reason) is also what RetireOnDiscontinue runs, with reason DISCONTINUED.

2. CategoryTree aggregate​

Derived from: model.yaml → contexts[product-content].aggregates[CategoryTree] (states, value_objects, commands, invariants, notes).

Omitted: the Err... variables (ErrCategoryCycle, ErrMaxDepth, ErrDuplicateSiblingName, ErrCategoryInUse, which guards a future removal: no remove-category command exists by design). treeVersion is the published version the event carries; version is the optimistic-concurrency guard of the save. The tree is single (size_estimate: "one tree"), so the repository Get takes no id; the categoryTreeId still keys the Kafka messages. The tree has no status: it is a single published aggregate and every command applies to the live tree and publishes a new version.

3. Domain events and policy​

Derived from: model.yaml → contexts[product-content].publishes, .policies, .read_models.

Omitted: the CloudEvents envelope (built in the Kafka adapter), and the consumed events (CatalogItemCreated, CatalogItemDiscontinued), which are offer-availability's types, decoded in the consumer adapter. The events carry no title, price, stock or PII.

4. Hexagonal ports and adapters​

Derived from: model.yaml → contexts[product-content].aggregates, .inbound, .read_models; conventions.integration_rules (outbox, inbox); the fleet's Go hexagonal layout.

Omitted: the composition root (cmd/product-content), metrics and tracing. ProjectCatalogItems is the projector that writes CatalogItemView; it is not a command of the model and changes no aggregate (its sibling effect, retirement, is the RetireOnDiscontinue policy). There is no outbound REST client adapter: sync_calls is empty. The read routes (ListProductContents, GetProductContent, ListCategories) read the stores through their ports without a use case.