diff --git a/src/main/java/ru/soune/nocopy/service/register/AuthService.java b/src/main/java/ru/soune/nocopy/service/register/AuthService.java index 88db04f..7baa057 100644 --- a/src/main/java/ru/soune/nocopy/service/register/AuthService.java +++ b/src/main/java/ru/soune/nocopy/service/register/AuthService.java @@ -217,16 +217,16 @@ public class AuthService { throw new IllegalStateException("Company not have tariff"); } - Tariff tariff = tariffInfo.getTariff(); - Long maxUsers = tariff.getMaxUsers(); - long currentCountUsers = userRepository.countByCompanyId(company.getId()); - - if (currentCountUsers >= maxUsers) { - throw new NotValidFieldException("Max user is over.", new BaseResponse(20002, - MessageCode.USER_LIMIT_IS_OVER.getCode(), - MessageCode.USER_LIMIT_IS_OVER.getDescription(), Map.of( - "limit", maxUsers, "countUser", currentCountUsers))); - } +// Tariff tariff = tariffInfo.getTariff(); +// Long maxUsers = tariff.getMaxUsers(); +// long currentCountUsers = userRepository.countByCompanyId(company.getId()); +// +// if (currentCountUsers >= maxUsers) { +// throw new NotValidFieldException("Max user is over.", new BaseResponse(20002, +// MessageCode.USER_LIMIT_IS_OVER.getCode(), +// MessageCode.USER_LIMIT_IS_OVER.getDescription(), Map.of( +// "limit", maxUsers, "countUser", currentCountUsers))); +// } user.setCompany(company); user.grantPermission(Permission.DEFAULT_USER_PERMISSIONS);