From e19fcc347ddabbf104ea2ce5a34ca88acb0f6f1e Mon Sep 17 00:00:00 2001 From: Dany Sluijk Date: Thu, 5 Dec 2024 13:30:51 +0000 Subject: [PATCH] feat: add if the ticket has been scanned to the event export --- .../events/admin/controller/DashboardEventController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/wisv/events/admin/controller/DashboardEventController.java b/src/main/java/ch/wisv/events/admin/controller/DashboardEventController.java index 4e76db7f..a68c5dfe 100644 --- a/src/main/java/ch/wisv/events/admin/controller/DashboardEventController.java +++ b/src/main/java/ch/wisv/events/admin/controller/DashboardEventController.java @@ -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; @@ -265,9 +266,9 @@ public HttpEntity 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);