Local Associations
Data Entity
Description
Represents the local organizational units (lokallag) within a parent organization's hierarchy. Each local association is the primary operational scope for peer mentors and coordinators, determining activity reporting boundaries, coordinator oversight scope, expense approval routing, and Bufdir report aggregation. NHF alone has 1,400 local associations across 12 national associations and 9 regions.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Unique identifier for the local association | PKrequiredunique |
organization_id |
uuid |
Foreign key to the parent organization this local association belongs to | required |
parent_association_id |
uuid |
Self-referencing foreign key for hierarchical nesting (e.g., regional association containing local associations). Null for top-level associations. | - |
name |
string |
Display name of the local association (e.g., 'NHF Oslo Lokallag') | required |
short_name |
string |
Abbreviated name for compact UI display and reports | - |
external_id |
string |
External system identifier for integration with member registries, Dynamics portals, or legacy systems | - |
association_type |
enum |
Classification of the association level within the organizational hierarchy | required |
status |
enum |
Operational status of the local association | required |
contact_email |
string |
Primary contact email for the local association | - |
contact_phone |
string |
Primary contact phone number for the local association | - |
address |
text |
Physical address or meeting location of the local association | - |
region |
string |
Geographic region label for grouping and filtering (e.g., 'Vestland', 'Trøndelag') | - |
municipality_code |
string |
Norwegian municipality code (kommunenummer) for geographic mapping and Bufdir reporting | - |
member_count |
integer |
Cached count of active members in this association for dashboard display | - |
metadata |
json |
Extensible JSON field for organization-specific configuration (custom terminology overrides, reporting preferences, feature flags) | - |
created_at |
datetime |
Timestamp when the association record was created | required |
updated_at |
datetime |
Timestamp of last update to the association record | required |
Database Indexes
idx_local_associations_organization
Columns: organization_id
idx_local_associations_parent
Columns: parent_association_id
idx_local_associations_org_name
Columns: organization_id, name
idx_local_associations_status
Columns: organization_id, status
idx_local_associations_type
Columns: organization_id, association_type
idx_local_associations_external_id
Columns: organization_id, external_id
idx_local_associations_region
Columns: organization_id, region
Validation Rules
name_not_blank
error
Validation failed
valid_organization_reference
error
Validation failed
valid_parent_reference
error
Validation failed
valid_email_format
error
Validation failed
valid_municipality_code
warning
Validation failed
status_transition_validity
error
Validation failed
external_id_unique_per_org
error
Validation failed
Business Rules
unique_name_within_organization
Each local association name must be unique within its parent organization to prevent confusion in coordinator scoping and Bufdir reporting
parent_must_belong_to_same_organization
If parent_association_id is set, the parent association must belong to the same organization_id to maintain tenant isolation
no_circular_hierarchy
An association cannot be its own ancestor in the hierarchy tree. The closure table must be checked before any parent reassignment to prevent cycles
dissolution_requires_member_reassignment
A local association cannot be set to 'dissolved' or 'merged' status while it still has active user memberships in user_local_associations. Members must be reassigned first to prevent orphaned reporting data
coordinator_scope_boundary
Coordinators can only view and manage peer mentors, activities, and expenses within their assigned local association(s). This association boundary is the primary access control dimension for coordinator-level operations
multi_membership_duplicate_prevention
Users belonging to multiple local associations (up to 5 for NHF) must have one designated primary association to prevent double-counting in Bufdir reports and activity statistics
inactive_association_blocks_new_activities
No new activities, events, or expense claims can be created against an inactive, merged, or dissolved local association