Receipt Storage Service
Component Detail
Service Layer
medium complexity
backend
2
Dependencies
3
Dependents
1
Entities
0
Integrations
Description
Backend REST service exposing a multipart/form-data endpoint for receipt image upload. Validates file type (JPEG/PNG only) and enforces size limits, stores the binary in S3-compatible object storage, and writes a reference record to the expense_receipts table linked by expense_item_id.
receipt-storage-service
Responsibilities
- Accept multipart/form-data POST with image binary and expense_item_id
- Validate MIME type against JPEG/PNG allowlist and reject oversized payloads
- Store validated binary via Object Storage Adapter and obtain a storage key
- Insert expense_receipts record with storage URL and file metadata
- Return receipt record including storage reference and presigned thumbnail URL
Interfaces
POST /api/v1/expense-items/{itemId}/receipts
DELETE /api/v1/expense-items/{itemId}/receipts/{receiptId}
GET /api/v1/expense-items/{itemId}/receipts
uploadReceipt(itemId: String, file: MultipartFile) -> ReceiptRecord
deleteReceipt(receiptId: String) -> void
listReceiptsForItem(itemId: String) -> List<ReceiptRecord>
Relationships
Dependencies (2)
Components this component depends on
Dependents (3)
Components that depend on this component