meraproject/openspec/changes/archive/2026-07-14-service-project-members/tasks.md
keboss-m a7f3df859a Add service API for assigning employees to project teams.
Expose PUT /api/service/project-members for external apps that authenticate with only the API key, reusing portal validation while keeping acting-based writes unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 15:30:59 +03:00

20 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 1. Service write endpoint
- [x] 1.1 Создать `app/project_members_service.py` с `PUT /api/service/project-members`
- [x] 1.2 Переиспользовать `ProjectMemberWrite`, `validate_member_write`, `upsert_team_member`, `fetch_member_item` из существующих модулей
- [x] 1.3 Авторизация только через `require_api_key`; не вызывать `parse_acting_emp_id` и `can_write_project_member`
- [x] 1.4 Подключить роутер в `main.py`
## 2. Tests
- [x] 2.1 Unit/API-тесты: успешный insert и update без `X-Acting-Emp-Id`
- [x] 2.2 Тесты валидации: invalid section, archived emp, unknown project/emp, invalid role
- [x] 2.3 Тест: без API-ключа → `401` (когда ключ включён)
- [x] 2.4 Регрессия: `PUT /api/project-members` по-прежнему требует acting и права
## 3. Documentation
- [x] 3.1 Обновить матрицу доступа и раздел записи в `docs/user-reader-api.md`
- [x] 3.2 Кратко отразить эндпоинт в `DEVELOPERS.md` (таблица API / сценарий внешней интеграции)
- [x] 3.3 Добавить пример curl для service PUT в docs