Expense Receipts Table
Component Detail
Data Layer
low complexity
backend
1
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
PostgreSQL table storing receipt image references linked to individual expense items. Each record holds the object storage key, presigned URL cache, file metadata, and upload status, satisfying the HLF audit requirement for receipt documentation on claims exceeding 100 NOK.
expense-receipts-table
Responsibilities
- Persist storage key, file type, file size, and upload status per receipt
- Enforce foreign key constraint to expense_items table via expense_item_id
- Support receipt lifecycle transitions: pending, uploaded, failed, deleted
- Allow multiple receipts per expense item for multi-page documents
Interfaces
insert(expenseItemId: String, storageKey: String, fileType: String, fileSizeBytes: int) -> ReceiptRecord
findByExpenseItemId(itemId: String) -> List<ReceiptRecord>
updateStatus(receiptId: String, status: UploadStatus) -> void
delete(receiptId: String) -> void