vidakovic commented on code in PR #5622:
URL: https://github.com/apache/fineract/pull/5622#discussion_r3004077810


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/serialization/ProductMixDataValidator.java:
##########
@@ -18,66 +18,52 @@
  */
 package org.apache.fineract.portfolio.loanproduct.productmix.serialization;
 
-import com.google.gson.JsonElement;
-import com.google.gson.reflect.TypeToken;
-import java.lang.reflect.Type;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.fineract.infrastructure.core.data.ApiParameterError;
 import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
-import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
 import 
org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
-import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 @Component
 public final class ProductMixDataValidator {
 
-    public static final String RESTRICTED_PRODUCTS = "restrictedProducts";
-    /**
-     * The parameters supported for this command.
-     */
-    private static final Set<String> SUPPORTED_PARAMETERS = new 
HashSet<>(List.of(RESTRICTED_PRODUCTS));
     public static final String PRODUCTMIX = "productmix";
+    public static final String RESTRICTED_PRODUCTS = "restrictedProducts";
     public static final String RESTRICTED_PRODUCT = "restrictedProduct";
 
-    private final FromJsonHelper fromApiJsonHelper;
+    public void validateRestrictedProductsForCreate(final List<Long> 
restrictedProducts) {

Review Comment:
   Maybe it's possible to express the same rules with Jakarta Validation 
annotations on the request class? Much shorter and gives us proper error 
messages (in multiple languages).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to