Infrastructure medium complexity backend
1
Dependencies
0
Dependents
5
Entities
0
Integrations

Description

Database migration and seeding infrastructure that initializes the full known organizational hierarchy for all four client organizations (NHF, Blindeforbundet, HLF, Barnekreftforeningen) at deploy time. Ensures the three-tier tree of 12 national chapters, 9 regions, and up to 1,400 local associations is consistently present across all environments from first deployment.

Feature: Multi-Organization Hierarchy Management

hierarchy-seed-migration

Responsibilities

  • Generate and run SQL migrations for organizations, regions, and local_associations tables
  • Seed the known hierarchy data for all four organizations with correct foreign key relationships
  • Provide idempotent re-seed capability so deployments are safely repeatable
  • Validate hierarchy integrity after seeding (FK constraints, node counts)

Interfaces

runHierarchySeedMigration(): Promise<void>
seedOrganization(def: OrgSeedDefinition): Promise<void>
validateHierarchyIntegrity(orgId: string): ValidationResult
rollbackHierarchySeed(orgId: string): Promise<void>
getExpectedNodeCounts(): Record<string, number>

Relationships

Dependencies (1)

Components this component depends on