Skip to content

Commit

Permalink
Merge pull request #511 from WISVCH/export/scanned
Browse files Browse the repository at this point in the history
Add if the ticket has been scanned to the event export
  • Loading branch information
dsluijk authored Dec 5, 2024
2 parents 7d071fc + e19fcc3 commit 92b32da
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import ch.wisv.events.core.model.event.Event;
import ch.wisv.events.core.model.event.EventStatus;
import ch.wisv.events.core.model.ticket.Ticket;
import ch.wisv.events.core.model.ticket.TicketStatus;
import ch.wisv.events.core.model.webhook.WebhookTrigger;
import ch.wisv.events.core.service.document.DocumentService;
import ch.wisv.events.core.service.event.EventService;
Expand Down Expand Up @@ -265,9 +266,9 @@ public HttpEntity<? extends Object> csvExport(@PathVariable String key) {
.flatMap(product -> ticketService.getAllByProduct(product).stream())
.collect(Collectors.toList());
String csvData = tickets.stream()
.map(t -> t.getOwner().getName() + ";" + t.getOwner().getEmail() + ";" + t.getProduct().title)
.map(t -> t.getOwner().getName() + ";" + t.getOwner().getEmail() + ";" + (t.getStatus() == TicketStatus.SCANNED ? "Yes" : "No") + ";" + t.getProduct().title)
.collect(Collectors.joining("\n"));
csvData = "Name;Email;Product\n" + csvData;
csvData = "Name;Email;Scanned;Product\n" + csvData;
InputStream bufferedInputStream = new ByteArrayInputStream(csvData.getBytes(StandardCharsets.UTF_8));
InputStreamResource fileInputStream = new InputStreamResource(bufferedInputStream);

Expand Down

0 comments on commit 92b32da

Please sign in to comment.