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

Description

Orchestrates the two-phase file upload process: first calls the backend API to obtain a signed storage URL, then PUTs the file directly to the object storage provider (S3-compatible or Vercel Blob) to avoid routing large payloads through the API server. Tracks upload progress and returns the storage key upon completion.

Feature: Document Attachment to Activities

document-upload-service

Responsibilities

  • Request a signed upload URL from the backend REST API
  • Execute the direct PUT upload to object storage using the signed URL
  • Report upload progress and handle retries on transient network errors
  • Return storage metadata (storage key, URL, MIME type) to the caller

Interfaces

uploadDocument(File file, String activityId)
getSignedUploadUrl(String filename, String mimeType)
putFileToStorage(String signedUrl, File file)
cancelUpload(String uploadId)
getUploadProgress(String uploadId)
deleteDocument(String storageKey)

Relationships

Dependencies (2)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component