namespace OTSSignsOrchestrator.Core.Configuration;
///
/// Shared constants for the application.
///
public static class AppConstants
{
public const string AdminRole = "Admin";
public const string ViewerRole = "Viewer";
// ── Global Docker secret names ──────────────────────────────────────────
/// Docker secret name for the global SMTP password.
public const string GlobalSmtpSecretName = "global_smtp_password";
/// Docker secret name for the shared MySQL host address.
public const string GlobalMysqlHostSecretName = "global_mysql_host";
/// Docker secret name for the shared MySQL port.
public const string GlobalMysqlPortSecretName = "global_mysql_port";
// ── Per-instance Docker secret name builders ────────────────────────────
/// Build a per-instance MySQL password secret name from the 3-letter abbreviation.
public static string CustomerMysqlPasswordSecretName(string abbrev)
=> $"{abbrev}-cms-db-password";
/// Build a per-instance MySQL username secret name from the 3-letter abbreviation.
public static string CustomerMysqlUserSecretName(string abbrev)
=> $"{abbrev}-cms-db-user";
/// Returns all per-instance MySQL secret names for a given abbreviation.
public static string[] AllCustomerMysqlSecretNames(string abbrev)
=> new[]
{
CustomerMysqlUserSecretName(abbrev),
};
/// Sanitize a customer name for use in Docker/secret names.
public static string SanitizeName(string name)
=> new string(name.Where(c => char.IsLetterOrDigit(c) || c == '-' || c == '_').ToArray()).ToLowerInvariant();
}