- Remove hard-coded Russian translations from backend API - Backend now returns raw verb values (language-agnostic) - Implement frontend translation functions for notification titles and categories - Add category badge system with filters on notifications page - Create translation utilities in frontend (verbTranslations.ts) - Add notification settings page structure - Update API endpoints to return simplified notification data - Refactor notification signals across all apps - Remove deprecated code and tests - Add comprehensive documentation for v2 migration Backend changes: - notifications/api/views.py: Remove translation logic, simplify responses - All notification_signals.py: Update to use consistent patterns - Remove deprecated Telegram bot command - Update Celery tasks for new notification structure Frontend changes: - app/notifications/page.tsx: Add translation functions and category badges - hooks/useNotificationWebSocket.ts: New WebSocket hook for real-time updates - lib/verbTranslations.ts: Centralized translation mappings - components/NotificationCenter.tsx: Update to use new API format This makes the notifications module fully reusable and project-independent.
34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
"""
|
||
URL routing для API v2 уведомлений.
|
||
|
||
Новая архитектура: verb-based notifications с channel preferences.
|
||
"""
|
||
from django.urls import path
|
||
from . import views
|
||
|
||
app_name = 'notifications_api_v1'
|
||
|
||
urlpatterns = [
|
||
# Список и счетчики
|
||
path('', views.get_notifications, name='list'),
|
||
path('count/', views.get_unread_count, name='count'),
|
||
path('verb-types/', views.get_verb_types, name='verb_types'),
|
||
|
||
# Операции с уведомлениями
|
||
path('<int:notification_id>/read/', views.mark_as_read, name='mark_read'),
|
||
path('<int:notification_id>/unread/', views.mark_as_unread, name='mark_unread'),
|
||
path('<int:notification_id>/', views.delete_notification, name='delete'),
|
||
|
||
# Массовые операции
|
||
path('read-all/', views.mark_all_as_read, name='mark_all_read'),
|
||
path('delete-all-read/', views.delete_all_read, name='delete_all_read'),
|
||
|
||
# Настройки каналов
|
||
path('preferences/', views.channel_preferences, name='preferences'),
|
||
|
||
# Web Push интеграция
|
||
path('push/vapid-key/', views.get_vapid_public_key, name='vapid_key'),
|
||
path('push/subscribe/', views.subscribe_push, name='push_subscribe'),
|
||
path('push/unsubscribe/', views.unsubscribe_push, name='push_unsubscribe'),
|
||
]
|