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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]