import { Module, forwardRef } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { OpcionService } from './opcion.service'; import { OpcionController } from './opcion.controller'; import { Opcion } from './entities/opcion.entity'; import { PreguntaOpcion } from '../pregunta_opcion/entities/pregunta_opcion.entity'; import { PreguntaModule } from '../pregunta/pregunta.module'; import { Pregunta } from '../pregunta/entities/pregunta.entity'; @Module({ imports: [ TypeOrmModule.forFeature([Opcion, Pregunta, PreguntaOpcion]), // Importar todas las entidades necesarias forwardRef(() => PreguntaModule), // Usar forwardRef para dependencia circular ], controllers: [OpcionController], providers: [OpcionService], exports: [OpcionService, TypeOrmModule], // Exportar TypeOrmModule si otros módulos necesitan los repositorios }) export class OpcionModule {}