Region
Data Entity
Description
An intermediate organizational tier between the national organization and local associations. Represents one of the 9 regional groupings used primarily by NHF. Regions aggregate local association data for regional reporting and coordinator oversight.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Surrogate primary key for the region record | PKrequiredunique |
organization_id |
uuid |
Foreign key referencing the parent organization that owns this region. All regions are scoped to exactly one organization. | required |
name |
string |
Human-readable display name for the region (e.g., 'Region Vest', 'Region Nord'). Used in reports, coordinator dashboards, and hierarchy navigation. | required |
code |
string |
Short alphanumeric identifier for the region used in Bufdir reporting, exports, and API references (e.g., 'VEST', 'NORD'). Must be unique within the parent organization. | required |
created_at |
datetime |
Timestamp when the region record was created. Set automatically on insert and never updated. | required |
updated_at |
datetime |
Timestamp of the last modification to the region record. Updated automatically on any field change. | required |
Database Indexes
idx_region_organization_id
Columns: organization_id
idx_region_organization_code
Columns: organization_id, code
idx_region_name
Columns: name
Validation Rules
name_not_empty
error
Validation failed
code_format_valid
error
Validation failed
organization_id_exists
error
Validation failed
id_is_valid_uuid
error
Validation failed
Business Rules
region_belongs_to_one_organization
Each region must be associated with exactly one organization and cannot be reassigned to a different organization after creation. This preserves the integrity of the multi-tenancy hierarchy.
region_code_unique_within_organization
The region code must be unique within the scope of its parent organization. Two different organizations may use the same code, but a single organization cannot have two regions sharing a code.
region_deletion_blocked_with_associations
A region cannot be deleted if it has any local associations still assigned to it. Local associations must be reassigned or deleted first to prevent orphaned hierarchy nodes.
region_data_scoped_to_tenant
All reads and writes to region records must be scoped to the authenticated user's organization_id, extracted from the JWT tenant context. Cross-organization region access is forbidden.
region_hierarchy_depth_enforced
Regions exist only at the second tier of the hierarchy (organization → region → local_association). They cannot be nested inside other regions or directly under a local association.
bufdir_reporting_aggregates_through_region
When generating Bufdir reports, activity data must be rolled up from local_association → region → organization. Region records are required for correct hierarchical aggregation even when the organization does not actively use regional structure.
CRUD Operations
Storage Configuration
Entity Relationships
An organization has multiple regional groupings that aggregate local associations
A region contains multiple local associations (chapters/branches)