Sequence Diagrams
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.
One UML sequence diagram per command use case on Use Cases. Participant names are the packages and ports the model designs, from the Class Diagram:
httpandkafkaare the inbound adapters.- The use case is in
internal/application/usecases. Postgresstands for the repositories, the catalog item store, the outbox, the inbox and the idempotency store. They share one transaction throughUnitOfWork.Relay / Kafkais the outbox relay. It reads committedoutbox_eventsrows and publishes them toretailnetwork.product-content.events.
Every save is conditional on the loaded version (optimistic concurrency).
Full CloudEvents types are on Domain Events.
1. CreateProductContent (REST POST /product-contents)
Derived from: model.yaml → contexts[product-content].aggregates[ProductContent]
(CreateProductContent, ErrUnknownCatalogItem, ErrItemDiscontinued,
ErrTooManyBullets, ErrTooManyAttributes, ErrTooManyMedia,
ErrUnknownCategory),
.read_models; apis/product-content/openapi.yaml.
Omitted: the schema validation (422 validation-failed), which happens in the
adapter before the use case. A lagging
CatalogItemView rejects content for a brand-new item: the manager retries
after the projection catches up.
2. ReviseContent (REST POST /product-contents/catalogItemId/revisions)
Derived from: model.yaml → contexts[product-content].aggregates[ProductContent]
(ReviseContent, ErrContentRetired, ErrUnknownCategory, transitions).
Omitted: the DRAFT case, which is ReviseDraft (diagram 10). The revision
reaches product-discovery through the next PublishContent
(PUBLISHED → PUBLISHED, diagram 3).
3. PublishContent (REST POST /product-contents/catalogItemId/publications)
Derived from: model.yaml → contexts[product-content].aggregates[ProductContent]
(PublishContent, ErrItemDiscontinued, invariants, transitions
DRAFT → PUBLISHED and PUBLISHED → PUBLISHED),
.publishes[ProductContentPublished];
conventions.integration_rules.
Omitted: nothing beyond the shared notes at the top.
4. RetireContent by the content manager (REST POST .../catalogItemId/retirements)
Derived from: model.yaml → contexts[product-content].aggregates[ProductContent]
(RetireContent, transitions), .publishes[ProductContentRetired].
Omitted: the relay marking the row published (as in diagram 3). A DRAFT
is not retired by hand: it is discarded with DiscardDraft (diagram 10).
5. RetireContent by policy (Kafka CatalogItemDiscontinued)
Derived from: model.yaml → contexts[product-content].policies[RetireOnDiscontinue],
.consumes (CatalogItemDiscontinued), .publishes[ProductContentRetired].
Omitted: the CatalogItemCreated projection (same shape, no policy branch,
no outbox row). The view update commits before the content load so a crash
in between is healed by the replay.
6. CreateCategory (REST POST /categories)
Derived from: model.yaml → contexts[product-content].aggregates[CategoryTree]
(CreateCategory, invariants); apis/product-content/openapi.yaml.
Omitted: the 404 for an unknown parentId: as built the API answers an
unknown parent with 422 unknown-category, not a not-found.
7. MoveCategory (REST PUT /categories/categoryId/parent)
Derived from: model.yaml → contexts[product-content].aggregates[CategoryTree]
(MoveCategory, invariants); apis/product-content/openapi.yaml.
ErrCategoryInUse is not raised: there is no remove-category command by
design, and the guard is for a future removal.
Omitted: nothing beyond the shared notes.
8. RenameCategory (REST PUT /categories/categoryId/name)
Derived from: model.yaml → contexts[product-content].aggregates[CategoryTree]
(RenameCategory, ErrDuplicateSiblingName).
Omitted: nothing beyond the shared notes.
9. PublishCategoryTree (REST POST /category-tree-publications)
Derived from: model.yaml → contexts[product-content].aggregates[CategoryTree]
(PublishCategoryTree, transitions), .publishes[CategoryTreePublished].
Omitted: nothing beyond the shared notes. PublishCategoryTree re-publishes
the live tree unchanged so consumers can resync; the structural invariants need
no re-check at publication: they hold for the live tree at all times.
10. ReviseDraft and DiscardDraft (REST POST .../catalogItemId/revisions on a DRAFT, DELETE .../catalogItemId/draft)
Derived from: model.yaml → contexts[product-content].aggregates[ProductContent]
(ReviseDraft, DiscardDraft, transitions DRAFT → DRAFT and
DRAFT → RETIRED); apis/product-content/openapi.yaml.
Omitted: the optimistic-concurrency retry, as in diagram 2.