You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2022/10/20 12:29:29 UTC

[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2687: FINERACT-1772: Setting Fraud flag for a loan account

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


##########
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:
   Done!



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org