core PK: id 13 required 3 unique

Description

Represents the top-level tenant entity in the Meander multi-tenant platform. Each organization (e.g., NHF, Blindeforbundet, HLF, Barnekreftforeningen) is an independent operational unit with its own users, settings, terminology, feature flags, and reporting boundaries. Organizations form hierarchical structures with parent-child relationships and contain local associations as sub-units.

25
Attributes
6
Indexes
12
Validation Rules
40
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Unique identifier for the organization
PKrequiredunique
name string Official display name of the organization (e.g., 'Norges Handikapforbund')
required
slug string URL-safe unique identifier derived from the organization name, used in API routes and deep links
requiredunique
parent_organization_id uuid Reference to the parent organization in a hierarchical structure. Null for top-level organizations. Enables NHF's 12 national associations, 9 regions, and 1400 local associations model
-
organization_type enum Classification of the organization within the hierarchy
required
status enum Current operational status of the organization on the platform
required
contact_email string Primary contact email address for the organization
required
contact_phone string Primary contact phone number for the organization
-
address_line_1 string Street address of the organization
-
address_line_2 string Additional address information
-
postal_code string Norwegian postal code
-
city string City name
-
country string ISO 3166-1 alpha-2 country code, defaults to NO (Norway)
required
logo_url string URL to the organization's uploaded logo image in cloud storage
-
default_language string Default UI language for the organization's users (BCP 47 tag, e.g., 'nb' for Norwegian Bokmal, 'se' for Northern Sami)
required
timezone string IANA timezone identifier for the organization, used for report generation and scheduled tasks
required
bufdir_organization_id string External identifier used in Bufdir reporting submissions. Required for organizations that receive Bufdir grants
unique
subscription_tier enum Commercial subscription level determining feature availability and usage limits
required
max_users integer Maximum number of active users allowed under the current subscription tier
required
terminology_overrides json JSON object containing organization-specific label overrides for platform terminology. Keys are platform default terms, values are organization-specific replacements. Supports the terminology customization feature required by NHF, Blindeforbundet, and HLF
-
sensitive_fields_config json JSON configuration defining which fields trigger screen reader readout warnings. Critical for NHF and Blindeforbundet accessibility requirements
-
impact_multipliers json JSON object with organization-specific hourly rates and impact calculation factors used by the Advantage Calculator feature
-
onboarded_at datetime Timestamp when the organization completed onboarding and became active
-
created_at datetime Timestamp when the organization record was created
required
updated_at datetime Timestamp of the last update to the organization record
required

Database Indexes

idx_organizations_slug
btree unique

Columns: slug

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_bufdir_id
btree unique

Columns: bufdir_organization_id

idx_organizations_parent_type
btree

Columns: parent_organization_id, organization_type

Validation Rules

valid_email_format error

Validation failed

valid_slug_format error

Validation failed

unique_slug error

Validation failed

valid_parent_reference error

Validation failed

valid_terminology_overrides_schema error

Validation failed

valid_sensitive_fields_config warning

Validation failed

valid_impact_multipliers error

Validation failed

max_users_positive error

Validation failed

valid_bufdir_id_format error

Validation failed

logo_url_valid warning

Validation failed

country_code_valid error

Validation failed

status_transition_valid error

Validation failed

Business Rules

tenant_isolation
always

All data queries must be scoped to the requesting user's organization. Users from one organization must never see or modify data belonging to another organization. Global Admins manage the system but do not access org operational data by default.

hierarchy_depth_limit
on_create

Organization hierarchy must not exceed 4 levels (national → regional → local → partner) to maintain query performance and operational clarity. NHF's structure (12 national associations, 9 regions, 1400 local associations) is the maximum supported complexity.

no_circular_hierarchy
on_update

An organization cannot be its own ancestor or descendant. The parent_organization_id chain must be acyclic.

slug_immutable_after_creation
on_update

The organization slug cannot be changed after initial creation because it is used in API routes, deep links, and external integrations (e.g., Bufdir reporting references).

Enforced by: Organization Service
active_org_required_for_user_operations
always

