in service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ChequeAggregate.java [189:205]
public String process(final ApproveChequeTransactionCommand approveChequeTransactionCommand) {
final MICR micr = MICRParser.fromIdentifier(approveChequeTransactionCommand.identifier());
final Optional<ChequeEntity> optionalCheque = this.chequeRepository.findByChequeNumberAndBranchSortCodeAndAccountNumber(
micr.getChequeNumber(), micr.getBranchSortCode(), micr.getAccountNumber()
);
if (optionalCheque.isPresent()) {
final ChequeEntity chequeEntity = optionalCheque.get();
chequeEntity.setState(State.PROCESSED.name());
chequeEntity.setLastModifiedBy(UserContextHolder.checkedGetUser());
chequeEntity.setLastModifiedOn(LocalDateTime.now(Clock.systemUTC()));
this.chequeRepository.save(chequeEntity);
return approveChequeTransactionCommand.identifier();
} else {
throw ServiceException.notFound("Cheque {0} not found.", approveChequeTransactionCommand.identifier());
}
}