Local Association
Data Entity
Description
Represents a local branch or chapter of an organization within the Meander platform. Local associations are the operational units to which peer mentors and coordinators are assigned. They define the scope boundary for activity reporting, expense approval, user management, and data access control. A single organization (e.g., NHF with 1,400 local associations) may have hundreds of local associations arranged in a hierarchy.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key. Stable, globally unique identifier for the local association. | PKrequiredunique |
organization_id |
uuid |
Foreign key to the parent organization. Every local association belongs to exactly one organization. | required |
name |
string |
Full display name of the local association (e.g., 'NHF Oslo og Akershus', 'HLF Bergen lokallag'). Used in all UI surfaces and reports. | required |
short_name |
string |
Abbreviated or shortened name for compact UI contexts such as dropdowns, badges, and coordinator scope switchers. | - |
external_id |
string |
Identifier used in external systems (e.g., Dynamics portal, Xledger) to enable sync and deduplication during integration. Scoped unique per organization. | - |
region |
string |
Optional regional grouping label. Used by NHF (12 national associations, 9 regions) and similar multi-tier organizations to group local associations for aggregate reporting. | - |
is_active |
boolean |
Soft-delete flag. Inactive local associations are hidden from coordinator scope selectors and user assignment flows but preserved for historical audit and reporting integrity. | required |
address |
string |
Physical or postal address of the local association's office or meeting point. Used in Bufdir reports and coordinator communications. | - |
contact_email |
string |
Primary contact email address for the local association, used for notifications and administrative correspondence. | - |
contact_phone |
string |
Primary contact phone number for the local association. Stored in E.164 format. | - |
metadata |
json |
Flexible key-value store for organization-specific attributes such as Bufdir registration numbers, regional codes, or integration-specific identifiers not covered by core fields. | - |
created_at |
datetime |
UTC timestamp when this local association record was created. | required |
updated_at |
datetime |
UTC timestamp of the most recent update to this record. Automatically maintained by the application layer. | required |
Database Indexes
idx_local_association_org_id
Columns: organization_id
idx_local_association_org_name
Columns: organization_id, name
idx_local_association_org_external
Columns: organization_id, external_id
idx_local_association_active
Columns: organization_id, is_active
idx_local_association_region
Columns: organization_id, region
Validation Rules
name_not_empty
error
Validation failed
organization_id_exists
error
Validation failed
contact_email_format
error
Validation failed
contact_phone_e164
error
Validation failed
metadata_valid_json
error
Validation failed
external_id_no_whitespace
error
Validation failed
region_max_length
error
Validation failed
Business Rules
single_org_ownership
Every local association must belong to exactly one organization. Reassigning a local association to a different organization is not permitted — it must be deactivated and recreated under the new organization.
unique_name_per_org
No two active local associations within the same organization may share the same name. This prevents duplicate scope selectors in coordinator UIs and ambiguous Bufdir report data.
soft_delete_only
Local associations may not be hard-deleted once they have been used as a scope reference in activities, user assignments, or reports. They must be deactivated (is_active = false) to preserve historical data integrity and audit trails.
coordinator_scope_enforcement
Coordinator users may only read and write data (activities, contacts, expenses, users) scoped to the local association(s) they are assigned to. Cross-association access requires Org Admin role or explicit multi-association assignment.
deactivation_cascade_warning
When a local association is deactivated, all active users whose primary association is this one must be flagged for reassignment. The deactivation is blocked if any user has no alternative primary association.
duplicate_reporting_guard
When a user belongs to multiple local associations, the system must detect and flag activities that may represent double-counting across association boundaries in Bufdir reports. This is critical for NHF which has users spanning up to 5 local associations.
external_id_org_scoped_uniqueness
The external_id field must be unique within an organization to enable reliable sync with external systems (Dynamics, Xledger). Null values are permitted and exempt from this constraint.
hierarchy_closure_table_sync
When a local association is created or moved within the organizational hierarchy, the closure table must be updated atomically in the same transaction to maintain ancestor/descendant query correctness.