Replace status_id with in_progress boolean field
- Remove task_statuses lookup table and StatusID foreign key - Add InProgress boolean field to Task model - Add database migration (005_replace_status_with_in_progress) - Update all handlers, services, and repositories - Update admin frontend to display in_progress as checkbox/boolean - Remove Task Statuses tab from admin lookups page - Update tests to use InProgress instead of StatusID - Task categorization now uses InProgress for kanban column assignment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -60,13 +60,13 @@ func IsArchived(task *models.Task) bool {
|
||||
return task.IsArchived
|
||||
}
|
||||
|
||||
// IsInProgress returns true if the task has status "In Progress".
|
||||
// IsInProgress returns true if the task is marked as in progress.
|
||||
//
|
||||
// SQL equivalent (in scopes.go ScopeInProgress):
|
||||
//
|
||||
// task_taskstatus.name = 'In Progress'
|
||||
// in_progress = true
|
||||
func IsInProgress(task *models.Task) bool {
|
||||
return task.Status != nil && task.Status.Name == "In Progress"
|
||||
return task.InProgress
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
@@ -102,27 +102,19 @@ func TestIsActive(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIsInProgress(t *testing.T) {
|
||||
inProgressStatus := &models.TaskStatus{Name: "In Progress"}
|
||||
pendingStatus := &models.TaskStatus{Name: "Pending"}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
task *models.Task
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "in progress: status is In Progress",
|
||||
task: &models.Task{Status: inProgressStatus},
|
||||
name: "in progress: InProgress is true",
|
||||
task: &models.Task{InProgress: true},
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "not in progress: status is Pending",
|
||||
task: &models.Task{Status: pendingStatus},
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "not in progress: no status",
|
||||
task: &models.Task{Status: nil},
|
||||
name: "not in progress: InProgress is false",
|
||||
task: &models.Task{InProgress: false},
|
||||
expected: false,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user