import { z } from "zod";

const configSchema = z.object({
  // Database
  DATABASE_URL: z.string().url(),
  
  // OIDC Configuration
  OIDC_ISSUER: z.string().url(),
  OIDC_CLIENT_ID: z.string(),
  OIDC_CLIENT_SECRET: z.string(),
  OIDC_CALLBACK_URL: z.string().url(),
  OIDC_SCOPE: z.string().default("openid profile email"),
  
  // Session (Iron)
  SESSION_SECRET: z.string().min(32),
  
  // GitHub
  GITHUB_TOKEN: z.string(),
  GITHUB_REPO: z.string(),
  GITHUB_OWNER: z.string(),
  GITHUB_BRANCH: z.string().default("main"),
  
  // Server
  PORT: z.string().default("3000"),
  NODE_ENV: z.enum(["development", "production"]).default("development"),
});

export const config = configSchema.parse(process.env);
