Skip to content

event

Immutable record of a fact that happened. See Concepts: Event.

Fields

Field Required Description
apiVersion yes schema.esdm.io/core/v1
kind yes event
name yes The Event name (past tense).
scope yes Either scope.aggregate (container-owned) or scope.boundedContext (free-standing within the BC, typically emitted by a DCB-bound Command).
data yes JSON Schema describing the immutable payload. Use data: {} to express "no payload" deliberately.
description no Free-form prose.
metadata no Non-semantic labels and annotations.

ESDM does not model Event versioning as a first-class field. An evolved Event is a new Event type with its own name (e.g. invoice-paid, invoice-paid-v2). Migration and upcasting are implementation concerns outside this schema.

Example

apiVersion: schema.esdm.io/core/v1
kind: event
name: round-started
scope:
  domain: golf-club-management
  boundedContext: round-play
  aggregate: round
data:
  type: object
  properties:
    roundId: { type: string }
    playerId: { type: string }
    courseId: { type: string }
    startedAt: { type: string, format: date-time }
  required: [roundId, playerId, courseId, startedAt]