import * as Joi from 'joi';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import configuration from './configuration';
import { GoogleAuthConfigService } from './config.service';

@Module({
  imports: [
    ConfigModule.forRoot({
      load: [configuration],
      validationSchema: Joi.object({
        GOOGLE_AUTH_PROJECT_ID: Joi.string().required(),
      }),
    }),
  ],
  providers: [ConfigService, GoogleAuthConfigService],
  exports: [ConfigService, GoogleAuthConfigService],
})
export class GoogleAuthConfigModule {}
