Technical event: ButtonClicked, FileUploaded. Domain event: InvoiceApproved, SubscriptionExpired — carries business meaning and is part of the ubiquitous language.
Order does not know about Notificationclass OrderPlaced {
public function __construct(
public readonly string $orderId,
public readonly string $userId,
public readonly Money $total,
public readonly \DateTimeImmutable $occurredAt,
) {}
}
// After successful persistence:
EventDispatcher::dispatch(new OrderPlaced($order->id, ...));