/**
 * Compile-time constants for the authentication strategy options.
 * Follows the const-object-then-extract pattern to keep a single source of truth.
 */
export const AUTH_STRATEGY = {
  PASSWORD: 'password',
  AUTHORIZATION_CODE: 'authorization-code',
} as const;

export type AuthStrategy = (typeof AUTH_STRATEGY)[keyof typeof AUTH_STRATEGY];

/**
 * Shape of the `environment` object imported via `environments/environment`.
 * All environment files must satisfy this interface.
 */
export interface Environment {
  production: boolean;
  debug: boolean;
  /**
   * Authentication strategy for this deployment.
   * - 'password': local login form + Password Grant against this app's backend.
   * - 'authorization-code': satellite mode — delegates ALL auth to a remote hub
   *   via OAuth Authorization Code; no local login UI is shown.
   */
  authStrategy: AuthStrategy;
  api: {
    graphql: string;
    rest: string;
  };
  lang: {
    base: string;
    fallback: string;
    langs: string[];
  };
  oAuth: {
    applicationCode: string;
    applicationSecret: string;
  };
  appearance?: {
    theme: string;
    layout: string;
  };
  msEntraId?: {
    tenant: string;
    authority: string;
    clientId: string;
    redirectUri: string;
    scopes: string[];
  };
}
