Service Layer medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Backend service that orchestrates attachment uploads, validates files, and links them to activity records. Issues signed upload URLs for direct-to-storage uploads and persists metadata once uploads complete. Coordinates deletion and retrieval of attachments tied to activities.

Feature: Document Attachments

attachment-service

Sources & reasoning

Matrix row 107 places Dokumentvedlegg at Fase 2 (mapped to Core Product). NHF unique-needs entry explains the Bufdir-evidence motivation and justifies it as a toggleable area-level capability rather than a quick-log addon.

  • Dokumentvedlegg til aktiviteter: Invitasjoner, Facebook-skjermbilder m.m. - viktig for Bufdir-etterprøving.
  • Dokumentvedlegg til aktiviteter | - | âś“ | - | - | âś“ | NICE TO HAVE | 2

Responsibilities

  • Validate file type, size, and ownership of the parent activity
  • Issue signed upload and download URLs for Object Storage
  • Persist attachment metadata to the Attachment Store after upload completion
  • Return attachment lists for a given activity
  • Delete attachments and their underlying storage objects on request

Interfaces

createUploadUrl(activityId: string, filename: string, mimeType: string): SignedUploadUrl
confirmUpload(activityId: string, storageKey: string, metadata: AttachmentMetadata): Attachment
listAttachments(activityId: string): Attachment[]
deleteAttachment(attachmentId: string): void