core PK: id 14 required 3 unique

Description

Top-level tenant entity representing a customer organization (e.g. NHF, Blindeforbundet, HLF, Barnekreftforeningen, Norse Test) on the Meander platform. Owns all tenant-scoped data and configuration including users, contacts, events, settings, modules, labels, and hierarchy.

21
Attributes
6
Indexes
10
Validation Rules
25
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary identifier for the organization tenant.
PKrequiredunique
name string Official display name of the organization (e.g. 'Norges Handikapforbund').
required
slug string URL-safe unique identifier used in admin portal routes and tenant lookups.
requiredunique
legal_name string Legal entity name used for contracts, DPAs, and Bufdir reporting.
-
org_number string Norwegian organisasjonsnummer (9 digits) for the legal entity.
unique
organization_type enum Position of this organization in the multi-organization hierarchy.
required
parent_organization_id uuid Reference to a parent organization for hierarchical structures (e.g. NHF national → regions → local chapters). Null for top-level organizations.
-
status enum Operational status of the tenant.
required
is_test_tenant boolean Marks tenants like 'Norse Test Organization' whose data must be excluded from Bufdir and external reporting.
required
primary_contact_email string Primary contact email for the organization (typically the lead Org Admin).
required
primary_contact_phone string Primary contact phone number in E.164 format.
-
country_code string ISO 3166-1 alpha-2 country code (default 'NO').
required
default_locale string BCP 47 locale used as default for users in this organization (e.g. 'nb-NO').
required
default_timezone string IANA timezone identifier (e.g. 'Europe/Oslo').
required
bufdir_reporting_enabled boolean Whether this org is eligible for Bufdir grant reporting and export.
required
norse_support_access_until datetime Time-bounded grant for Norse Digital Global Admins to access this org's data. Null or past timestamp = no access.
-
data_retention_policy enum Tenant-level retention policy applied to operational records.
required
created_at datetime Timestamp the tenant was provisioned.
required
updated_at datetime Last modification timestamp.
required
archived_at datetime Timestamp the tenant was archived; null if active.
-
metadata json Free-form structured metadata for onboarding state, partnership flags, and other non-schema fields.
-

Database Indexes

idx_organizations_slug
btree unique

Columns: slug

idx_organizations_org_number
btree unique

Columns: org_number

idx_organizations_parent
btree

Columns: parent_organization_id

idx_organizations_status
btree

Columns: status

idx_organizations_type_status
btree

Columns: organization_type, status

idx_organizations_is_test
btree

Columns: is_test_tenant

Validation Rules

name_required_non_empty error

Validation failed

slug_format error

Validation failed

org_number_format error

Validation failed

primary_contact_email_valid error

Validation failed

country_code_iso error

Validation failed

locale_bcp47 error

Validation failed

timezone_iana error

Validation failed

parent_must_exist_and_be_different error

Validation failed

support_access_expiry_future error

Validation failed

status_transition_legal error

Validation failed

Business Rules

test_tenant_excluded_from_external_reports
always

Organizations with is_test_tenant = true must be excluded from Bufdir exports and all external reporting outputs.

hierarchy_must_be_acyclic
on_update

parent_organization_id chain must not form a cycle and cannot reference self.

always_on_modules_cannot_be_disabled
on_update

Mobile (authentication-access-control, home-navigation, accessibility, help-support, profile-management) and Admin (admin-dashboard, admin-user-management, admin-organization, admin-security) always-on modules cannot be disabled for any organization.

norse_support_access_audited
always

Every access by a Global Admin under the time-bounded support flag must be recorded in the org's audit log; expiry immediately revokes access.

archive_cascade_suspends_users
on_update

Archiving an organization deactivates all member users and revokes active sessions.

tenant_isolation
always

All tenant-scoped queries must filter by organization_id; cross-tenant data access is forbidden except for Global Admins with active support-access grant.

default_modules_on_creation
on_create

New organizations are provisioned with the always-on module set and any explicitly selected optional modules from the area taxonomy.

labels_overrides_apply_globally
always

Organization Labels overrides (e.g. contacts → Familie) are surfaced to all clients of the tenant via the bootstrap response and override default terminology in UI.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage

Entity Relationships

users
outgoing one_to_many
optional