Domain Event Block
A domain event records a meaningful business fact that has already happened.
When To Use It
Use a Domain Event block for something the business would recognize as having occurred: Order Placed, Payment Failed, Claim Approved, Appointment Cancelled. Events are the backbone of EventStorming and are especially important when generating event-sourced or event-driven systems.
Required Data
- Name: past-tense business phrase, such as Shipment Dispatched.
- Owning bounded context: the context where the event has its official meaning.
- Source aggregate or source system: the aggregate or external system that produces the event.
- Event payload: the facts consumers need, such as identifiers, timestamps, amounts, status reason, or actor id.
- Business meaning: a short description of why the event matters.
Recommended Data
- Correlation id: ties events from one business journey together.
- Causation id: identifies the command or event that caused this event.
- Version: useful when the event payload may evolve.
- Retention and audit needs: especially for regulated domains.
- Read models updated: the projections or views that should change after this event.
Connections
- Usually follows a Command handled by an Aggregate.
- May trigger a Policy, Saga, or Integration Event.
- May update one or more Read Models.
Examples
Good Event Names
- Order Placed
- Inventory Reserved
- Claim Evidence Requested
- Subscription Payment Failed
- Appointment Rescheduled
Weak Event Names
- Update Order
- Click Submit
- Save Record
- Set Status
Generation Notes
Code Genie uses domain events to generate event contracts, projection inputs, integration hooks, audit trails, and event-sourced aggregate behaviour when that persistence style is selected. Keep event payloads focused on facts, not screen-only fields.