BREAKING CHANGES:
- API полностью переписан под новую модель (verb вместо category/type)
- NotificationService заменен на stub с NotImplementedError
- Удалена обратная совместимость
API endpoints (обновлены):
- GET /api/v1/notifications/ - новый формат ответа
- GET /api/v1/notifications/verb-types/ - вместо categories
- GET/PUT /api/v1/notifications/preferences/ - вместо settings
- POST /api/v1/notifications/<id>/unread/ - новый endpoint
- DELETE /api/v1/notifications/delete-all-read/ - новый endpoint
Удалены endpoints:
- /api/v1/notifications/categories/ (нет категорий в v2)
- /api/v1/notifications/settings/* (заменено на preferences)
- /api/v1/notifications/telegram/* (Telegram отключен)
- /api/v1/notifications/push/vapid-key/ (не нужен)
- /api/v1/notifications/push/subscriptions/ (не нужен)
services.py:
- Заменен на stub с NotImplementedError
- Все методы выбрасывают исключения с подсказками миграции
- Документация как мигрировать со старого API
Новая структура ответа API:
- verb вместо category/type
- actor (GenericForeignKey) вместо sender
- description вместо message/title
- timesince() вместо created_at
- unread вместо is_read
Старые файлы:
- Удалены все *.old файлы
- Created api/v1/notifications/ module with views.py and urls.py
- Moved API endpoints from notifications/api_views.py to api/v1/notifications/views.py
- Moved URL routing from notifications/api_urls.py to api/v1/notifications/urls.py
- Updated api/urls.py to remove old routing
- Updated api/v1/urls.py to include new notifications API
- Marked old files as DEPRECATED (will be removed in 2 months)
- Added migration documentation
Benefits:
- Unified API structure (employees, documents, notifications all in api/v1/)
- Proper versioning for notifications API
- Easier to maintain and extend
- All API modules follow same pattern
Breaking changes: None (URL paths unchanged, backward compatible)
Migration guide: docs/completed/NOTIFICATIONS_API_MIGRATION.md