bp/TASKS_MODULE_ROADMAP.md

113 lines
2.7 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.

# План доработки модуля Tasks
> На основе ТЗ п.3.6
---
## Этап 1: RBAC + валидация (Готово ✅)
- [x] `canCreate()` в create(), store()
- [x] `canEdit()` в edit(), update(), moveColumn(), complete(), reopen()
- [x] `canDelete()` в destroy()
- [x] Валидация в store(), update()
- [x] Исправлен нейминг событий: `task.*` (singular)
---
## Этап 2: Подзадачи (Subtasks)
### 2.1 Миграция
```php
task_subtasks (id, task_id, title, is_completed, order_index, created_at)
```
### 2.2 Модель + API
- TaskSubtaskModel
- addSubtask(), toggleSubtask(), deleteSubtask()
### 2.3 View
- Отображение подзадач в task/show.twig
- Чекбоксы для toggle
---
## Этап 3: Чек-листы
### 3.1 Структура
```
task_checklists (id, task_id, title)
task_checklist_items (id, checklist_id, text, is_completed, order_index)
```
---
## Этап 4: Вложения
### 4.1 Миграция
```php
task_attachments (id, task_id, file_name, file_path, file_size, uploaded_by, created_at)
```
### 4.2 API
- uploadAttachment(), deleteAttachment()
---
## Этап 5: Комментарии + @mentions
### 5.1 Миграция
```php
task_comments (id, task_id, user_id, content, mentioned_users(JSON), created_at)
```
### 5.2 Обработка @mentions
- Парсинг `@user_id` из текста
- Создание уведомлений для упомянутых
---
## Этап 6: Зависимости задач
### 6.1 Миграция
```php
task_dependencies (id, blocking_task_id, blocked_task_id, type)
```
### 6.2 Логика
- Проверка при completeTask(): если есть незавершённые blocking tasks — ошибка
---
## Этап 7: Интеграция CRM → Tasks
### 7.1 Events
```php
Events::on('deal.created') создать задачу "Первичный контакт"
Events::on('deal.stage_changed') при этапе "КП" создать задачу
Events::on('deal.won') создать задачу "Благодарность клиенту"
```
---
## Этап 8: Интеграция Booking → Tasks
```php
Events::on('booking.created') создать задачу "Подготовка к встрече"
```
---
## Приоритеты
| Этап | Задача | Оценка |
|------|--------|--------|
| 1 | RBAC + валидация | 4ч ✅ |
| 2 | Подзадачи | 8ч |
| 3 | Чек-листы | 6ч |
| 4 | Вложения | 8ч |
| 5 | Комментарии + @mentions | 12ч |
| 6 | Зависимости | 6ч |
| 7 | CRM → Tasks | 8ч |
| 8 | Booking → Tasks | 4ч |
**Всего:** ~56 часов