Digital storefront · Generic domain · EventStorming board

product-content

Holds the description, media and category of each catalogue item, publishes it when complete, and retires it when the item is discontinued.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
3
commands
11
policies
9
read models
2
hot spots
5

The story in 3 key events

The pivotal events: the few that matter most, in the order they happen.

  1. Pivotal eventProductContentPublished
  2. Pivotal eventCategoryTreePublished
  3. Pivotal eventProductContentRetired

Listens to (1): contexts whose events this one reacts to

Tells (1): contexts that react to its events

The board, row by row

11 rows, in the order the business story happens: the main path first, then how this context reacts to the others, then the clock. Rows are small stories; read each one left to right.

  • Event
  • Command
  • Actor
  • Aggregate
  • Policy
  • Read model
  • External system
  • Hot spot
  • Opportunity
  1. Start the content of an item

    A content manager creates a draft for a catalogue item the network already knows. Items the network has discontinued are refused. A draft may be incomplete, and nothing is published yet.

    ActorContent manager
    Read modelKnown catalogue items
    Read modelCategory tree
    CommandCreateProductContentPOST /product-contents
    AggregateProductContent

    Source: application/usecases/content.go · domain/content/commands.go · domain/content/content.go

  2. Revise the content

    The content manager replaces the description, bullets, attributes and media. A draft or live content takes a new revision. Shoppers see it only after the next publish. Retired content cannot be revised.

    ActorContent manager
    Read modelCategory tree
    CommandReviseContentPOST /product-contents/{catalogItemId}/revisions
    AggregateProductContent

    Source: application/usecases/content.go · domain/content/commands.go · domain/content/content.go

  3. Discard a draft

    The content manager throws away a draft that was never published. It is retired as discarded, and nothing is announced because the shopper never saw it.

    ActorContent manager
    CommandDiscardDraftDELETE /product-contents/{catalogItemId}/draft
    AggregateProductContent

    Source: application/usecases/content.go · domain/content/commands.go · domain/content/content.go

  4. Publish the content

    The content manager publishes. It needs a description, exactly one main media item and a category in the tree, and a known, live item. The full content leaves with its revision. Publishing a revision already live does nothing.

    ActorContent manager
    Read modelKnown catalogue items
    Read modelCategory tree
    CommandPublishContentPOST /product-contents/{catalogItemId}/publications
    AggregateProductContent
    EventProductContentPublished
    Systemproduct-discovery
    PolicyReplaces the item's content in its product view, only if the revision is newer

    Source: application/usecases/content.go · domain/content/commands.go · domain/content/content.go · domain/content/events.go

  5. Withdraw published content

    The content manager takes published content down by hand. Retired content is final: it can never be changed or published again.

    ActorContent manager
    CommandRetireContentPOST /product-contents/{catalogItemId}/retirements
    AggregateProductContent
    EventProductContentRetired
    Systemproduct-discovery
    PolicyEnds the item's published content in its product view

    Source: application/usecases/content.go · domain/content/commands.go · domain/content/content.go · domain/content/events.go

  6. Add a category

    The content manager adds a category, at the top or under a parent. The tree has at most four levels and sibling names are unique. There is no draft tree: every change publishes a new version of the whole tree.

    ActorContent manager
    CommandCreateCategoryPOST /categories
    AggregateTree
    EventCategoryTreePublished
    Systemproduct-discovery
    PolicyReplaces its category view when the tree version is newer

    Source: application/usecases/category.go · domain/category/category.go · domain/category/events.go

  7. Move a category

    The content manager moves a category, with its sub-categories, under another parent. A move into its own subtree, or past four levels, is refused. The new tree version is published.

    ActorContent manager
    CommandMoveCategoryPUT /categories/{categoryId}/parent
    AggregateTree
    EventCategoryTreePublished
    Systemproduct-discovery
    PolicyReplaces its category view when the tree version is newer

    Source: application/usecases/category.go · domain/category/category.go · domain/category/events.go

  8. Rename a category

    The content manager renames a category. The paths of its sub-categories follow, and sibling names stay unique. The new tree version is published.

    ActorContent manager
    CommandRenameCategoryPUT /categories/{categoryId}/name
    AggregateTree
    EventCategoryTreePublished
    Systemproduct-discovery
    PolicyReplaces its category view when the tree version is newer

    Source: application/usecases/category.go · domain/category/category.go · domain/category/events.go

  9. Send the category tree again

    The content manager republishes the tree without changing it, so a consumer can catch up. It goes out under the next version.

    ActorContent manager
    CommandPublishCategoryTreePOST /category-tree-publications
    AggregateTree
    EventCategoryTreePublished
    Systemproduct-discovery
    PolicyReplaces its category view when the tree version is newer

    Source: application/usecases/category.go · domain/category/category.go · domain/category/events.go

  10. Keep the list of catalogue items

    offer-availability announces each new item. This context keeps a copy, so it can refuse content for an unknown item without asking. A discontinued item is never made active again by a late message.

    Systemoffer-availability
    EventCatalogItemCreated
    PolicyWhenever an item is created, record it as active unless it is already known
    CommandApplyCatalogItemCreatedstarted by the policy
    Read model · kept up to dateKnown catalogue items

    Source: application/usecases/consume.go · adapters/inbound/kafka/offer_availability.go

  11. Retire content when an item is discontinued

    The network discontinues an item. Published content is retired and announced. A draft is retired quietly, since nothing was ever published. A discontinued item can no longer be published.

    Systemoffer-availability
    EventCatalogItemDiscontinued
    PolicyWhenever an item is discontinued, mark it so and retire its published and draft content
    CommandRetireOnDiscontinuestarted by the policy
    AggregateProductContent
    EventProductContentRetired
    Read model · kept up to dateKnown catalogue items
    Systemproduct-discovery
    PolicyEnds the item's published content in its product view

    Source: application/usecases/consume.go · domain/content/commands.go · adapters/inbound/kafka/offer_availability.go

Hot spots and opportunities

Open questions and known gaps, each taken from a decision record or a document in the repository, never invented. Opportunities are improvements the documentation already names.

Opportunities

This board is a reconstruction from the code and documentation of product-content at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.