Receipt Repository
Component Detail
Data Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Manages local and remote CRUD operations for the expense_receipts table, linking receipt metadata and cloud storage references to their parent expense records. Maintains an offline queue of receipts pending upload, syncing to the backend when connectivity is available.
receipt-repository
Responsibilities
- Persist receipt metadata (storage key, MIME type, upload status, expense link) in local SQLite
- Synchronise receipt records with the backend REST API
- Queue pending receipts for upload when the device is offline
- Track upload lifecycle state (pending, uploading, uploaded, failed)
- Fetch receipt metadata for expense detail and approval views
Interfaces
saveReceipt(receipt)
getReceiptsByExpenseId(expenseId)
updateReceiptStatus(receiptId, status)
markAsUploaded(receiptId, storageKey)
deleteReceipt(receiptId)
getPendingUploads()
getReceiptById(receiptId)