namespace ControlPlane.Core.Models; /// /// Defines the exact infrastructure composition for a provisioned tenant. /// Each component is configured independently — the TenantTier gates which /// ComponentMode values are available in the UI. /// /// Allowed modes per tier: /// /// | Trial | Shared | Dedicated | Enterprise | /// SharedPlatform | ✅ | ✅ | ✅ | ✅ | /// Bundled | ✅ | ❌ | ❌ | ❌ | /// OwnContainer | ❌ | ❌ | ✅ | ✅ | /// VpsDocker | ❌ | ❌ | ❌ | ✅ | /// VpsBareMetal | ❌ | ❌ | ❌ | ✅ | /// public class StackConfig { public ComponentMode Postgres { get; set; } = ComponentMode.SharedPlatform; public ComponentMode Keycloak { get; set; } = ComponentMode.SharedPlatform; public ComponentMode Vault { get; set; } = ComponentMode.SharedPlatform; public ComponentMode Minio { get; set; } = ComponentMode.SharedPlatform; /// Returns a default StackConfig for the given tier. public static StackConfig DefaultForTier(TenantTier tier) => tier switch { TenantTier.Trial => new StackConfig { Postgres = ComponentMode.Bundled, Keycloak = ComponentMode.SharedPlatform, Vault = ComponentMode.SharedPlatform, Minio = ComponentMode.SharedPlatform }, TenantTier.Shared => new StackConfig(), TenantTier.Dedicated => new StackConfig { Postgres = ComponentMode.OwnContainer, Keycloak = ComponentMode.OwnContainer, Vault = ComponentMode.OwnContainer, Minio = ComponentMode.OwnContainer }, TenantTier.Enterprise => new StackConfig { Postgres = ComponentMode.VpsDocker, Keycloak = ComponentMode.VpsDocker, Vault = ComponentMode.VpsDocker, Minio = ComponentMode.VpsDocker }, _ => new StackConfig() }; }