import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { MongooseModule } from '@nestjs/mongoose';
import { UsersModule } from './users/users.module';
import { PeopleModule } from './people/people.module';
import { BuildModule } from './builds/build.module';
import { BuildPartsModule } from './build-parts/build-parts.module';
import { BuildAreaModule } from './build-area/build-area.module';
import { UserTypesModule } from './user-types/user-types.module';
import { BuildTypesModule } from './build-types/build-types.module';
import { BuildAddressModule } from './build-address/build-address.module';
import { BuildIbanModule } from './build-iban/build-iban.module';
import { BuildSitesModule } from './build-sites/build-sites.module';
import { CompanyModule } from './company/company.module';
import { LivingSpaceModule } from './living-space/living-space.module';

@Module({
  imports: [
    GraphQLModule.forRoot<ApolloDriverConfig>({
      driver: ApolloDriver,
      autoSchemaFile: true,
      playground: true,
    }),
    MongooseModule.forRoot(process.env.MONGODB_URI || "mongodb://evyosdbuser:evyosdbpassword@10.10.2.13:27017/evyosdb"),
    BuildModule,
    UsersModule,
    PeopleModule,
    BuildPartsModule,
    BuildAreaModule,
    UserTypesModule,
    BuildTypesModule,
    BuildAddressModule,
    BuildIbanModule,
    BuildSitesModule,
    CompanyModule,
    LivingSpaceModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule { }
