8 Commits

Author SHA1 Message Date
lizerk
825726e0f0 chore: commit remaining backend and frontend changes, remove legacy test, add missing migrations 2026-03-30 02:17:28 +03:00
lizerk
2031872461 refactor(procurement): approval logic now fully driven by ApprovalRoute table (priority+min_amount), removed hardcoded steps, all workflow is DB-driven; tests and migrations updated 2026-03-30 02:16:29 +03:00
lizerk
c61b62969a Мелкие правки: обновлены serializers.py и views.py для procurement 2026-03-27 18:14:55 +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
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
978ed9a819 fix: aligned ProcurementItem permissions with ProcurementRequest logic
- Added comprehensive permission checks in perform_create()
- Created _check_item_edit_permission() helper method
- Updated perform_update() and perform_destroy() to use helper
- Permission logic now matches CanManageProcurementRequest:
  * Admins/Staff can edit items in DRAFT requests
  * Users with change_procurementrequest permission
  * Request author can edit their own requests
  * Department head can edit requests from their department
- Fixes 403 Forbidden error when creating/editing/deleting items
2025-12-10 17:02:40 +03:00
b787df45f6 refactor: синхронизированы статусные бейджи во всех шаблонах закупок
- Обновлены иконки статусов в dashboard.html и request_list.html
- Все статусы теперь используют одинаковые иконки и стили
- Добавлены функции getStatusBadgeHTML() для динамического рендеринга
- Исправлена синтаксическая ошибка в loadRequests()
- Статусы: draft, pending, approved, rejected, in_progress, completed, cancelled
2025-12-10 16:37:14 +03:00