Skip to content

Conversation

@dkhalife
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 12, 2025 20:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new TaskService layer to handle task operations and broadcast events over WebSockets, and refactors the existing API handlers to delegate to this service.

  • Register TaskService in the application’s DI container (main.go).
  • Implement task CRUD, skip, complete, uncomplete, and history operations in TaskService, each broadcasting corresponding WebSocket events.
  • Refactor internal/apis/task.go to call into TaskService and remove duplicated handler logic.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
main.go Provided TaskService in the FX application setup
internal/services/tasks/task.go Introduced TaskService with methods to manage tasks and WS events
internal/models/task.go Added CreateTaskReq, UpdateTaskReq, and UpdateDueDateReq models
internal/models/label.go Removed unused LabelNotifier interface
internal/apis/task.go Updated API handlers to use TaskService and cleaned up duplication
Comments suppressed due to low confidence (3)

internal/services/tasks/task.go:491

  • [nitpick] Local variable names in Go should start with a lowercase letter; consider renaming TaskHistory to taskHistory.
	TaskHistory, err := s.t.GetTaskHistory(ctx, taskID)

internal/apis/task.go:73

  • [nitpick] Local variables should be camelCase and start lowercase; rename TaskReq to taskReq.
	var TaskReq models.CreateTaskReq

internal/apis/task.go:88

  • [nitpick] Local variables should be camelCase and start lowercase; rename TaskReq to taskReq.
	var TaskReq models.UpdateTaskReq

@codecov
Copy link

codecov bot commented Jul 12, 2025

Codecov Report

Attention: Patch coverage is 0% with 425 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/services/tasks/task.go 0.00% 398 Missing ⚠️
internal/apis/task.go 0.00% 27 Missing ⚠️

📢 Thoughts on this report? Let us know!

@dkhalife dkhalife merged commit b7c4852 into main Jul 12, 2025
4 of 5 checks passed
@dkhalife dkhalife deleted the task-ws branch July 12, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants