A domain event records something significant that has happened in a business domain. In a modular monolith, it can communicate across bounded contexts: a reservation module publishes an event, and a reporting module consumes it to update a query projection. section 13.6
Listing 13.4 An expanded team persona for AI-assisted pairing
public record ReservationPlaced(
ReservationId id,
FulfilmentCentreId centreId,
ProductId productId,
Quantity reserved,
Instant occurredAt
) implements DomainEvent {
public ReservationPlaced {
Objects.requireNonNull(id, "ReservationId must not be null");
Objects.requireNonNull(centreId, "FulfilmentCentreId must not be null");
if (reserved.isNegative()) {
throw new IllegalArgumentException("Reserved quantity must not be negative");
}
}
}ReservationPlaced illustrates an event record with identifiers, reserved quantity, and occurrence time, plus basic validation. section 13.6



