I have around 10 tables in my project... each table has it own module with the nest g resource ... with al endpoints. Each module is exporting the exports: [...UserProvider], that registers each entity. When I need to use an entity in a different module I imports: [UserModule], and therefore the UserProvider is available in that module for me by constructor(@Inject(USER_REPOSITORY) private readonly userRepository: typeof User,. I'm running into the issue of circular dependency when in many to many tables, and depending of the UX flow I'm allocating code in different modules and importing those repositories giving me the circular dependency error. I see here several discussions where but they are injecting into the constructor a service and not the entity.
Is there a pattern that I can use any entity on any module without running into circular dependency? I don't want to import the service that the controller is using but the actual entity.