BaseEvent
Base class for all events in the system.
All events must have:
- type: The type of the event (e.g., 'user', 'experiment', 'project', 'system')
- action: The action that occurred (e.g., 'created', 'updated', 'activated')
- data: The main data of the event (e.g., the entity or data involved)
- timestamp: When the event occurred
- triggered_by: The user who triggered this action (None for system actions)
Example: @dataclass class UserCreatedEvent(BaseEvent): type: Literal['user'] = 'user' action: Literal['created'] = 'created' data: User = None triggered_by: User | None = None
Attributes
action: strdata: anytimestamp: datetimetriggered_by: User | Nonetype: str