Skip to main content

Platform Admin Service — Domain Model

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 02 DDD

1. Aggregates

AggregateRoot entityPrimary IDInvariants
PlatformConfigPlatformConfig(key, scope, tenantId) compositekey must be in code-defined allow-list; value must match type schema for key; isArchived is terminal-soft
FeatureFlagFeatureFlagFlagKey (string)key globally unique; archived flag always evaluates to false; enabledTenantIds and disabledTenantIds take precedence over defaultEnabled
HealthSourceHealthSourceHealthSourceId (hsr_)serviceId unique; heartbeat timestamp updated on registration; stale > TTL = unhealthy

2. State machines

2.1 PlatformConfig

2.2 FeatureFlag

2.3 HealthSource

3. Entities (non-root)

EntityParentPurpose
PlatformConfigHistoryPlatformConfigAppend-only log of value changes with before/after and actor
TenantFlagOverrideFeatureFlagPer-tenant explicit enable/disable; overrides defaultEnabled
HealthCheckResultHealthSourceLast N probe results; used for aggregate status

4. Value objects

Value objectShapeNotes
ConfigKeyallow-listed string {namespace}.{key}e.g., global.session_max_absolute_minutes
ConfigScopeenum PLATFORM | TENANT | NODE
ConfigValuetyped scalar (int, bool, string)Type validated against key schema
FlagKey[a-z0-9._-]+ globally uniqueImmutable once created
FlagDecision{ enabled: boolean, reason: string }Returned by evaluate()
AggregateHealthStatusenum healthy | degraded | unhealthyDerived from per-service statuses

5. Domain events

EventSubjectFired by
ConfigUpdatedplatform_admin.config.updated.v1UpsertConfigUseCase
FlagCreatedplatform_admin.flag.created.v1CreateFlagUseCase
FlagUpdatedplatform_admin.flag.updated.v1UpdateFlagUseCase
FlagArchivedplatform_admin.flag.archived.v1ArchiveFlagUseCase
HealthSourceRegisteredplatform_admin.health_source.registered.v1RegisterHealthSourceUseCase

6. Ubiquitous language

TermMeaning
Platform configA governed KV pair that controls platform behavior (session timeouts, MFA defaults, SMTP settings)
Allow-listCode-defined set of valid config keys; unknown keys are rejected at API boundary
Feature flagA named boolean gate that controls feature exposure across the platform
Tenant overrideAn explicit per-tenant enable/disable that takes precedence over the platform default
Health sourceA registered service endpoint that platform-admin polls for health status
Aggregate healthThe derived overall platform status combining all health source results
EvaluationResolving a feature flag for a given tenant context → { enabled: boolean }

7. Invariants

#Invariant
INV-01Config key must be in code allow-list; unknown keys rejected with 400
INV-02Config value must match the type schema defined for the key
INV-03Archived configs are soft-deleted; history preserved
INV-04FeatureFlag key is immutable once created
INV-05Archived flag always evaluates to enabled=false; no override can change this
INV-06enabledTenantIds and disabledTenantIds are mutually exclusive per tenant
INV-07Config mutations emit a PlatformConfigHistory row with old/new values
INV-08Feature-flag and licensing decisions are independent (BR-ADM-002)