@@ -197,8 +197,10 @@ public class AuthService {
|
||||
long currentCountUsers = userRepository.countByCompanyId(company.getId());
|
||||
|
||||
if (currentCountUsers >= maxUsers) {
|
||||
throw new MaxUserCountIsOver(
|
||||
String.format("Max user is over. " + "Has: %d, current count: %d", maxUsers, currentCountUsers));
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user