Skip to content

command

Expression of intent to change the model. See Concepts: Command.

Fields

Field Required Description
apiVersion yes schema.esdm.io/core/v1
kind yes command
name yes The Command name.
scope yes Either scope.aggregate (container-bound) or scope.dynamicConsistencyBoundary (DCB-bound). The oneOf is structural.
data yes JSON Schema describing the Command's payload. Use data: {} to express "no payload" deliberately.
publishes yes Non-empty list of bare Event names the Command may publish.
actors no Non-empty list of Actor names permitted to issue the Command.
constraints no Named rules shaping how publishes is emitted (ordering, conditional emission, mutual exclusivity).
description no Free-form prose.
metadata no Non-semantic labels and annotations.

Commands deliberately carry no deliveryGuarantee or idempotency. Retries and idempotency keys live in the API/transport layer; idempotency of effect typically falls out of the target's invariants.

Example

apiVersion: schema.esdm.io/core/v1
kind: command
name: start-round
scope:
  domain: golf-club-management
  boundedContext: round-play
  aggregate: round
data:
  type: object
  properties:
    roundId: { type: string }
    playerId: { type: string }
    courseId: { type: string }
  required: [roundId, playerId, courseId]
publishes:
  - round-started
actors:
  - player