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

import { DropdownOption } from "./entities/dropdown-option.entity";
import { DropdownSetting } from "./entities/dropdown-setting.entity";
import { DropdownSettingsController } from "./dropdown-settings.controller";
import { DropdownSettingsRepository } from "./dropdown-settings.repository";
import { DropdownSettingsService } from "./dropdown-settings.service";
import { DROPDOWN_SETTINGS_REPOSITORY } from "./interfaces/dropdown-settings.repository.interface";

@Module({
  imports: [TypeOrmModule.forFeature([DropdownSetting, DropdownOption])],
  controllers: [DropdownSettingsController],
  providers: [
    DropdownSettingsRepository,
    {
      provide: DROPDOWN_SETTINGS_REPOSITORY,
      useExisting: DropdownSettingsRepository,
    },
    DropdownSettingsService,
  ],
  exports: [DropdownSettingsService],
})
export class DropdownSettingsModule {}
