28 lines
1.0 KiB
Markdown
28 lines
1.0 KiB
Markdown
# Notifications module
|
||
|
||
Verb-based notifications с REST API, WebSocket, email, Web Push, user preferences, per-chat режимами и синхронизацией жизненного цикла системных уведомлений между устройствами.
|
||
|
||
Канонический guide: [`../../docs/guides/NOTIFICATIONS.md`](../../docs/guides/NOTIFICATIONS.md).
|
||
|
||
## Публичная точка входа
|
||
|
||
```python
|
||
from notifications.signals import notify
|
||
|
||
notify.send(
|
||
sender=actor,
|
||
recipient=user,
|
||
verb="domain_event",
|
||
description="Описание",
|
||
action_url="/target",
|
||
data={"title": "Заголовок"},
|
||
)
|
||
```
|
||
|
||
`NotificationService` удалён из рабочего API и оставлен только как deprecated stub. Не вызывайте sender или Celery task напрямую из доменного кода: это обходит preferences, DND и `transaction.on_commit`.
|
||
|
||
```bash
|
||
cd backend
|
||
pytest tests/api/v1/notifications tests/api/v1/communications tests/realtime -q
|
||
```
|