diff --git a/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/CustomTask.kt b/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/CustomTask.kt index 8d58e57..13d9e18 100644 --- a/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/CustomTask.kt +++ b/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/CustomTask.kt @@ -55,6 +55,9 @@ data class TaskResponse( @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 + // Note: Go API does not return completions inline with TaskResponse. + // Completions are fetched separately via the completions endpoint. + // This field defaults to emptyList() and is only populated client-side after a separate fetch. val completions: List = emptyList(), @SerialName("created_at") val createdAt: String, @SerialName("updated_at") val updatedAt: String diff --git a/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/Document.kt b/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/Document.kt index c0b867c..4e8a674 100644 --- a/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/Document.kt +++ b/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/Document.kt @@ -33,8 +33,12 @@ data class Document( val title: String, @SerialName("document_type") val documentType: String, val description: String? = null, - @SerialName("file_url") val fileUrl: String? = null, // URL to the file - @SerialName("media_url") val mediaUrl: String? = null, // Authenticated endpoint: /api/media/document/{id} + // fileUrl: raw storage path (internal). Not included in Go DocumentResponse DTO — + // will always be null from the API. Kept for backward compatibility; prefer mediaUrl. + @SerialName("file_url") val fileUrl: String? = null, + // mediaUrl: authenticated endpoint clients should use (e.g. /api/media/document/{id}). + // This is the URL the Go API actually returns for document access. + @SerialName("media_url") val mediaUrl: String? = null, @SerialName("file_name") val fileName: String? = null, @SerialName("file_size") val fileSize: Int? = null, @SerialName("mime_type") val mimeType: String? = null, @@ -43,7 +47,7 @@ data class Document( @SerialName("serial_number") val serialNumber: String? = null, val vendor: String? = null, @SerialName("purchase_date") val purchaseDate: String? = null, - @SerialName("purchase_price") val purchasePrice: String? = null, + @SerialName("purchase_price") val purchasePrice: Double? = null, @SerialName("expiry_date") val expiryDate: String? = null, // Relationships @SerialName("residence_id") val residenceId: Int? = null, @@ -87,7 +91,7 @@ data class DocumentCreateRequest( @SerialName("serial_number") val serialNumber: String? = null, val vendor: String? = null, @SerialName("purchase_date") val purchaseDate: String? = null, - @SerialName("purchase_price") val purchasePrice: String? = null, + @SerialName("purchase_price") val purchasePrice: Double? = null, @SerialName("expiry_date") val expiryDate: String? = null, // Relationships @SerialName("residence_id") val residenceId: Int, @@ -106,7 +110,7 @@ data class DocumentUpdateRequest( @SerialName("serial_number") val serialNumber: String? = null, val vendor: String? = null, @SerialName("purchase_date") val purchaseDate: String? = null, - @SerialName("purchase_price") val purchasePrice: String? = null, + @SerialName("purchase_price") val purchasePrice: Double? = null, @SerialName("expiry_date") val expiryDate: String? = null, // Relationships @SerialName("task_id") val taskId: Int? = null diff --git a/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/TaskTemplate.kt b/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/TaskTemplate.kt index 4508b5e..b7d6e9e 100644 --- a/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/TaskTemplate.kt +++ b/composeApp/src/commonMain/kotlin/com/tt/honeyDue/models/TaskTemplate.kt @@ -20,7 +20,9 @@ data class TaskTemplate( @SerialName("icon_android") val iconAndroid: String = "", val tags: List = emptyList(), @SerialName("display_order") val displayOrder: Int = 0, - @SerialName("is_active") val isActive: Boolean = true + @SerialName("is_active") val isActive: Boolean = true, + @SerialName("region_id") val regionId: Int? = null, + @SerialName("region_name") val regionName: String? = null ) { /** * Human-readable frequency display