8 Event Processing Rules

CLE uses a prepend-only event model with the following rules:

  1. Immutability: Once an event is published, it cannot be modified. New events must be added to correct or update information.
  2. Ordering: Events MUST be ordered by ID in descending order (newest events with highest IDs first).
  3. ID Assignment: Event IDs MUST be assigned as auto-incrementing integers in the order events are added (not by effective date).
  4. Processing Order: When processing events, consumers should process them in reverse order (oldest to newest by ID) to build the correct state.
  5. Withdrawn Events: When a withdrawn event is encountered:
    1. The event referenced by eventId should be ignored as if it never existed.
    2. The withdrawn event itself remains in the history for audit purposes.
    3. Any dependent events or calculations based on the withdrawn event should be recalculated.