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

Description

Backend service that enforces business rules around user-to-association links. Coordinates membership changes, primary affiliation, and the five-association cap, and exposes attribution data used to prevent duplicate activity reporting across chapters.

Feature: Member Associations

member-association-service

Sources & reasoning

NHF (§66) explicitly requires multi-chapter membership handling to prevent double-reporting; listed as a feature of admin-organization in §378. Core Product since it depends on hierarchy and is not in the MVP admin scope.

Responsibilities

  • Validate and persist association membership changes
  • Enforce the maximum of five simultaneous memberships per user
  • Manage designation and uniqueness of the primary affiliation
  • Provide attribution lookups used by activity reporting to deduplicate across chapters
  • Emit audit events when memberships are added, removed, or re-primaried

Interfaces

listAssociationsForUser(userId): MemberAssociation[]
addMembership(userId, associationId): MemberAssociation
removeMembership(userId, associationId): void
setPrimaryAssociation(userId, associationId): void
getPrimaryAssociation(userId): MemberAssociation

Related Data Entities (1)

Data entities managed by this component