import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { Employee } from '@tria-plc/iamapi-common/entities/iam/organization-structure/employee.entity';
import { Session } from '@tria-plc/iamapi-common/entities/iam/user/session.entity';
import { User } from '@tria-plc/iamapi-common/entities/iam/user/user.entity';
import { UserVerification } from '@tria-plc/iamapi-common/entities/iam/user/user-verification.entity';

import { ExternalProfile } from '../companies/entities/external-profile.entity';
import { NotificationsModule } from '../notifications/notifications.module';
import { OtpModule } from '../otp/otp.module';
import { AccountController } from './account.controller';
import { AccountService } from './account.service';
import { CheckAvailabilityController } from './check-availability.controller';
import { CheckAvailabilityService } from './check-availability.service';
import { CustomerResetController } from './customer-reset.controller';
import { CustomerResetService } from './customer-reset.service';
import { ForgotPasswordController } from './forgot-password.controller';
import { ForgotPasswordService } from './forgot-password.service';
import { FreightMeController } from './freight-me.controller';
import { FreightMeService } from './freight-me.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      User,
      UserVerification,
      ExternalProfile,
      Session,
      Employee,
    ]),
    OtpModule,
    // Reset links go out over email/SMS directly, not through the OTP service.
    NotificationsModule,
  ],
  controllers: [
    FreightMeController,
    AccountController,
    CheckAvailabilityController,
    ForgotPasswordController,
    CustomerResetController,
  ],
  providers: [
    FreightMeService,
    AccountService,
    CheckAvailabilityService,
    ForgotPasswordService,
    CustomerResetService,
  ],
})
export class FreightAuthModule {}
