use of name.abuchen.portfolio.checks.QuickFix in project portfolio by buchen.
the class CrossEntryCheckTest method applyFixes.
private void applyFixes(Client client, List<Issue> issues) {
for (Issue issue : issues) {
List<QuickFix> fixes = issue.getAvailableFixes();
assertThat(fixes.isEmpty(), is(false));
fixes.get(0).execute();
}
assertThat(new CrossEntryCheck().execute(client).size(), is(0));
}
use of name.abuchen.portfolio.checks.QuickFix in project portfolio by buchen.
the class MissingBuySellAccountIssue method getAvailableFixes.
@Override
public List<QuickFix> getAvailableFixes() {
List<QuickFix> answer = new ArrayList<>();
answer.add(new ConvertToDeliveryFix());
if (portfolio.getReferenceAccount() != null)
answer.add(new CreateBuySellEntryFix(portfolio.getReferenceAccount()));
for (final Account account : client.getAccounts()) {
if (account.equals(portfolio.getReferenceAccount()))
continue;
answer.add(new CreateBuySellEntryFix(account));
}
answer.add(new DeleteTransactionFix<PortfolioTransaction>(client, portfolio, transaction));
return answer;
}
Aggregations