corvix.notifications.models

Domain event models for notification delivery.

Classes

NotificationEvent

Canonical event produced when a new unread notification is detected.

DeliveryResult

Result of a single target's delivery attempt.

DispatchResult

Aggregated result of a fan-out dispatch to all enabled targets.

Module Contents

class corvix.notifications.models.NotificationEvent[source][source]

Canonical event produced when a new unread notification is detected.

This is the payload passed to every delivery target. It is deliberately decoupled from the internal NotificationRecord so targets only depend on this stable interface.

event_id: str[source][source]

Stable identifier: {account_id}:{thread_id}.

thread_id: str[source][source]
repository: str[source][source]
reason: str[source][source]
subject_title: str[source][source]
subject_type: str[source][source]
web_url: str | None[source][source]
updated_at: datetime.datetime[source][source]
score: float[source][source]
unread: bool[source][source]
account_id: str = 'primary'[source][source]
class corvix.notifications.models.DeliveryResult[source][source]

Result of a single target’s delivery attempt.

target: str[source][source]
events_attempted: int[source][source]
events_delivered: int[source][source]
errors: list[str] = [][source][source]
property success: bool[source][source]
class corvix.notifications.models.DispatchResult[source][source]

Aggregated result of a fan-out dispatch to all enabled targets.

events: list[NotificationEvent][source][source]
results: list[DeliveryResult] = [][source][source]
property total_delivered: int[source][source]
property total_errors: int[source][source]