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

Description

Persists and retrieves confidentiality declaration records in the database. Stores declarations with all required audit fields and supports lookup by user, organization, and declaration type. Provides the data access layer used by ConfidentialityService for both writes and compliance verification queries.

Feature: Confidentiality Declarations

confidentiality-repository

Sources & reasoning

Line 71 explicitly lists driver honoraria and confidentiality declarations as a Blindeforbundet requirement within the expense registration flow. The parent area is Fase 2 in the priority matrix at line 148, mapping to v1.0. The feature is compliance-driven, not optional UX.

Responsibilities

  • Insert new declaration records with userId, orgId, declarationType, and acceptedAt timestamp
  • Query declarations by userId and declarationType for validity checks
  • Retrieve full declaration audit trail for a given user or organization
  • Support compliance review queries filtered by date range or declaration type

Interfaces

save(declaration: DeclarationRecord): Promise<DeclarationRecord>
findByUser(userId: string, declarationType: DeclarationType): Promise<DeclarationRecord | null>
findAllByUser(userId: string): Promise<DeclarationRecord[]>
findByOrganization(orgId: string, from: Date, to: Date): Promise<DeclarationRecord[]>