64 Commits

Author SHA1 Message Date
4f6244ab1f Fix CORP runtime errors and harden deployment and media access
Some checks failed
Deploy production / deploy (push) Failing after 2s
2026-09-10 16:40:08 +03:00
lizerk
dac0234007 Enforce repository-wide code quality 2026-09-07 19:43:48 +03:00
lizerk
2a598de8d5 Fix quality gate test failures 2026-09-07 19:03:52 +03:00
lizerk
d6706c518b Support multiple employee positions 2026-08-27 10:41:50 +03:00
lizerk
9d16efadec feat: add secret skill anti-streaks 2026-08-26 09:21:34 +03:00
lizerk
2e807d83dd feat: add attendance secret skills 2026-08-26 08:50:00 +03:00
lizerk
dec526898e refactor: confirm skill rarity at fifty xp 2026-08-25 15:25:44 +03:00
lizerk
53871a8f37 feat: weight task skill rewards by role 2026-08-25 14:57:15 +03:00
lizerk
ae4eb4696a feat: add skill ranks and progression 2026-08-25 13:28:43 +03:00
lizerk
f3d2d2fe44 Hide excluded employees from UI-facing APIs and payroll workflows 2026-08-25 10:55:38 +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
a43212733d Refactor project structure and remove obsolete code 2026-08-15 15:32:39 +03:00
lizerk
aaa1da663c refactor: unify observability and realtime updates 2026-08-14 22:49:20 +03:00
lizerk
78f19e27af Remove obsolete files and simplify project structure 2026-08-14 16:35:21 +03:00
lizerk
05d823007d fix(profiles): align personnel and attendance controls 2026-08-10 13:04:03 +03:00
lizerk
01490aa20b Improve employee stats and task card text 2026-07-12 21:22:55 +03:00
lizerk
98096a7af4 Fix request date filters and employee attendance status 2026-07-06 23:39:15 +03:00
lizerk
b12f6ed854 feat: add employee task links 2026-07-06 21:26:52 +03:00
lizerk
0dbd817c60 feat: refine procurement approval access and employee statuses 2026-07-06 10:43:52 +03:00
lizerk
32500e3037 chore: checkpoint current project changes 2026-06-20 10:47:00 +03:00
lizerk
f0024f7a09 Add attendance aliases and weekly summary 2026-05-03 23:02:33 +03:00
lizerk
3a20c3d86a Normalize personnel events and attendance state 2026-04-29 09:54:11 +03:00
lizerk
78b8615871 feat: refine department calendar behavior and UI 2026-04-16 17:22:06 +03:00
lizerk
5700b53f13 feat: add department calendar bindings and cleanup dept permissions 2026-04-16 15:18:43 +03:00
lizerk
32a20a33ee fix: narrow department chat comment notifications 2026-04-16 12:55:04 +03:00
lizerk
1296ec9021 Fix employee sorting and department counters 2026-04-15 02:12:32 +03:00
lizerk
35a7250183 refactor(ui): polish chat, requests, and profile actions 2026-04-14 23:11:32 +03:00
lizerk
70d2c55348 refactor(ui): polish department feed and mobile nav placement 2026-04-14 19:11:17 +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
2d00699831 fix(ldap): nest department role groups into department group 2026-04-14 01:07:13 +03:00
lizerk
274e5767c9 refactor(departments): label role-only members 2026-04-14 00:35:51 +03:00
lizerk
c56fdbb915 feat(frontend): align employee profile flows 2026-04-12 06:27:18 +03:00
lizerk
7dcf84dcd1 feat(auth): add session management and settings integration 2026-04-11 23:31:14 +03:00
lizerk
81b8d29b38 Refactor department LDAP sync around canonical service flows 2026-04-10 20:54:09 +03:00
lizerk
3f59f8ebb9 Add backend OpenAPI docs and clean test suite 2026-03-31 17:05:31 +03:00
lizerk
f88d90230b refactor: clean architecture, align tests to current API contracts, all tests green [deploy-ready] 2026-03-30 04:27:18 +03:00
lizerk
0539f50233 refactor: переход на строгий AD-only LDAP, регистрация + верификация email
- Удалён LDAP_SERVER_TYPE и все OpenLDAP ветки кода
- user_service.py: только AD (sAMAccountName, UAC, microsoft.modify_password)
- auth_backends.py: AD фильтры и атрибуты (objectCategory, objectGUID)
- Удалён server_configs.py (больше не нужен)
- Удалён OpenLDAP Docker окружение (docker-compose.ldap.yml, ldap/, QUICKSTART_LDAP.md)
- Фронтенд: мульти-шаговая регистрация, AvatarCropper 3:4, verify-email страница
- Убран CSRF для JWT API, IP-ограничения работают независимо
- Полевые ошибки регистрации с красной подсветкой на фронте
2026-03-19 00:48:13 +03:00
lizerk
50169ec09d refactor(api): удалить монолитный views.py (4500 строк)
- Удалён дублирующий монолит api/v1/employees/views.py (4622 строки)
- Все ViewSet'ы уже реэкспортированы в views/__init__.py
- Обновлены импорты в extended_views.py, analyze_queries.py, тестах
- -4622 строки дублированного кода

