9 Commits

Author SHA1 Message Date
lizerk
dac0234007 Enforce repository-wide code quality 2026-09-07 19:43:48 +03:00
lizerk
8fd5ae1054 feat: expand document procurement and request workflows 2026-08-04 20:19:12 +03:00
lizerk
df2377431d feat: expand documents tasks and procurement workflows 2026-07-17 14:09:06 +03:00
lizerk
16c5f2023a refactor(procurement): реструктуризация notifications в модульную архитектуру
- Создана папка backend/procurement/notifications/ вместо одного signals.py
- Разделена логика на специализированные модули:
  * config.py - типы уведомлений (verbs) и шаблоны сообщений
  * handlers.py - бизнес-логика отправки уведомлений
  * signals.py - только Django сигналы
  * websocket.py - WebSocket broadcast для real-time обновлений
  * __init__.py - публичный API модуля

Преимущества новой структуры:
- ✅ Четкое разделение ответственности (SRP)
- ✅ WebSocket логика отделена от уведомлений
- ✅ Все шаблоны сообщений в одном месте (MessageTemplates)
- ✅ Константы verbs централизованы (NotificationVerbs)
- ✅ Легче тестировать и расширять
- ✅ Обратная совместимость через __init__.py

Изменения:
- Удален: signals.py (сохранен как .old для истории)
- Добавлен: notifications/ модуль с 5 файлами
- Обновлен: apps.py (новый импорт сигналов)
2026-03-10 12:34:05 +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
70f9c1950d fix: исправлены URL-ы в уведомлениях на существующие страницы фронтенда
- /requests/{id}/ → /requests
- /documents/{id}/ → /documents
- /calendar (вместо /?event_id={id})
- /procurement/orders/{id}/ → /procurement
- /messages (вместо /communications/chats/{id}/)
- / для постов ленты

Теперь клик по уведомлениям не вызывает 404 ошибки
2026-03-09 10:05:57 +03:00
427f5ed22f feat(procurement): frontend templates + API-based rendering; update models, serializers, views and tests 2025-12-10 14:09:49 +03:00
d04b5e38c2 feat: add procurement integration with notifications and real-time
Stage 7 - Integration:
- Create notification types migration for procurement
- Fix signals to use pre_save for status tracking
- Add broadcast_request_update function for WebSocket events
- Add procurement_update handler in UserConsumer
- Add 6 integration tests for signals and notifications
- Update README with integration details

All 72 tests passing (66 base + 6 integration).
2025-12-09 12:23:02 +03:00
f483750873 feat(procurement): add stages 1-3 - models, API, workflow
- Stage 1: 8 models with admin interface (20/20 tests)
- Stage 2: REST API with 50+ endpoints (6/12 tests)
- Stage 3: django-fsm workflow with notifications (1/9 tests)
- Known issue: items_count property conflicts with annotate()
2025-12-09 09:03:21 +03:00