26 Commits

Author SHA1 Message Date
lizerk
4ea807ee4b Scope push logout cleanup to device groups 2026-09-04 08:21:25 +03:00
dc4b7ae0a8 Add interactive push notification chat actions 2026-09-03 14:36:00 +03:00
lizerk
205fd7252d Update application features and supporting components 2026-08-19 12:09:01 +03:00
lizerk
138a1284cd Improve commerce, notifications, and task UX 2026-08-18 15:30:55 +03:00
lizerk
cca52d70d6 Refactor project structure and remove obsolete code 2026-08-15 11:16:50 +03:00
lizerk
f34f92cd7d feat: optimize boards and extend workflow media 2026-08-07 17:26:40 +03:00
lizerk
2fec931bda improve requests workspace and notifications 2026-08-07 14:36:59 +03:00
lizerk
c0092437e1 improve procurement request workspace 2026-08-07 14:02:42 +03:00
lizerk
fababde18c feat(notifications): add messenger PWA delivery routing 2026-08-05 15:47:12 +03:00
lizerk
02c72089a0 feat(tasks): expand board collaboration and notifications 2026-08-05 09:34:15 +03:00
lizerk
b9829a613e feat(documents): refine regulations workflow and notifications 2026-07-22 22:34:26 +03:00
lizerk
32500e3037 chore: checkpoint current project changes 2026-06-20 10:47:00 +03:00
lizerk
662dc873bb Fix procurement push notification delivery checks 2026-06-08 16:45:15 +03:00
lizerk
993e26e8ed fix(notifications): normalize action links and request timestamps 2026-04-13 04:02:24 +03:00
lizerk
6132261d69 Normalize notification email frequency preferences 2026-04-11 00:06:14 +03:00
lizerk
9b23f480c2 Refine search routing and deep links 2026-04-03 20:30:29 +03:00
lizerk
613248905e Refactor realtime sync and message UI 2026-04-01 15:20:27 +03:00
lizerk
6ee32111db chore: configure vscode flake8 and commit lint cleanup 2026-03-31 19:17:56 +03:00
lizerk
2815efe069 chore: finalize backend lint cleanup 2026-03-31 17:53:29 +03:00
lizerk
9edb44502a Harden backend warnings and lint policy 2026-03-31 17:19:59 +03:00
lizerk
3f59f8ebb9 Add backend OpenAPI docs and clean test suite 2026-03-31 17:05:31 +03:00
lizerk
2688df46ef Fix: Wrap all unsafe int() conversions with try/except
Fixed ValueError-prone int() calls in:
- communications/api/viewsets.py (4 places: limit, before_limit, after_limit)
- notifications/api/views.py (2 places: page, page_size)
- api/v1/search/views.py (1 place: limit)
- api/v1/procurement/views.py (1 place: quantity)
Also updated audit script to exclude .venv/
2026-03-20 09:10:33 +03:00
lizerk
2ef43e7177 Feature: Add code quality audit tools and safe helpers
- Created CODE_QUALITY_CHECKLIST.md with comprehensive guide
- Added audit_code_patterns.sh for automated code scanning
- Created common/request_utils.py with safe_int(), safe_bool(), etc.
- Fixed unsafe request.data access in notifications/api/views.py
- Updated ldap_password_mixin.py docstring with safe example

Audit found and documented:
- 10 unsafe request.data['key'] accesses
- 8+ unsafe int() conversions without try/except
- Multiple .strip() calls without None checks
2026-03-20 09:06:55 +03:00
lizerk
6fe7eeb222 feat: добавлены realtime бэйджи с уведомлениями в боковую панель
- Исправлена логика подсчёта уведомлений по категориям (n.verb вместо n.category)
- Добавлена синхронизация между компонентами через CustomEvent API
- Реализована автоматическая отметка категории уведомлений при переходе в раздел
- Backend: универсальный endpoint /category/read/ принимающий список verbs
- Frontend: функция getVerbsByCategory() для маппинга категорий
- Счётчики обновляются в реальном времени через WebSocket
- Синхронизация работает между всеми вкладками браузера

Модуль уведомлений остался переиспользуемым - категории управляются на фронте
2026-03-11 08:48:26 +03:00
lizerk
ed636081dc refactor: complete notifications v2 system with frontend translation
- 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.
2026-03-09 21:35:36 +03:00
lizerk
5220a96684 refactor: Модуль notifications полностью самостоятельный и переиспользуемый
КРИТИЧНЫЕ УЛУЧШЕНИЯ:
✅ Убран хардкод 'EUSRR' → универсальное 'My Site'
✅ Созданы email шаблоны внутри модуля (4 файла)
✅ Централизованная конфигурация в config.py
✅ API перемещен в notifications/api/

Новые файлы:
- config.py - централизованные настройки с fallback значениями
- templates/notifications/email/*.html/*.txt - HTML и текстовые шаблоны
- api/__init__.py, api/views.py, api/urls.py - REST API внутри модуля

Изменения в существующих файлах:
- senders/email.py: использует config.site_name() и config.from_email()
- tasks/email.py: rate_limit, max_retries, retry_delay из config
- tasks/push.py: rate_limit, max_retries, retry_delay из config
- tasks/websocket.py: max_retries, retry_delay из config
- api/v1/notifications/urls.py: реэкспорт из notifications.api (обратная совместимость)

Структура шаблонов:
📁 notifications/templates/notifications/email/
  ├── notification.html - красивый HTML для обычных уведомлений
  ├── notification.txt - текстовая версия
  ├── digest.html - HTML дайджест (daily/weekly)
  └── digest.txt - текстовая версия дайджеста

Конфигурация (config.py):
- DEFAULT_CONFIG с fallback значениями для всех параметров
- get_config() - объединяет с settings.NOTIFICATIONS_CONFIG
- Удобные функции: email_rate_limit(), push_max_retries(), site_name()
- Полностью настраиваемо через settings проекта

API внутри модуля:
- notifications/api/views.py - все endpoint'ы
- notifications/api/urls.py - URL patterns
- Относительные импорты (from ..models)
- Обратная совместимость через api/v1/notifications/urls.py

УНИВЕРСАЛЬНОСТЬ:
✅ Нет хардкода проекта
✅ Все шаблоны внутри модуля
✅ API внутри модуля
✅ Конфигурация через settings
✅ Можно скопировать в любой проект Django 5.2+
2026-03-09 17:06:20 +03:00