Repository: incubator-fineract Updated Branches: refs/heads/develop 56da30c3f -> 5647ffb96
commit for FINERACT-70 (Rename deleted standing instruction by appending '_deleted_' string and the id) Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/5647ffb9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/5647ffb9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/5647ffb9 Branch: refs/heads/develop Commit: 5647ffb966a9a636833663784be6630613359349 Parents: 56da30c Author: Emmanuel Nnaa <emmanueln...@musoni.eu> Authored: Tue Aug 2 15:46:47 2016 +0200 Committer: Emmanuel Nnaa <emmanueln...@musoni.eu> Committed: Tue Aug 2 15:46:47 2016 +0200 ---------------------------------------------------------------------- .../account/domain/AccountTransferStandingInstruction.java | 8 ++++++++ .../service/StandingInstructionWritePlatformServiceImpl.java | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5647ffb9/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java index a9b2858..4249338 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java @@ -291,4 +291,12 @@ public class AccountTransferStandingInstruction extends AbstractPersistable<Long public void updateStatus(Integer status){ this.status = status; } + + /** + * delete the standing instruction by setting the status to 3 and appending "_deleted_" and the id to the name + **/ + public void delete() { + this.status = StandingInstructionStatus.DELETED.getValue(); + this.name = this.name + "_deleted_" + this.getId(); + } } http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5647ffb9/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java index 9d6a48b..6cb3c4a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java @@ -178,7 +178,9 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst @Override public CommandProcessingResult delete(final Long id) { AccountTransferStandingInstruction standingInstructionsForUpdate = this.standingInstructionRepository.findOne(id); - standingInstructionsForUpdate.updateStatus(StandingInstructionStatus.DELETED.getValue()); + // update the "deleted" and "name" properties of the standing instruction + standingInstructionsForUpdate.delete(); + final Map<String, Object> actualChanges = new HashMap<>(); actualChanges.put(statusParamName, StandingInstructionStatus.DELETED.getValue()); return new CommandProcessingResultBuilder() //