import { Module, forwardRef } from '@nestjs/common';
import { AdminService } from './providers/admin.service';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { Admin } from './entities/admin.entity';
import { JwtModule } from '@nestjs/jwt';
import { AdminRepository } from './repositories/admin.repository';
import { Role } from '../roles/entities/role.entity';
import { Permission } from '../roles/entities/permission.entity';
import { RolePermission } from '../roles/entities/rolePermission.entity';
import { AdminController } from './controllers/admin.controller';
import { UtilsModule } from '../utils/utils.module';
import { RestaurantsModule } from '../restaurants/restaurants.module';
import { AdminRole } from './entities/adminRole.entity';
import { AdminRoleRepository } from './repositories/admin-role.repository';

@Module({
  providers: [AdminService, AdminRepository, AdminRoleRepository],
  controllers: [AdminController],
  imports: [
    MikroOrmModule.forFeature([Admin, Role, Permission, RolePermission, AdminRole]),
    JwtModule,
    UtilsModule,
    forwardRef(() => RestaurantsModule),
  ],
  exports: [AdminService, AdminRepository],
})
export class AdminModule { }