Users can only be created, invited, or activated within organizations that have status 'active'. Suspended or inactive organizations block all user management operations.

max_users_enforcement
always

The number of active users in an organization must not exceed the max_users limit defined by the subscription tier. User invitations must be blocked when the limit is reached.

bufdir_id_required_for_reporting
always

Organizations that generate Bufdir reports must have a valid bufdir_organization_id. Report generation must fail with a clear error if this field is missing.

terminology_fallback_to_defaults
always

When terminology_overrides does not contain a key, the platform default term must be used. Overrides must never cause missing labels in the UI.

cascade_suspension_to_children
on_update

When a parent organization is suspended, all child organizations in the hierarchy must also be suspended. Reactivation of children requires the parent to be active first.

audit_all_settings_changes
on_update

Every modification to organization settings, terminology, feature flags, or hierarchy must produce an audit log entry with the actor, timestamp, and changed fields.

deletion_requires_data_migration
on_delete

An organization cannot be hard-deleted if it has any associated users, activities, contacts, or financial records. Soft-deletion via status change to 'inactive' is the only supported removal path for organizations with historical data.

parallel_system_support
always

Organizations transitioning to Meander must be able to operate existing systems in parallel. The platform must not enforce exclusive data ownership during the onboarding phase (status 'onboarding').

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage

Components Managing This Entity

data Permission Store ["mobile"] data Permission Store ["mobile","backend"] service Role Guard Service ["mobile"] service Role Guard Service ["mobile","backend"] ui Profile Screen ["mobile"] ui Profile Screen ["mobile"] service Expense Type Service ["backend"] service Expense Type Service ["backend"] service Contact Service ["mobile"] service Contact Service ["mobile"] ui Contacts List Screen ["mobile"] ui Contacts List Screen ["mobile"] data Report Store ["backend"] data Report Store ["backend"] service Bufdir Report Service ["backend"] service Bufdir Report Service ["backend","mobile"] data Threshold Config Store ["backend"] service Impact Calculator Service ["mobile"] service Impact Calculator Service ["mobile"] service Readout Warning Service ["mobile"] service Readout Warning Service ["mobile"] service Support Service ["mobile","backend"] service Support Service ["backend"] data Local SQLite Database ["mobile"] data Local SQLite Database ["mobile"] data Analytics Store ["backend"] data Analytics Store ["backend"] service KPI Aggregation Service ["backend"] service KPI Aggregation Service ["backend"] data User Repository ["backend"] data User Repository ["backend"] service User Service ["backend"] service User Service ["backend"] service Role Assignment Service ["backend"] service Role Assignment Service ["backend"] service Bulk User Processing Service ["backend"] service Bulk User Processing Service ["backend"] service Audit Log Service ["backend"] service Audit Log Service ["backend"] data Report Store ["backend"] data Report Store ["backend"] service Report Generation Service ["backend"] service Report Generation Service ["backend"] service Bufdir Export Service ["backend"] service Bufdir Export Service ["backend"] service Custom Report Service ["backend"] service Custom Report Service ["backend"] data Organization Config Store ["backend"] data Organization Config Store ["backend"] service Organization Service ["backend"] service Organization Service ["backend"] data Terminology Store ["backend"] service Terminology Service ["backend"] service Terminology Service ["backend"] service Feature Flag Service ["backend"] service Feature Flag Service ["backend"] data Hierarchy Store ["backend"] data Hierarchy Store ["backend"] infrastructure Hierarchy Migration Seeder ["backend"] service Hierarchy Scope Resolver ["backend"] service Hierarchy Service ["backend"] service Hierarchy Service ["backend"] service Association Service ["backend"] service Association Service ["backend"] service External Portal Service ["backend"] service External Portal Service ["backend"] service Accounting API Service ["backend"] service Accounting API Service ["backend"] service Security Monitoring Service ["backend"] service Security Monitoring Service ["backend"] service Audit Log Service ["backend"] service Audit Log Service ["backend"] service Impact Calculator Service ["frontend"] service Impact Calculator Service ["frontend"]