Infrastructure medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Cloud object storage adapter responsible for securely persisting receipt images and managing access. Stores images in a dedicated bucket with scoped access policies so only the owning peer mentor, assigned coordinators, and org admins can retrieve them. Provides signed URLs for secure retrieval in the Admin Web Portal approval queue and handles object lifecycle policies.

Feature: Receipt Photo Upload

receipt-storage-service

Sources & reasoning

Line 68 states a hard receipt photo requirement for claims over 100 kr (HLF). Line 69 confirms that claims without receipts qualify for auto-approval, establishing the conditional enforcement logic. The Phase 2 roadmap (line 343) groups this under Reiserefusjonshåndtering, placing it at v1.0.

  • docs/source/likeperson.md · line 68
    Kvitteringsbilde for utlegg over 100 kr (HLF).
  • docs/source/likeperson.md · line 69
    Automatisk godkjenning under 50 km / uten utlegg, manuell attestering ellers (HLF).

Responsibilities

  • Store uploaded receipt images in secure cloud object storage
  • Enforce bucket access policies scoped to uploader, coordinator, and org admin roles
  • Generate time-limited signed URLs for coordinator and admin retrieval
  • Record storage references (bucket path, signed URL template) in the expense database record
  • Apply object lifecycle rules for retention and deletion on expense archival

Interfaces

store(imageBuffer: Buffer, metadata: ReceiptMetadata): Promise<StorageRef>
getSignedUrl(storageRef: StorageRef, ttlSeconds: number): string
delete(storageRef: StorageRef): Promise<void>
listByExpense(expenseId: string): Promise<StorageRef[]>