import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { UsersService } from './users.service'; import { User } from './user.entity'; import { Campaign } from '../campaigns/entities/campaign.entity'; import { UsersOperatorController } from './users-operator.controller'; import { UsersAdminController } from './users-admin.controller'; import { UsersAdminService } from './users-admin.service'; import { RateLimitGuard } from '../../common/guards/rate-limit.guard'; // Two controllers, both narrow on purpose. The operator one exposes four named // fields; the admin one selects a named column list and is behind RolesGuard. // Neither returns the User entity whole — the old /users routes did, password // and token hashes included, and that is the mistake this module exists to // avoid repeating. Everything else reaches user records through /auth and // /profile, which scope every read to the authenticated principal. @Module({ imports: [TypeOrmModule.forFeature([User, Campaign])], controllers: [UsersOperatorController, UsersAdminController], providers: [UsersService, UsersAdminService, RateLimitGuard], exports: [UsersService], }) export class UsersModule {}