adamsaghy commented on code in PR #2687:
URL: https://github.com/apache/fineract/pull/2687#discussion_r1000298327


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanEventApiJsonValidator.java:
##########
@@ -518,6 +518,26 @@ public void validateLoanChargeRefundTransaction(final 
String json) {
         throwExceptionIfValidationWarningsExist(dataValidationErrors);
     }
 
+    public void validateSetFlagToLoan(final String json) {
+        if (StringUtils.isBlank(json)) {
+            return;
+        }
+        Set<String> transactionParameters = new 
HashSet<>(Arrays.asList(LoanApiConstants.FRAUD_FLAG_NAME));
+
+        final Type typeOfMap = new TypeToken<Map<String, Object>>() 
{}.getType();
+        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, 
transactionParameters);
+
+        final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
+        final DataValidatorBuilder baseDataValidator = new 
DataValidatorBuilder(dataValidationErrors).resource("loan.flags");

Review Comment:
   Extract the "loan.flags" into a constant pls.



-- 
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