Search in sources :

Example 51 with Investment

use of com.github.robozonky.api.remote.entities.sanitized.Investment in project robozonky by RoboZonky.

the class InvestmentPurchasedEventListener method getData.

@Override
protected Map<String, Object> getData(final InvestmentPurchasedEvent event) {
    final Investment i = event.getInvestment();
    final Map<String, Object> result = super.getData(event);
    result.put("yield", FinancialCalculator.expectedInterestAfterFees(i, event.getPortfolioOverview()));
    final BigDecimal interestRate = FinancialCalculator.expectedInterestRateAfterFees(i, event.getPortfolioOverview());
    result.put("relativeYield", interestRate);
    return result;
}
Also used : BigDecimal(java.math.BigDecimal) Investment(com.github.robozonky.api.remote.entities.sanitized.Investment)

Example 52 with Investment

use of com.github.robozonky.api.remote.entities.sanitized.Investment in project robozonky by RoboZonky.

the class InvestmentSoldEventListener method getSubject.

@Override
String getSubject(final InvestmentSoldEvent event) {
    final Investment i = event.getInvestment();
    final BigDecimal remaining = i.getRemainingPrincipal();
    return "Participace prodána - " + remaining.intValue() + ",- Kč, půjčka " + Util.identifyLoan(event);
}
Also used : BigDecimal(java.math.BigDecimal) Investment(com.github.robozonky.api.remote.entities.sanitized.Investment)

Aggregations

Investment (com.github.robozonky.api.remote.entities.sanitized.Investment)52 Test (org.junit.jupiter.api.Test)34 Loan (com.github.robozonky.api.remote.entities.sanitized.Loan)24 AbstractZonkyLeveragingTest (com.github.robozonky.app.AbstractZonkyLeveragingTest)20 BigDecimal (java.math.BigDecimal)20 Event (com.github.robozonky.api.notifications.Event)13 PortfolioOverview (com.github.robozonky.api.strategies.PortfolioOverview)13 Authenticated (com.github.robozonky.app.authentication.Authenticated)13 Zonky (com.github.robozonky.common.remote.Zonky)13 Collection (java.util.Collection)13 Assertions (org.assertj.core.api.Assertions)13 SoftAssertions (org.assertj.core.api.SoftAssertions)13 Mockito (org.mockito.Mockito)13 Collections (java.util.Collections)12 Stream (java.util.stream.Stream)11 LoanDescriptor (com.github.robozonky.api.strategies.LoanDescriptor)10 Portfolio (com.github.robozonky.app.portfolio.Portfolio)9 Participation (com.github.robozonky.api.remote.entities.Participation)8 MarketplaceLoan (com.github.robozonky.api.remote.entities.sanitized.MarketplaceLoan)8 ExecutionCompletedEvent (com.github.robozonky.api.notifications.ExecutionCompletedEvent)7