commit for FINERACT-70 (Rename deleted standing instruction by appending '_deleted_' string and the id)
This commit is contained in:
+8
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -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() //
|
||||
|
||||
Reference in New Issue
Block a user