package com.tt.honeyDue.models import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable /** * Task completion create request matching Go API CreateTaskCompletionRequest */ @Serializable data class TaskCompletionCreateRequest( @SerialName("task_id") val taskId: Int, @SerialName("completed_at") val completedAt: String? = null, // Defaults to now on server val notes: String? = null, @SerialName("actual_cost") val actualCost: Double? = null, val rating: Int? = null, // 1-5 star rating @SerialName("upload_ids") val uploadIds: List? = null // pending_uploads.id values from /api/uploads/presign + direct B2 POST ) /** * Presigned upload session — request body for POST /api/uploads/presign. * * Category: "completion" | "document_image" | "document_file" * ContentType: the MIME type the client will upload (must match the policy * exactly when POSTing to B2). * ContentLength: byte count of the upload (server permits ±256 bytes slack). */ @Serializable data class PresignUploadRequest( val category: String, @SerialName("content_type") val contentType: String, @SerialName("content_length") val contentLength: Long ) /** * Presigned upload session — response from POST /api/uploads/presign. * * The client makes one PUT request to [uploadUrl] with the raw object * bytes as the body and [headers] as the request headers. On success, * pass [id] back in the upload_ids[] field of the next * /api/task-completions/ or /api/documents/ create call. * * PUT (not POST) because B2's S3-compatible endpoint does not implement * the S3 POST Object form upload (returns HTTP 501). */ @Serializable data class PresignUploadResponse( val id: Int, @SerialName("upload_url") val uploadUrl: String, val method: String = "PUT", val headers: Map = emptyMap(), val key: String, @SerialName("expires_at") val expiresAt: String )