import { registerAs } from '@nestjs/config';

export default registerAs('app', () => ({
  environment: process.env.ENVIRONMENT,
  name: process.env.APP_NAME,
  url: process.env.APP_URL,
  port: process.env.PORT,
  redis: process.env.REDIS_URL,
  corsEnabled: process.env.APP_CORS_ENABLED,
  jwtAccessSecret: process.env.JWT_ACCESS_SECRET,
  jwtRefreshSecret: process.env.JWT_REFRESH_SECRET,
  jwtExpiresIn: process.env.JWT_EXPIRES_IN,
  jwtRefreshIn: process.env.JWT_REFRESH_IN,
  bcryptSaltRounds: process.env.BCRYPT_SALT_ROUNDS,
  graphqlPlaygroundEnabled: process.env.GRAPHQL_PLAYGROUND_ENABLED,
  graphqlDebug: process.env.GRAPHQL_DEBUG,
  graphqlSchemaDestination: process.env.GRAPHQL_SCHEMA_DESTINATION,
  graphqlSortSchema: process.env.GRAPHQL_SORT_SCHEMA,
  swaggerEnabled: process.env.SWAGGER_ENABLED,
  swaggerDescription: process.env.SWAGGER_DESCRIPTION,
  swaggerVersion: process.env.SWAGGER_VERSION,
  swaggerPath: process.env.SWAGGER_PATH,
  gClientId: process.env.GOOGLE_CLIENT_ID,
  gClientSecret: process.env.GOOGLE_SECRET,
  loggingType: process.env.LOGGING_TYPE || 'dev',
  googleMailer: {
    contactMail: process.env.CONTACT_MAIL || '',
    clientId: process.env.GOOGLE_MAILER_CLIENT_ID || '',
    clientSecret: process.env.GOOGLE_MAILER_CLIENT_SECRET || '',
    refreshToken: process.env.GOOGLE_MAILER_REFRESH_TOKEN || '',
    host: process.env.MAILER_HOST || '',
    port: process.env.MAILER_PORT || '',
    secure: process.env.MAILER_REFRESH_TOKEN || '',
    auth: {
      user: process.env.ADMIN_EMAIL_ADDRESS || '',
      pass: process.env.ADMIN_EMAIL_PASS || '',
    },
  },
}));
