feat(api): presigned uploads and item file attachments #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Items currently support a single file per revision via
POST /api/items/{partNumber}/file(multipart upload). The CreateItemPane redesign (#11+) needs:Database Migration
Note:
itemsalready hassourcing_type,sourcing_link,long_description,standard_costfrom migration 010. The revision table already hasthumbnail_key. This addsthumbnail_keyto items directly for item-level thumbnails.New API Endpoints
Presigned Upload URL
Generates a presigned PUT URL via MinIO SDK. Objects go to a temp prefix initially.
List Item Files
Associate File with Item
Moves object from temp prefix to
items/{item_id}/files/{file_id}and createsitem_filesrow.Delete Item File
Set Item Thumbnail
Copies to
items/{item_id}/thumbnail.png, updatesitems.thumbnail_key.Implementation Notes
POST /api/items/{partNumber}/file(revision file) remains unchangedAcceptance Criteria
item_filestable anditems.thumbnail_keycolumnPOST /api/uploads/presignreturns valid MinIO presigned URLPOST /api/items/{pn}/filesassociates uploaded file with itemGET /api/items/{pn}/fileslists item filesDELETE /api/items/{pn}/files/{id}removes filePUT /api/items/{pn}/thumbnailsets thumbnail