/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth
 */
import { OAuthHandlers, OAuthModels, OAuthRepositories, OAuthServices } from '@app/o-auth';
import { OAuthFlowsHandlers, OAuthFlowsServices } from '@app/o-auth/flows';
import { TokenRetentionService } from '@app/o-auth/shared';
import { AuthenticationModule } from '@aurora/modules/authentication';
import { SharedModule } from '@aurora/shared.module';
import { OAuthClientReaderAdapter } from '@bridges/o-auth/client';
import { Module } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { SequelizeModule } from '@nestjs/sequelize';
import { ThrottlerModule } from '@nestjs/throttler';
import { OAuthAccessTokenApiControllers, OAuthAccessTokenApiResolvers } from './access-token';
import { OAuthApplicationApiControllers, OAuthApplicationApiResolvers } from './application';
import {
  OAuthApplicationClientApiControllers,
  OAuthApplicationClientApiResolvers,
} from './application-client';
import {
  OAuthAuthorizationCodeApiControllers,
  OAuthAuthorizationCodeApiResolvers,
} from './authorization-code';
import { OAuthClientApiControllers, OAuthClientApiResolvers } from './client';
import { OAuthCredentialApiControllers, OAuthCredentialApiResolvers } from './credential';
import { OAuthFlowsApiControllers, OAuthFlowsApiResolvers } from './flows';
import { OAuthBootstrapSeeder } from './o-auth-bootstrap.seeder';
import { OAuthSeeder } from './o-auth.seeder';
import { OAuthRefreshTokenApiControllers, OAuthRefreshTokenApiResolvers } from './refresh-token';
import { OAuthScopeApiControllers, OAuthScopeApiResolvers } from './scope';

@Module({
  imports: [
    SharedModule,
    SequelizeModule.forFeature([...OAuthModels]),
    AuthenticationModule,
    ScheduleModule.forRoot(),
    ThrottlerModule.forRoot([{ name: 'default', limit: 100, ttl: 60_000 }]),
  ],
  controllers: [
    ...OAuthClientApiControllers,
    ...OAuthApplicationClientApiControllers,
    ...OAuthApplicationApiControllers,
    ...OAuthAccessTokenApiControllers,
    ...OAuthRefreshTokenApiControllers,
    ...OAuthAuthorizationCodeApiControllers,
    ...OAuthScopeApiControllers,
    ...OAuthCredentialApiControllers,
    ...OAuthFlowsApiControllers,
  ],
  providers: [
    OAuthSeeder,
    OAuthBootstrapSeeder,
    ...OAuthHandlers,
    ...OAuthServices,
    ...OAuthRepositories,
    ...OAuthClientApiResolvers,
    ...OAuthApplicationClientApiResolvers,
    ...OAuthApplicationApiResolvers,
    ...OAuthAccessTokenApiResolvers,
    ...OAuthRefreshTokenApiResolvers,
    ...OAuthAuthorizationCodeApiResolvers,
    ...OAuthScopeApiResolvers,
    ...OAuthCredentialApiResolvers,
    ...OAuthFlowsApiResolvers,
    ...OAuthFlowsHandlers,
    ...OAuthFlowsServices,
    TokenRetentionService,
    OAuthClientReaderAdapter,
  ],
  exports: [OAuthClientReaderAdapter],
})
export class OAuthModule {}
