Add nextDueDate field to TaskResponse for recurring task support

- Add nextDueDate field to TaskResponse model (from API's next_due_date)
- Add effectiveDueDate computed property (nextDueDate ?? dueDate)
- Update DynamicTaskCard, TaskCard to display effectiveDueDate
- Update WidgetDataManager to save effectiveDueDate to widget cache
- Update TaskFormView to use effectiveDueDate when editing
- Fix preview mock data to include nextDueDate parameter

This ensures recurring tasks show the correct next due date after completion
instead of the original due date.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-11 11:10:56 -06:00
parent cbe073aa21
commit 1839bd0e11
6 changed files with 15 additions and 8 deletions

View File

@@ -44,6 +44,7 @@ data class TaskResponse(
@SerialName("frequency_id") val frequencyId: Int? = null,
val frequency: TaskFrequency? = null,
@SerialName("due_date") val dueDate: String? = null,
@SerialName("next_due_date") val nextDueDate: String? = null, // For recurring tasks, updated after each completion
@SerialName("estimated_cost") val estimatedCost: Double? = null,
@SerialName("actual_cost") val actualCost: Double? = null,
@SerialName("contractor_id") val contractorId: Int? = null,
@@ -74,8 +75,11 @@ data class TaskResponse(
val priorityName: String? get() = priority?.name
val priorityDisplayName: String? get() = priority?.displayName
// Effective due date: use nextDueDate if set (for recurring tasks), otherwise use dueDate
val effectiveDueDate: String? get() = nextDueDate ?: dueDate
// Fields that don't exist in Go API - return null/default
val nextScheduledDate: String? get() = null // Would need calculation based on frequency
val nextScheduledDate: String? get() = nextDueDate // Now we have this from the API
val showCompletedButton: Boolean get() = true // Always show complete button since status is now just in_progress boolean
val daySpan: Int? get() = frequency?.days
val notifyDays: Int? get() = null // Not in Go API