Импорты 'from api.v1.employees.views import X' работают через views/__init__.py
2026-03-18 15:46:23 +03:00
a590acb762 feat(frontend): добавлен API клиент и восстановлен backend из master
- Создан frontend/src/lib/api.ts с 43 методами для всех API endpoint'ов
- Создан frontend/src/lib/permissions.ts для проверки прав доступа
- Исправлен URL в getChatMessagesAround: /messages/around/ → /messages-around/
- Исправлен параметр: message_id → around_id
- Восстановлен backend из ветки master для стабильности
- Удалены конфликтующие файлы Pages Router (src/pages, App.tsx, providers)
- Оставлена только чистая структура Next.js App Router
- Добавлена документация по миграции API v2
2026-02-24 15:40:50 +03:00
fcf4bff3a9 fix: add ensure_ldap_disabled to 71 tests to prevent LDAP sync issues 2026-02-16 21:44:53 +03:00
a335594932 fix: remove mocks from LDAP tests, use real LDAP integration, set gender default=0 2026-02-16 21:12:25 +03:00
4629a52834 fix: resolve test failures - add logger, LDAP_POSITIONS_BASE, make avatar/gender optional, add ensure_ldap_disabled fixtures 2026-02-16 17:38:00 +03:00
ad8208789f feat: add LDAP testing infrastructure
- Add LDAP docker container structure (01-base-structure.ldif)
- Add .env.test with LDAP configuration for tests
- Create tests/ldap_fixtures.py with LDAP-specific fixtures
- Create tests/api/v1/employees/test_helpers.py with centralized helpers
- Add LDAP markers to pytest.ini (ldap_required, ldap_optional)
- Add comprehensive LDAP testing documentation
- Fix test_department_head_rights.py to use centralized helpers

New fixtures:
- ldap_available: checks if LDAP server is accessible
- ldap_config: returns LDAP configuration
- ensure_ldap_enabled/disabled: force LDAP state for test
- ldap_cleanup: auto-cleanup LDAP entries after test

New helpers:
- make_user(): centralized user creation
- grant_permission(): permission assignment
- make_department/position/role(): entity creation
- extract_results(): paginated response helper

Infrastructure:
- OU=Users, OU=Departments, OU=Groups, OU=Positions, OU=Dismissed
- Test groups: Developers, Managers
- Test departments: IT, HR
2026-02-16 17:31:48 +03:00
3977c99c0c test: fix tests after views split
- Remove @pytest.fixture from make_user (it's a helper function, not a fixture)
- Update _is_ldap_enabled patch paths to api.v1.employees.views._helpers
- Fixes AttributeError and fixture calling errors
2026-02-16 17:25:25 +03:00
59b8f56c5a refactor(employees): simplify create() using ExternalSystemSyncMixin
Replaced 150+ lines of manual transaction management with mixin:

Before:
- Manual transaction.atomic()
- Manual LDAP sync calls
- Duplicate code for LDAP/non-LDAP modes
- Manual error handling and rollback
- ~150 lines of boilerplate

After:
- create() delegates to super() - миксин управляет всем
- perform_create() - только БД логика (30 lines)
- handle_external_sync_result() - обработка LDAP результата
- Миксин автоматически управляет транзакциями и откатами

Changes:
1. create(): simplified to validation + super().create()
2. perform_create(): creates Employee in DB, sets password/avatar/skills
3. prepare_external_data(): builds DTO with avatar_bytes, group_cns
4. handle_external_sync_result(): saves DN/GUID to LdapSyncState,
   sets employeeNumber, assigns position

5. ExternalSystemSyncMixin: added handle_external_sync_result() hook
   for custom post-sync actions

Code reduction: 150 lines -> 80 lines
Benefits: cleaner, DRYer, automatic error handling

manage.py check: no issues
2026-02-16 17:07:15 +03:00
423f14831d test: fix import errors after views.py split
- Fix IndentationError in test_poll_complete.py (remove duplicate lines)
- Fix ImportError in test_ldap_optional_helpers.py (update import path to _helpers module)

Tests now collect 515 items without collection errors.
11 pre-existing test failures remain (auth registration issues unrelated to refactoring).
2026-02-16 16:47:17 +03:00
4c398856ae Update API tests: improve fixtures and LDAP optional mode support 2026-01-21 18:00:11 +03:00