Migrate from Gin to Echo framework and add comprehensive integration tests
Major changes: - Migrate all handlers from Gin to Echo framework - Add new apperrors, echohelpers, and validator packages - Update middleware for Echo compatibility - Add ArchivedHandler to task categorization chain (archived tasks go to cancelled_tasks column) - Add 6 new integration tests: - RecurringTaskLifecycle: NextDueDate advancement for weekly/monthly tasks - MultiUserSharing: Complex sharing with user removal - TaskStateTransitions: All state transitions and kanban column changes - DateBoundaryEdgeCases: Threshold boundary testing - CascadeOperations: Residence deletion cascade effects - MultiUserOperations: Shared residence collaboration - Add single-purpose repository functions for kanban columns (GetOverdueTasks, GetDueSoonTasks, etc.) - Fix RemoveUser route param mismatch (userId -> user_id) - Fix determineExpectedColumn helper to correctly prioritize in_progress over overdue 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -105,7 +106,7 @@ func TestTaskService_CreateTask_AccessDenied(t *testing.T) {
|
||||
now := time.Now().UTC()
|
||||
_, err := service.CreateTask(req, otherUser.ID, now)
|
||||
// When creating a task, residence access is checked first
|
||||
assert.ErrorIs(t, err, ErrResidenceAccessDenied)
|
||||
testutil.AssertAppError(t, err, http.StatusForbidden, "error.residence_access_denied")
|
||||
}
|
||||
|
||||
func TestTaskService_GetTask(t *testing.T) {
|
||||
@@ -138,7 +139,7 @@ func TestTaskService_GetTask_AccessDenied(t *testing.T) {
|
||||
task := testutil.CreateTestTask(t, db, residence.ID, owner.ID, "Test Task")
|
||||
|
||||
_, err := service.GetTask(task.ID, otherUser.ID)
|
||||
assert.ErrorIs(t, err, ErrTaskAccessDenied)
|
||||
testutil.AssertAppError(t, err, http.StatusForbidden, "error.task_access_denied")
|
||||
}
|
||||
|
||||
func TestTaskService_ListTasks(t *testing.T) {
|
||||
@@ -239,7 +240,7 @@ func TestTaskService_CancelTask_AlreadyCancelled(t *testing.T) {
|
||||
now := time.Now().UTC()
|
||||
service.CancelTask(task.ID, user.ID, now)
|
||||
_, err := service.CancelTask(task.ID, user.ID, now)
|
||||
assert.ErrorIs(t, err, ErrTaskAlreadyCancelled)
|
||||
testutil.AssertAppError(t, err, http.StatusBadRequest, "error.task_already_cancelled")
|
||||
}
|
||||
|
||||
func TestTaskService_UncancelTask(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user