Local Association
Data Entity
Description
Represents a local chapter or branch within a parent organization (e.g. one of NHF's 1,400 lokallag). Local associations are the operational unit to which peer mentors and coordinators belong, enabling activity reporting, role scoping, and hierarchy traversal within the multi-organization structure.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key | PKrequiredunique |
organization_id |
uuid |
FK to the parent organization this local association belongs to | required |
name |
string |
Display name of the local association (e.g. 'NHF Oslo Lokallag') | required |
short_code |
string |
Optional short identifier used in reports and exports (e.g. 'NHF-OSL') | - |
region |
string |
Geographic or administrative region this local association belongs to (e.g. 'Oslo', 'Vestland') | - |
contact_email |
string |
Primary contact email for this local association | - |
contact_phone |
string |
Primary contact phone number | - |
address |
text |
Physical address of the local association office, if applicable | - |
is_active |
boolean |
Whether this local association is currently active. Inactive associations are hidden from user-facing flows but retained for historical reporting. | required |
external_id |
string |
ID from the parent organization's external membership system or portal (e.g. HLF Dynamics portal, NHF member registry). Used for sync and deduplication. | - |
metadata |
json |
Freeform org-specific configuration (e.g. Bufdir reporting codes, custom labels). Kept as JSON to avoid schema churn for org-specific needs. | - |
created_at |
datetime |
Record creation timestamp | required |
updated_at |
datetime |
Last modification timestamp | required |
Database Indexes
idx_local_associations_organization_id
Columns: organization_id
idx_local_associations_organization_name
Columns: organization_id, name
idx_local_associations_external_id
Columns: organization_id, external_id
idx_local_associations_is_active
Columns: is_active
Validation Rules
name_not_empty
error
Validation failed
contact_email_format
error
Validation failed
organization_id_exists
error
Validation failed
external_id_unique_per_org
error
Validation failed
metadata_valid_json
error
Validation failed
Business Rules
local_association_scoped_to_organization
A local association must always belong to exactly one parent organization. Cross-organization local associations are not permitted.
unique_name_within_organization
Local association names must be unique within the same parent organization to prevent confusion in dropdown selectors and reports.
deactivation_does_not_delete
Local associations with historical activity data, member associations, or users cannot be hard-deleted. Setting is_active=false hides them from operational flows while preserving reporting data.
bufdir_reporting_scope
Activities submitted by peer mentors belonging to a local association are scoped to that association in Bufdir exports. Local association must be correctly assigned to prevent reporting errors.
multi_membership_deduplication
NHF peer mentors may belong to up to 5 local associations. Activity reporting must tag activities with the correct local association to prevent double-counting in statistics and Bufdir exports.
external_portal_sync_on_update
When HLF's external portal integration is active, changes to a local association's name or external_id must be propagated via ExternalPortalSyncService to avoid divergence with the Dynamics portal.