12 Commits

Author SHA1 Message Date
lizerk
dac0234007 Enforce repository-wide code quality 2026-09-07 19:43:48 +03:00
lizerk
3c5a8c87e2 Update application functionality and supporting components 2026-08-17 13:54:35 +03:00
lizerk
042952b7a9 feat: link tasks with workplace entities 2026-07-06 15:24:37 +03:00
lizerk
9cd21a1b1e procurement: add item comments 2026-05-22 14:57:45 +03:00
lizerk
beb4b8b86b refactor(departments): unify department feed and discussion flows 2026-04-14 16:14:52 +03:00
lizerk
7a3ebbfdff fix(api): preserve role-only department members 2026-04-14 02:24:14 +03:00
lizerk
2574b47923 fix(api): enforce single active department membership 2026-04-14 01:18:32 +03:00
lizerk
274e5767c9 refactor(departments): label role-only members 2026-04-14 00:35:51 +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
51aecacf09 feat(communications): Refactor Chat model to universal GenericForeignKey
BREAKING CHANGES (backward compatible with data migration):
- Add context_object (GenericFK) to replace department FK
- Add flags (JSONField) to replace is_main boolean
- Add extra_data (JSONField) for extensibility
- Rename include_all_employees → include_all_users

NEW FEATURES:
- Generic context support (Department, Project, Team, etc.)
- Flexible flags system without migrations
- Settings-based participant resolver callback
- Zero data loss migrations (4 migrations)

MIGRATIONS:
- 0031: Add new fields (context_object, flags, extra_data)
- 0032: Migrate department → context_object (15 chats)
- 0033: Migrate is_main → flags['is_primary'] (15 chats)
- 0034: Rename include_all_employees → include_all_users

FILES CHANGED:
- models.py: Refactored Chat.get_participants() with callback support
- employees/utils.py: Added resolve_chat_participants() callback
- settings.py: Added COMMUNICATIONS_PARTICIPANT_RESOLVER setting
- verify_chat_migration.py: Command to verify data integrity

TESTED:
✅ All 32 chats migrated successfully
✅ Legacy department FK still works
✅ Context-based chats work (GenericFK)
✅ Global/private/announcement chats work
✅ Participants resolver callback works
2026-03-11 14:21:57 +03:00
c4998c709f Apply updates across all files in the repository 2025-10-20 17:08:40 +03:00