feat(project): dashboard workload by assignee with subtasks and completion
Replace the scheduled-tasks bar chart with a table of all tasks assigned
per person in scope (no due date needed, filters ignored): main tasks,
subtasks (new GET /api/projects/{id}/subtasks-summary), done counts and
completion rate, plus a total row. Admin only, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -484,6 +484,19 @@ class ProjectStore:
|
||||
project_ids=[project_id], assignee_email=assignee_email, limit=limit,
|
||||
)
|
||||
|
||||
def list_subtasks_of(self, *, parent_ids: list[int]) -> list[dict[str, Any]]:
|
||||
"""하위 업무 요약(대시보드 담당자별 집계용) — 부모 id·담당자·완료 여부만."""
|
||||
ids = sorted({int(i) for i in parent_ids})
|
||||
if not ids:
|
||||
return []
|
||||
with self._pool.connection() as conn:
|
||||
rows = conn.execute(
|
||||
"SELECT parent_task_id, assignee_email, assignee_name, completed_at IS NOT NULL AS done "
|
||||
"FROM tasks WHERE parent_task_id = ANY(%s)", (ids,),
|
||||
).fetchall()
|
||||
return [{"parent_task_id": int(r["parent_task_id"]), "assignee_email": r["assignee_email"] or "",
|
||||
"assignee_name": r["assignee_name"] or "", "done": bool(r["done"])} for r in rows]
|
||||
|
||||
def list_tasks_for_projects(
|
||||
self, *, project_ids: list[int], assignee_email: str | None = None,
|
||||
limit: int = 20000,
|
||||
|
||||
Reference in New Issue
Block a user