Service Layer medium complexity mobile
2
Dependencies
1
Dependents
2
Entities
0
Integrations

Description

Service responsible for compressing selected images with flutter_image_compress to stay under the 2 MB payload limit, then uploading them via multipart POST to the backend REST API endpoint. Tracks per-file upload progress and surfaces errors back to the UI.

Feature: Receipt Photo Upload

file-upload-service

Responsibilities

  • Compress images using flutter_image_compress before upload
  • Execute multipart POST to /api/v1/expenses/:id/receipts
  • Report per-file upload progress to the calling widget
  • Retry transient network failures and surface permanent errors
  • Return the server-assigned receipt URL and metadata on success

Interfaces

compressImage(file: File, maxSizeKb: int) -> File
uploadReceipt(expenseId: String, file: File) -> ReceiptAttachment
deleteReceipt(receiptId: String) -> void
getUploadProgress() -> Stream<double>

Relationships

Dependencies (2)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component