Update task completion to use local kanban state update

- Add updatedTask field to TaskCompletionResponse model from API
- Modify CompleteTaskView callback to pass back the updated task
- Add updateTaskInKanban() function to AllTasksView and ResidenceDetailView
- Move completed tasks to correct kanban column without additional API call
- Remove debug print statements from ResidenceDetailView

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-02 20:50:25 -06:00
parent 0ddd542080
commit 00e303c3be
9 changed files with 163 additions and 53 deletions

View File

@@ -52,6 +52,7 @@ data class TaskResponse(
@SerialName("is_archived") val isArchived: Boolean = false,
@SerialName("parent_task_id") val parentTaskId: Int? = null,
@SerialName("completion_count") val completionCount: Int = 0,
@SerialName("kanban_column") val kanbanColumn: String? = null, // Which kanban column this task belongs to
val completions: List<TaskCompletionResponse> = emptyList(),
@SerialName("created_at") val createdAt: String,
@SerialName("updated_at") val updatedAt: String
@@ -95,7 +96,8 @@ data class TaskCompletionResponse(
@SerialName("actual_cost") val actualCost: Double? = null,
val rating: Int? = null,
val images: List<TaskCompletionImage> = emptyList(),
@SerialName("created_at") val createdAt: String
@SerialName("created_at") val createdAt: String,
@SerialName("task") val updatedTask: TaskResponse? = null // Updated task after completion (for UI kanban update)
) {
// Helper for backwards compatibility
val completionDate: String get() = completedAt