cleaning up MIFOSX-1014
This commit is contained in:
+7
-7
@@ -37,11 +37,11 @@ public class CommandWrapper {
|
|||||||
return new CommandWrapper(commandId, actionName, entityName, resourceId, subresourceId, resourceGetUrl, productId);
|
return new CommandWrapper(commandId, actionName, entityName, resourceId, subresourceId, resourceGetUrl, productId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static CommandWrapper fromExistingCommand(final Long commandId, final String actionName, final String entityName,
|
public static CommandWrapper fromExistingCommand(final Long commandId, final String actionName, final String entityName,
|
||||||
final Long resourceId, final Long subresourceId, final String resourceGetUrl, final Long productId,
|
final Long resourceId, final Long subresourceId, final String resourceGetUrl, final Long productId, final Long officeId,
|
||||||
final Long officeId, final Long groupId, final Long clientId, final Long loanId, final Long savingsId) {
|
final Long groupId, final Long clientId, final Long loanId, final Long savingsId) {
|
||||||
return new CommandWrapper(commandId, actionName, entityName, resourceId, subresourceId, resourceGetUrl, productId);
|
return new CommandWrapper(commandId, actionName, entityName, resourceId, subresourceId, resourceGetUrl, productId, officeId,
|
||||||
|
groupId, clientId, loanId, savingsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CommandWrapper(final Long commandId, final String actionName, final String entityName, final Long resourceId,
|
private CommandWrapper(final Long commandId, final String actionName, final String entityName, final Long resourceId,
|
||||||
@@ -91,9 +91,9 @@ public class CommandWrapper {
|
|||||||
this.templateId = templateId;
|
this.templateId = templateId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommandWrapper(final Long commandId, final String actionName, final String entityName,
|
private CommandWrapper(final Long commandId, final String actionName, final String entityName, final Long resourceId,
|
||||||
final Long resourceId, final Long subresourceId, final String resourceGetUrl, final Long productId,
|
final Long subresourceId, final String resourceGetUrl, final Long productId, final Long officeId, final Long groupId,
|
||||||
final Long officeId, final Long groupId, final Long clientId, final Long loanId, final Long savingsId) {
|
final Long clientId, final Long loanId, final Long savingsId) {
|
||||||
|
|
||||||
this.commandId = commandId;
|
this.commandId = commandId;
|
||||||
this.officeId = officeId;
|
this.officeId = officeId;
|
||||||
|
|||||||
+5
-4
@@ -87,13 +87,14 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio
|
|||||||
final CommandWrapper wrapper = CommandWrapper.fromExistingCommand(makerCheckerId, commandSourceInput.getActionName(),
|
final CommandWrapper wrapper = CommandWrapper.fromExistingCommand(makerCheckerId, commandSourceInput.getActionName(),
|
||||||
commandSourceInput.getEntityName(), commandSourceInput.resourceId(), commandSourceInput.subresourceId(),
|
commandSourceInput.getEntityName(), commandSourceInput.resourceId(), commandSourceInput.subresourceId(),
|
||||||
commandSourceInput.getResourceGetUrl(), commandSourceInput.getProductId(), commandSourceInput.getOfficeId(),
|
commandSourceInput.getResourceGetUrl(), commandSourceInput.getProductId(), commandSourceInput.getOfficeId(),
|
||||||
commandSourceInput.getGroupId(), commandSourceInput.getClientId(), commandSourceInput.getLoanId(), commandSourceInput.getSavingsId());
|
commandSourceInput.getGroupId(), commandSourceInput.getClientId(), commandSourceInput.getLoanId(),
|
||||||
|
commandSourceInput.getSavingsId());
|
||||||
final JsonElement parsedCommand = this.fromApiJsonHelper.parse(commandSourceInput.json());
|
final JsonElement parsedCommand = this.fromApiJsonHelper.parse(commandSourceInput.json());
|
||||||
final JsonCommand command = JsonCommand.fromExistingCommand(makerCheckerId, commandSourceInput.json(), parsedCommand,
|
final JsonCommand command = JsonCommand.fromExistingCommand(makerCheckerId, commandSourceInput.json(), parsedCommand,
|
||||||
this.fromApiJsonHelper, commandSourceInput.getEntityName(), commandSourceInput.resourceId(),
|
this.fromApiJsonHelper, commandSourceInput.getEntityName(), commandSourceInput.resourceId(),
|
||||||
commandSourceInput.subresourceId(), commandSourceInput.getGroupId(), commandSourceInput.getClientId(), commandSourceInput.getLoanId(),
|
commandSourceInput.subresourceId(), commandSourceInput.getGroupId(), commandSourceInput.getClientId(),
|
||||||
commandSourceInput.getSavingsId(), commandSourceInput.getResourceGetUrl(), commandSourceInput.getProductId());
|
commandSourceInput.getLoanId(), commandSourceInput.getSavingsId(), commandSourceInput.getResourceGetUrl(),
|
||||||
|
commandSourceInput.getProductId());
|
||||||
|
|
||||||
final boolean makerCheckerApproval = true;
|
final boolean makerCheckerApproval = true;
|
||||||
return this.processAndLogCommandService.processAndLogCommand(wrapper, command, makerCheckerApproval);
|
return this.processAndLogCommandService.processAndLogCommand(wrapper, command, makerCheckerApproval);
|
||||||
|
|||||||
+8
-4
@@ -67,11 +67,16 @@ public final class JsonCommand {
|
|||||||
null, null, null, null, null, null, url, productId);
|
null, null, null, null, null, null, url, productId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* Vishwas TODO: If we are recreating this command from the database, all
|
||||||
|
* properties should be set. Presence of NULL properties means we can expect
|
||||||
|
* errors!
|
||||||
|
***/
|
||||||
public static JsonCommand fromExistingCommand(final Long commandId, final String jsonCommand, final JsonElement parsedCommand,
|
public static JsonCommand fromExistingCommand(final Long commandId, final String jsonCommand, final JsonElement parsedCommand,
|
||||||
final FromJsonHelper fromApiJsonHelper, final String entityName, final Long resourceId, final Long subresourceId,
|
final FromJsonHelper fromApiJsonHelper, final String entityName, final Long resourceId, final Long subresourceId,
|
||||||
final Long groupId, final Long clientId, final Long loanId, final Long savingsId,final String url, final Long productId) {
|
final Long groupId, final Long clientId, final Long loanId, final Long savingsId, final String url, final Long productId) {
|
||||||
return new JsonCommand(commandId, jsonCommand, parsedCommand, fromApiJsonHelper, entityName, resourceId, subresourceId, groupId, clientId,
|
return new JsonCommand(commandId, jsonCommand, parsedCommand, fromApiJsonHelper, entityName, resourceId, subresourceId, groupId,
|
||||||
loanId, savingsId, null, null, null, null, url, productId);
|
clientId, loanId, savingsId, null, null, null, null, url, productId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JsonCommand(final Long commandId, final String jsonCommand, final JsonElement parsedCommand,
|
public JsonCommand(final Long commandId, final String jsonCommand, final JsonElement parsedCommand,
|
||||||
@@ -98,7 +103,6 @@ public final class JsonCommand {
|
|||||||
this.productId = productId;
|
this.productId = productId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String json() {
|
public String json() {
|
||||||
return this.jsonCommand;
|
return this.jsonCommand;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user