import { Module } from "@nestjs/common";
import { SequelizeModule } from "@nestjs/sequelize";
import { User } from "../../database/models/user.model";
import { UsersController } from "./users.controller";
import { UsersService } from "./users.service";
import { IsUserEmailUniqueRule } from "./validators/is_user_email_unique";
import { IsUserPhoneUniqueRule } from "./validators/is_user_phone_unique";

@Module({
  imports: [
    SequelizeModule.forFeature([
      User,
    ])
  ],
  providers: [
    UsersService,

    // Validator
    IsUserEmailUniqueRule,
    IsUserPhoneUniqueRule
  ],
  controllers: [
    UsersController,
  ],
  exports: [UsersService],
})
export class UsersModule {}
