Fix CustomTask model to match API response structure
Updated CustomTask to use nested objects for category, frequency,
priority, and status instead of strings to match the API's actual
response format after recent serializer changes.
Changes:
- category: String → TaskCategory?
- Added frequency: TaskFrequency
- priority: String → TaskPriority
- status: String? → TaskStatus?
- Added next_scheduled_date field
- Added completion_count field
This fixes the JSON parsing error when creating/updating tasks via
the iOS and Android apps, which was caused by the API returning
nested objects like {"id": 21, "name": "Flooring"} but the model
expecting simple strings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,12 +11,15 @@ data class CustomTask (
|
|||||||
@SerialName("created_by_username") val createdByUsername: String,
|
@SerialName("created_by_username") val createdByUsername: String,
|
||||||
val title: String,
|
val title: String,
|
||||||
val description: String? = null,
|
val description: String? = null,
|
||||||
val category: String,
|
val category: TaskCategory?,
|
||||||
val priority: String,
|
val frequency: TaskFrequency,
|
||||||
val status: String? = null,
|
val priority: TaskPriority,
|
||||||
|
val status: TaskStatus? = null,
|
||||||
@SerialName("due_date") val dueDate: String?,
|
@SerialName("due_date") val dueDate: String?,
|
||||||
|
@SerialName("next_scheduled_date") val nextScheduledDate: String? = null,
|
||||||
@SerialName("estimated_cost") val estimatedCost: String? = null,
|
@SerialName("estimated_cost") val estimatedCost: String? = null,
|
||||||
@SerialName("actual_cost") val actualCost: String? = null,
|
@SerialName("actual_cost") val actualCost: String? = null,
|
||||||
|
@SerialName("completion_count") val completionCount: Int? = null,
|
||||||
val notes: String? = null,
|
val notes: String? = null,
|
||||||
val archived: Boolean = false,
|
val archived: Boolean = false,
|
||||||
@SerialName("created_at") val createdAt: String,
|
@SerialName("created_at") val createdAt: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user