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

Description

Data access layer for persisting and querying user-association membership records. Handles CRUD operations on the membership join table and exposes queries needed for activity attribution and Bufdir reporting roll-ups.

Feature: Member Associations

member-association-repository

Sources & reasoning

Line 107 directly requires handling users in up to five local associations simultaneously with double-reporting prevention. This membership model is a prerequisite for the hierarchy roll-up and Bufdir attribution logic. Since NHF is a Phase 1 launch organization, and this data feeds the MVP reporting pipeline, it is classified MVP.

  • docs/source/likeperson.md · line 107
    Håndtering av medlemmer i flere lokallag (opptil 5): Avklare tilhørighet og hindre dobbeltrapportering.

Responsibilities

  • Create and delete membership records linking users to associations
  • Query all associations for a given user and all members of a given association
  • Read and update the primary association flag per user
  • Support bulk membership queries for organizational hierarchy roll-ups

Interfaces

findByUser(userId: string): AssociationMembership[]
findByAssociation(associationId: string): AssociationMembership[]
create(userId: string, associationId: string, isPrimary: boolean): AssociationMembership
delete(userId: string, associationId: string): void
updatePrimary(userId: string, associationId: string): AssociationMembership

Related Data Entities (2)

Data entities managed by this component