Skip to main content

Event Design & Schema 📦

This document explains how events are designed, structured, and used in ShopVerse.

Events represent business facts, not actions.


🎯 What Is an Event?

An event is something that already happened in the system.

Examples:

  • Order was placed
  • Payment was successful
  • User registered

Events are:

  • Immutable
  • Append-only
  • Asynchronous

🧠 Event Design Principles

ShopVerse events follow:

  1. Domain-driven naming
  2. Immutable payloads
  3. Standard structure
  4. Loose coupling
  5. Consumer independence

📦 Standard Event Schema

All services publish events using a common schema.

{
"eventType": "ORDER_PLACED",
"service": "ORDER_SERVICE",
"userEmail": "user@example.com",
"entityId": "ORD123",
"amount": 5497,
"timestamp": "2026-01-21T12:30:00",
"metadata": {
"paymentMode": "UPI"
}
}