package responses // PresignUploadResponse is what /api/uploads/presign returns to the client. // // The client uses URL + Fields to build a multipart/form-data POST directly // to S3-compatible storage (B2). Once the upload completes, the client calls // the relevant entity-creation endpoint (POST /api/task-completions/, POST // /api/documents/) with `upload_ids: [Id]` to claim and attach the object. type PresignUploadResponse struct { // ID is the pending_uploads.id the client passes back via upload_ids[]. ID uint `json:"id"` // URL is the storage endpoint to POST to (no query string). URL string `json:"upload_url"` // Fields are the form fields (policy, signature, key, etc.) that must be // submitted with the multipart form. The file part must be named "file" // and come last per S3 POST policy rules. Fields map[string]string `json:"fields"` // Key is the object key chosen by the server. Echoed for client logging // and debugging; the canonical reference is via ID. Key string `json:"key"` // ExpiresAt is when the signed URL stops working. Clients should retry // with a fresh presign rather than relying on long-lived URLs. ExpiresAt string `json:"expires_at"` }