/**
 * Base environment schema shared by all Fastify microservices.
 * Each service extends this with its own fields via loadConfig().
 */

import { z } from 'zod';

export const baseEnvSchema = z.object({
  PORT: z.coerce.number().default(3000),
  HOST: z.string().default('0.0.0.0'),
  NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
  CORS_ORIGIN: z.string().optional(),
  SERVICE_NAME: z.string(),
  COSMOS_ENDPOINT: z.string().min(1, 'COSMOS_ENDPOINT is required'),
  COSMOS_KEY: z.string().min(1, 'COSMOS_KEY is required'),
  COSMOS_DATABASE: z.string().default('lysnrai'),
});

export type BaseEnv = z.infer<typeof baseEnvSchema>;
