Any report with a handler and no conclusion is an active report,
therefore we don't need to check if the report is active
This commit is contained in:
parent
c462282632
commit
afee339e16
@ -553,22 +553,22 @@ public class ReportManager
|
|||||||
reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList())
|
reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList())
|
||||||
).thenCompose(UtilFuture::sequence)
|
).thenCompose(UtilFuture::sequence)
|
||||||
.thenApply(UtilCollections::unboxPresent)
|
.thenApply(UtilCollections::unboxPresent)
|
||||||
.thenCompose(reports -> UtilFuture.filter(reports, this::isActiveReport)).thenApply(reports ->
|
.thenApply(reports ->
|
||||||
{
|
{
|
||||||
Report report = null;
|
Report report = null;
|
||||||
int size = reports.size();
|
int size = reports.size();
|
||||||
|
|
||||||
if (size == 1)
|
if (size == 1)
|
||||||
{
|
{
|
||||||
report = reports.get(0);
|
report = reports.get(0);
|
||||||
}
|
}
|
||||||
else if (size > 1)
|
else if (size > 1)
|
||||||
{
|
{
|
||||||
throw new IllegalStateException("Account is handling multiple reports.");
|
throw new IllegalStateException("Account is handling multiple reports.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Optional.ofNullable(report);
|
return Optional.ofNullable(report);
|
||||||
});
|
});
|
||||||
|
|
||||||
future.exceptionally(throwable -> Optional.empty());
|
future.exceptionally(throwable -> Optional.empty());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user