This commit is contained in:
@@ -217,16 +217,16 @@ public class AuthService {
|
|||||||
throw new IllegalStateException("Company not have tariff");
|
throw new IllegalStateException("Company not have tariff");
|
||||||
}
|
}
|
||||||
|
|
||||||
Tariff tariff = tariffInfo.getTariff();
|
// Tariff tariff = tariffInfo.getTariff();
|
||||||
Long maxUsers = tariff.getMaxUsers();
|
// Long maxUsers = tariff.getMaxUsers();
|
||||||
long currentCountUsers = userRepository.countByCompanyId(company.getId());
|
// long currentCountUsers = userRepository.countByCompanyId(company.getId());
|
||||||
|
//
|
||||||
if (currentCountUsers >= maxUsers) {
|
// if (currentCountUsers >= maxUsers) {
|
||||||
throw new NotValidFieldException("Max user is over.", new BaseResponse(20002,
|
// throw new NotValidFieldException("Max user is over.", new BaseResponse(20002,
|
||||||
MessageCode.USER_LIMIT_IS_OVER.getCode(),
|
// MessageCode.USER_LIMIT_IS_OVER.getCode(),
|
||||||
MessageCode.USER_LIMIT_IS_OVER.getDescription(), Map.of(
|
// MessageCode.USER_LIMIT_IS_OVER.getDescription(), Map.of(
|
||||||
"limit", maxUsers, "countUser", currentCountUsers)));
|
// "limit", maxUsers, "countUser", currentCountUsers)));
|
||||||
}
|
// }
|
||||||
|
|
||||||
user.setCompany(company);
|
user.setCompany(company);
|
||||||
user.grantPermission(Permission.DEFAULT_USER_PERMISSIONS);
|
user.grantPermission(Permission.DEFAULT_USER_PERMISSIONS);
|
||||||
|
|||||||
Reference in New Issue
Block a user