use of com.github.robozonky.api.notifications.SaleRequestedEvent in project robozonky by RoboZonky.
the class Selling method processInvestment.
private Optional<Investment> processInvestment(final Zonky zonky, final RecommendedInvestment r) {
Events.fire(new SaleRequestedEvent(r));
final Investment i = r.descriptor().item();
if (isDryRun) {
LOGGER.debug("Not sending sell request for loan #{} due to dry run.", i.getLoanId());
} else {
LOGGER.debug("Sending sell request for loan #{}.", i.getLoanId());
zonky.sell(i);
LOGGER.trace("Request over.");
}
Investment.putOnSmp(i);
Events.fire(new SaleOfferedEvent(i, r.descriptor().related()));
return Optional.of(i);
}
Aggregations