AttachmentService
Component Detail
Service Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Orchestrates the full lifecycle of activity attachments including upload coordination, metadata persistence, and retrieval. It validates file constraints, drives upload progress tracking, and links completed uploads to their parent activity records. This service acts as the boundary between the UI widget and the underlying storage and data layers.
attachment-service
Sources & reasoning
Line 107 names document attachments under NHF's unique needs with specific examples (invitations, Facebook screenshots) and the Bufdir verification rationale. The priority matrix at line 157 confirms NICE TO HAVE with Phase 2 placement. Blueprint assigns [v1.0] matching the Fase 2 ordinal.
-
docs/source/likeperson.md · line 107Dokumentvedlegg til aktiviteter: Invitasjoner, Facebook-skjermbilder m.m. - viktig for Bufdir-etterprøving.
-
docs/source/likeperson.md · line 157Dokumentvedlegg til aktiviteter | - | ✓ | - | - | ✓ | NICE TO HAVE | 2
Responsibilities
- Validate attachment size, MIME type, and count limits before upload
- Coordinate chunked or direct upload via FileStorageService
- Persist attachment metadata and activity linkage via AttachmentRepository
- Expose progress events for upload status tracking in the UI
- Retrieve and delete attachments linked to a given activity
Interfaces
uploadAttachment(activityId: string, file: FileBlob): Promise<Attachment>
getAttachments(activityId: string): Promise<Attachment[]>
deleteAttachment(attachmentId: string): Promise<void>
getUploadProgress(uploadId: string): Observable<UploadProgress>
Related Data Entities (2)
Data entities managed by this component