20 lines
551 B
Python
20 lines
551 B
Python
# app/src/runtime_events/models.py
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from datetime import datetime, timezone
|
|
from typing import Any
|
|
|
|
from src.runtime_events.event_types import RuntimeEventType
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class RuntimeEvent:
|
|
event_type: RuntimeEventType
|
|
source: str
|
|
title: str
|
|
payload: dict[str, Any] = field(default_factory=dict)
|
|
priority: str = "normal"
|
|
dedupe_key: str | None = None
|
|
created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc)) |