core PK: id 11 required 4 unique

Description

A tenant organization (e.g. NHF, Blindeforbundet, HLF, Barnekreftforeningen) that uses the Meander platform. Owns all operational data within its boundary and drives module configuration, terminology overrides, and user membership.

16
Attributes
5
Indexes
6
Validation Rules
26
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
name string Legal or display name of the organization
requiredunique
slug string URL-safe identifier used in API paths and tenant routing
requiredunique
status enum Lifecycle state of the organization
required
is_test_organization boolean Marks internal test tenants (e.g. Norse Test Organization) whose data is excluded from Bufdir and external reporting
required
contact_email string Primary contact email for administrative correspondence
required
country_code string ISO 3166-1 alpha-2 country code (default 'NO' for Norway)
required
locale string Default locale for UI and generated content (e.g. nb-NO)
required
bufdir_organization_id string External identifier used in Bufdir report submissions; null for test organizations
unique
allow_support_access boolean When true, Global Admins may access this org's operational data for support purposes
required
support_access_expires_at datetime UTC timestamp after which Global Admin support access is automatically revoked; null when allow_support_access is false
-
parent_organization_id uuid Self-referential FK for multi-organization hierarchy (national → regional → local); null for root organizations
-
hierarchy_level enum Position in the organizational hierarchy for NHF-style structures
-
max_membership_count integer Optional cap on concurrent user memberships; null = unlimited
-
created_at datetime UTC timestamp of record creation
required
updated_at datetime UTC timestamp of last modification
required

Database Indexes

idx_organizations_slug
btree unique

Columns: slug

idx_organizations_status
btree

Columns: status

idx_organizations_parent
btree

Columns: parent_organization_id

idx_organizations_bufdir_id
btree unique

Columns: bufdir_organization_id

idx_organizations_support_access
btree

Columns: allow_support_access, support_access_expires_at

Validation Rules

slug_format error

Validation failed

contact_email_valid error

Validation failed

support_access_expiry_future error

Validation failed

parent_org_must_exist_and_be_active error

Validation failed

name_not_empty error

Validation failed

max_membership_count_positive error

Validation failed

Business Rules

test_org_excluded_from_bufdir
always

Organizations with is_test_organization=true must be excluded from all Bufdir report snapshots and external exports

support_access_time_bounded
always

Global Admin support access is only permitted when allow_support_access=true AND support_access_expires_at is in the future; every access session is written to audit_log_entries

support_access_expiry_auto_revoke
always

When support_access_expires_at is reached, allow_support_access is treated as false by all access checks without requiring a manual update

admin_organization_module_always_on
on_update

The admin-organization module can never be disabled for any organization because it hosts the Feature Toggles UI — disabling it would create an irrecoverable state

hierarchy_parent_same_or_higher_level
on_create

parent_organization_id must reference an organization whose hierarchy_level is above the child's (e.g. a regional org cannot be its own child)

Enforced by: OrgHierarchyService
slug_immutable_after_creation
on_update

The slug is used as a stable routing key and must not change after the organization is created; any rename must update only the name field

churned_org_data_isolation
always

Organizations with status=churned retain data for retention purposes but all API endpoints reject new writes and new logins

bufdir_id_required_for_reporting
always

bufdir_organization_id must be set before an organization can generate or export a Bufdir report snapshot

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage