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:
@@ -187,6 +187,8 @@ func TestIsOverdue(t *testing.T) {
|
||||
now := time.Now().UTC()
|
||||
yesterday := now.AddDate(0, 0, -1)
|
||||
tomorrow := now.AddDate(0, 0, 1)
|
||||
// Start of today - this is what a DATE column stores (midnight)
|
||||
startOfToday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -216,6 +218,17 @@ func TestIsOverdue(t *testing.T) {
|
||||
now: now,
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "not overdue: task due today (start of day)",
|
||||
task: &models.Task{
|
||||
NextDueDate: timePtr(startOfToday),
|
||||
IsCancelled: false,
|
||||
IsArchived: false,
|
||||
Completions: []models.TaskCompletion{},
|
||||
},
|
||||
now: now, // Current time during the day
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "not overdue: cancelled task",
|
||||
task: &models.Task{
|
||||
@@ -291,6 +304,8 @@ func TestIsDueSoon(t *testing.T) {
|
||||
yesterday := now.AddDate(0, 0, -1)
|
||||
in5Days := now.AddDate(0, 0, 5)
|
||||
in60Days := now.AddDate(0, 0, 60)
|
||||
// Start of today - this is what a DATE column stores (midnight)
|
||||
startOfToday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -311,6 +326,18 @@ func TestIsDueSoon(t *testing.T) {
|
||||
daysThreshold: 30,
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "due soon: task due today (start of day)",
|
||||
task: &models.Task{
|
||||
NextDueDate: timePtr(startOfToday),
|
||||
IsCancelled: false,
|
||||
IsArchived: false,
|
||||
Completions: []models.TaskCompletion{},
|
||||
},
|
||||
now: now, // Current time during the day
|
||||
daysThreshold: 30,
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "not due soon: beyond threshold",
|
||||
task: &models.Task{
|
||||
|
||||
Reference in New Issue
Block a user