Skip to content

Commit 85fc084

Browse files
lupariVirmasaloA
authored andcommitted
CSCEXAM-459 Fix backend not returning some data
1 parent 109d107 commit 85fc084

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

app/controllers/admin/ReportController.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import controllers.base.BaseController;
1313
import io.ebean.DB;
1414
import io.ebean.ExpressionList;
15+
import io.ebean.Query;
1516
import io.ebean.text.PathProperties;
1617
import java.io.ByteArrayOutputStream;
1718
import java.io.IOException;
@@ -245,23 +246,21 @@ public Result getReservations(Optional<String> dept, Optional<String> start, Opt
245246

246247
@Restrict({ @Group("ADMIN") })
247248
public Result getIopReservations(Optional<String> dept, Optional<String> start, Optional<String> end) {
248-
ExpressionList<Reservation> query = DB.find(Reservation.class)
249-
.fetch("externalReservation")
250-
.fetch("enrolment")
251-
.where()
252-
.or()
253-
.isNotNull("externalRef")
254-
.isNotNull("externalReservation.orgName")
255-
.endOr();
256-
query = applyFilters(
257-
query,
249+
PathProperties pp = PathProperties.parse(
250+
"*, enrolment(noShow, externalExam(finished)), externalReservation(*)"
251+
);
252+
Query<Reservation> query = DB.find(Reservation.class);
253+
pp.apply(query);
254+
ExpressionList<Reservation> el = query.where().isNotNull("externalRef");
255+
el = applyFilters(
256+
el,
258257
"enrolment.exam.course",
259258
"startAt",
260259
dept.orElse(null),
261260
start.orElse(null),
262261
end.orElse(null)
263262
);
264-
Set<Reservation> reservations = query
263+
Set<Reservation> reservations = el
265264
.findSet()
266265
.stream()
267266
.filter(r -> r.getExternalOrgName() != null || (r.getExternalReservation() != null))

0 commit comments

Comments
 (0)