FINERACT-2421: External Asset Owner create api
This commit is contained in:
committed by
Adam Saghy
parent
6875645825
commit
955222ee82
+7
@@ -3732,6 +3732,13 @@ public class CommandWrapperBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommandWrapperBuilder createExternalAssetOwner() {
|
||||
this.actionName = "CREATE";
|
||||
this.entityName = "EXTERNAL_ASSET_OWNER";
|
||||
this.href = "/external-asset-owners";
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommandWrapperBuilder buybackLoanToExternalAssetOwner(final Long loanId) {
|
||||
this.actionName = "BUYBACK";
|
||||
this.entityName = "LOAN";
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ public final class CommandParameterUtil {
|
||||
public static final String CANCEL_COMMAND_VALUE = "cancel";
|
||||
public static final String UPDATE_COMMAND_VALUE = "update";
|
||||
public static final String DELETE_COMMAND_VALUE = "delete";
|
||||
public static final String CREATE_COMMAND_VALUE = "create";
|
||||
|
||||
private CommandParameterUtil() {}
|
||||
|
||||
|
||||
+17
@@ -18,8 +18,12 @@
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.core.validator;
|
||||
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
@@ -48,4 +52,17 @@ public class ParseAndValidator {
|
||||
dataValidator.getDataValidationErrors());
|
||||
}
|
||||
}
|
||||
|
||||
protected static void validateRequestBody(String json) {
|
||||
if (StringUtils.isBlank(json)) {
|
||||
throw new InvalidJsonException();
|
||||
}
|
||||
}
|
||||
|
||||
protected void validateForSupportedParameters(final String json, final Collection<String> supportedParameters,
|
||||
final FromJsonHelper fromApiJsonHelper) {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, supportedParameters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user