You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "taskain7 (via GitHub)" <gi...@apache.org> on 2023/05/25 12:08:16 UTC
[GitHub] [fineract] taskain7 commented on a diff in pull request #3201: [FINERACT-1926] Loan account transfer POST API fixes
taskain7 commented on code in PR #3201:
URL: https://github.com/apache/fineract/pull/3201#discussion_r1205419661
##########
fineract-investor/src/main/java/org/apache/fineract/investor/service/ExternalAssetOwnersWriteServiceImpl.java:
##########
@@ -182,6 +189,25 @@ private void validateRequestBody(String apiRequestBodyAsJson) {
ExternalTransferRequestParameters.DATEFORMAT, ExternalTransferRequestParameters.LOCALE));
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, apiRequestBodyAsJson, requestParameters);
+
+ final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
+ final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loantransfer");
+ final JsonElement json = fromApiJsonHelper.parse(apiRequestBodyAsJson);
+
+ String ownerExternalId = fromApiJsonHelper.extractStringNamed(ExternalTransferRequestParameters.OWNER_EXTERNAL_ID, json);
+ baseDataValidator.reset().parameter(ExternalTransferRequestParameters.OWNER_EXTERNAL_ID).value(ownerExternalId).notBlank()
+ .notExceedingLengthOf(100);
+
+ String transferExternalId = fromApiJsonHelper.extractStringNamed(ExternalTransferRequestParameters.TRANSFER_EXTERNAL_ID, json);
+ baseDataValidator.reset().parameter(ExternalTransferRequestParameters.TRANSFER_EXTERNAL_ID).value(transferExternalId).ignoreIfNull()
+ .notExceedingLengthOf(100);
+
+ String purchasePriceRatio = fromApiJsonHelper.extractStringNamed(ExternalTransferRequestParameters.PURCHASE_PRICE_RATIO, json);
Review Comment:
based on the design doc, it's also in the request for buyback.
--
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