Search in sources :

Example 1 with QuickFix

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));
}
Also used : QuickFix(name.abuchen.portfolio.checks.QuickFix) Issue(name.abuchen.portfolio.checks.Issue)

Example 2 with QuickFix

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;
}
Also used : QuickFix(name.abuchen.portfolio.checks.QuickFix) Account(name.abuchen.portfolio.model.Account) PortfolioTransaction(name.abuchen.portfolio.model.PortfolioTransaction) ArrayList(java.util.ArrayList)

Aggregations

QuickFix (name.abuchen.portfolio.checks.QuickFix)2 ArrayList (java.util.ArrayList)1 Issue (name.abuchen.portfolio.checks.Issue)1 Account (name.abuchen.portfolio.model.Account)1 PortfolioTransaction (name.abuchen.portfolio.model.PortfolioTransaction)1