Data Layer medium complexity backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Manages all database read and write operations for attachment records, storing metadata such as file name, MIME type, storage URL, and the associated activity ID. It provides querying capabilities scoped to individual activity entries and supports soft deletion for audit trail preservation. This repository is the single source of truth for attachment metadata.

Feature: Document Attachments

attachment-repository

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 107
    Dokumentvedlegg til aktiviteter: Invitasjoner, Facebook-skjermbilder m.m. - viktig for Bufdir-etterprøving.
  • docs/source/likeperson.md · line 157
    Dokumentvedlegg til aktiviteter | - | âś“ | - | - | âś“ | NICE TO HAVE | 2

Responsibilities

  • Insert new attachment metadata records linked to an activity ID
  • Query all attachments belonging to a specific activity
  • Soft-delete attachment records while retaining audit history
  • Update storage URL and status after successful file upload
  • Enforce referential integrity with the activity records table

Interfaces

create(data: CreateAttachmentDto): Promise<AttachmentRecord>
findByActivityId(activityId: string): Promise<AttachmentRecord[]>
softDelete(attachmentId: string): Promise<void>
updateStorageUrl(attachmentId: string, url: string): Promise<void>

Related Data Entities (2)

Data entities managed by this component