Receipt Processing Service
Component Detail
Service Layer
high complexity
mobilebackend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Orchestrates the end-to-end receipt lifecycle: client-side image compression, upload to Supabase Storage with bucket-policy enforcement, thumbnail URL generation, linking the stored path to the parent expense item in the database, and offline retry queue management. Retrieves organisation configuration to apply threshold-based mandatory attachment rules.
receipt-processing-service
Responsibilities
- Compress image client-side before upload to reduce storage cost and upload time
- Upload compressed image to Supabase Storage bucket with correct access policy
- Generate and persist thumbnail URL alongside the full-resolution storage path
- Link stored receipt record to parent expense_items record
- Queue failed uploads for automatic retry and surface failure state to UI
Interfaces
uploadReceipt(expenseItemId, imageFile)
deleteReceipt(receiptId)
getReceiptsForExpenseItem(expenseItemId)
retryFailedUploads()
isReceiptRequired(expenseItemId)
getOrganisationThreshold()
generateThumbnailUrl(storagePath)
getUploadStatus(receiptId)
Related Data Entities (2)
Data entities managed by this component