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

Description

Provides persistent storage and retrieval of consent records, enforcing immutability so existing records cannot be modified or deleted. Supports querying by mentor, assignment type, and consent method (digital or manual fallback).

Feature: Progressive Digital Consent

consent-repository

Sources & reasoning

Line 101 calls for gradual digitalization of powers of attorney and medical records with manual fallback - the consent layer required for encrypted sensitive data handling. Combined with the dispatch requirement (line 94), this fulfills GDPR obligations for peer mentors receiving sensitive assignments. Part of the Phase 2 encrypted-assignments area, mapped to target_release v1.0.

  • - Gradvis digitalisering av fullmakter og epikriser med manuelt fallback.
  • - **Kryptert oppdragshåndtering:** Sende sensitive personopplysninger (navn, adresse, epikrise) til likepersoner med leveringsbekreftelse og lesebekreftelse.

Responsibilities

  • Insert new consent records with server-generated timestamps and immutable identifiers
  • Query consent records by mentor ID and assignment type ID
  • Retrieve full consent history for audit and compliance reporting
  • Enforce append-only constraints so no record can be updated or removed

Interfaces

insertConsentRecord(record: NewConsentRecord): Promise<ConsentRecord>
findByMentorAndType(mentorId: string, assignmentTypeId: string): Promise<ConsentRecord | null>
findAllByMentor(mentorId: string): Promise<ConsentRecord[]>
findByMethod(method: 'digital' | 'manual'): Promise<ConsentRecord[]>