From 86e0e0619f83122bb6ec8732536f166dfa738112 Mon Sep 17 00:00:00 2001 From: vladp Date: Fri, 20 Feb 2026 13:06:53 +0700 Subject: [PATCH] dev comment logic for check max users --- .../nocopy/service/register/AuthService.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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);