From 1eec68ecf9d3277824e1b56650ab9e0362b09b1f Mon Sep 17 00:00:00 2001 From: Trey t Date: Mon, 8 Dec 2025 16:48:39 -0600 Subject: [PATCH] Include TotalSummary in kanban board task responses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add summary field to KanbanBoardResponse so clients can update dashboard stats without making a separate /summary API call. This reduces network calls when refreshing task data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/dto/responses/task.go | 1 + internal/services/task_service.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/internal/dto/responses/task.go b/internal/dto/responses/task.go index 46632bd..78c6811 100644 --- a/internal/dto/responses/task.go +++ b/internal/dto/responses/task.go @@ -127,6 +127,7 @@ type KanbanBoardResponse struct { Columns []KanbanColumnResponse `json:"columns"` DaysThreshold int `json:"days_threshold"` ResidenceID string `json:"residence_id"` + Summary *TotalSummary `json:"summary,omitempty"` } // Note: TaskCompletionListResponse pagination removed - returns arrays directly diff --git a/internal/services/task_service.go b/internal/services/task_service.go index c86b3b9..0ca2053 100644 --- a/internal/services/task_service.go +++ b/internal/services/task_service.go @@ -121,6 +121,9 @@ func (s *TaskService) ListTasks(userID uint) (*responses.KanbanBoardResponse, er } resp := responses.NewKanbanBoardResponseForAll(board) + // Include summary for dashboard stats + summary := s.getSummaryForUser(userID) + resp.Summary = &summary return &resp, nil } @@ -145,6 +148,9 @@ func (s *TaskService) GetTasksByResidence(residenceID, userID uint, daysThreshol } resp := responses.NewKanbanBoardResponse(board, residenceID) + // Include summary for dashboard stats + summary := s.getSummaryForUser(userID) + resp.Summary = &summary return &resp, nil }