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