Local Association Service
Component Detail
Service Layer
medium complexity
backend
2
Dependencies
2
Dependents
3
Entities
0
Integrations
Description
Backend service providing CRUD endpoints and membership management APIs for local associations. Handles the multi-membership model where a peer mentor may belong to up to five associations, enforces uniqueness within an organization, and exposes the active-association context needed by activity registration.
local-association-service
Responsibilities
- CRUD operations for local_associations records scoped to organization
- Manage many-to-many membership between users and associations via user_roles junction
- Return primary and additional association context for a given user
- Enforce business rule: max five associations per peer mentor
Interfaces
createAssociation(orgId, name, regionId): Association
updateAssociation(id, fields): Association
deleteAssociation(id): void
listAssociations(orgId, filters, page): PaginatedResult<Association>
getAssociation(id): Association
assignMembers(associationId, userIds): void
removeMembers(associationId, userIds): void
getAssociationsForUser(userId, orgId): Association[]
setPrimaryAssociation(userId, associationId): void
Relationships
Dependencies (2)
Components this component depends on
Dependents (2)
Components that depend on this component
Related Data Entities (3)
Data entities managed by this component