MIFOSX-2053 Able to add/delete/edit tranches.

This commit is contained in:
Chandrika
2015-06-01 14:58:42 -04:00
parent 8311a5d1fc
commit 1d0892d199
2 changed files with 23 additions and 1 deletions
@@ -292,4 +292,18 @@ public class CommandWrapper {
return this.actionName + "_" + this.entityName;
}
public boolean isLoanDisburseDetailResource() {
return this.entityName.equalsIgnoreCase("DISBURSEMENTDETAIL");
}
public boolean isUpdateDisbursementDate() {
return this.actionName.equalsIgnoreCase("UPDATE") && this.entityName.equalsIgnoreCase("DISBURSEMENTDETAIL")
&& this.entityId != null;
}
public boolean addAndDeleteDisbursementDetails() {
return this.actionName.equalsIgnoreCase("UPDATE") && this.entityName.equalsIgnoreCase("DISBURSEMENTDETAIL")
&& this.entityId == null;
}
}
@@ -172,7 +172,15 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
} else {
throw new UnsupportedCommandException(wrapper.commandName());
}
}
} else if (wrapper.isLoanDisburseDetailResource()) {
if (wrapper.isUpdateDisbursementDate()) {
handler = this.applicationContext.getBean("updateLoanDisbuseDateCommandHandler", NewCommandSourceHandler.class);
} else if (wrapper.addAndDeleteDisbursementDetails()) {
handler = this.applicationContext.getBean("addAndDeleteLoanDisburseDetailsCommandHandler", NewCommandSourceHandler.class);
} else {
throw new UnsupportedCommandException(wrapper.commandName());
}
}
else {
handler = this.commandHandlerProvider.getHandler(wrapper.entityName(), wrapper.actionName());