This commit is contained in:
@@ -13,6 +13,9 @@ public class TariffConstants {
|
||||
public static final Integer PRO_TOKENS = 300;
|
||||
public static final Integer ENTERPRISE_TOKENS = 400;
|
||||
|
||||
public static final Integer TOKEN_VALUE = 3;
|
||||
public static final Integer IMAGE_TOKEN_VALUE = 3;
|
||||
public static final Integer VIDEO_TOKEN_VALUE = 16;
|
||||
public static final Integer AUDIO_TOKEN_VALUE = 8;
|
||||
public static final Integer PDF_TOKEN_VALUE = 6;
|
||||
public static final Integer TOKEN_VALUE_FOR_SEARCH = 5;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TariffInfoService {
|
||||
Integer tokens = activeTariffInfo.getTokens();
|
||||
|
||||
if (tokens - value > 0) {
|
||||
activeTariffInfo.setTokens(activeTariffInfo.getTokens() - TariffConstants.TOKEN_VALUE);
|
||||
activeTariffInfo.setTokens(activeTariffInfo.getTokens() - value);
|
||||
|
||||
tariffInfoRepository.save(activeTariffInfo);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user