From e36783d43ee8aae44c9e45a8737dfa3f87655985 Mon Sep 17 00:00:00 2001 From: Joep de Jong Date: Mon, 2 Oct 2023 20:33:48 +0200 Subject: [PATCH] Add product info to passes --- .../core/service/ticket/TicketServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/ch/wisv/events/core/service/ticket/TicketServiceImpl.java b/src/main/java/ch/wisv/events/core/service/ticket/TicketServiceImpl.java index 14bd68f8..9fda2d81 100644 --- a/src/main/java/ch/wisv/events/core/service/ticket/TicketServiceImpl.java +++ b/src/main/java/ch/wisv/events/core/service/ticket/TicketServiceImpl.java @@ -267,12 +267,16 @@ public byte[] getApplePass(Ticket ticket) throws TicketPassFailedException { RestTemplate restTemplate = new RestTemplate(); + Product product = ticket.getProduct(); + Event event = product.getEvent(); + Map params = new HashMap<>(); - params.put("title", ticket.getProduct().getTitle()); - params.put("description", ticket.getProduct().getDescription()); - params.put("date", ticket.getProduct().getEvent().getStart().format(DateTimeFormatter.ISO_LOCAL_DATE)); - params.put("time", ticket.getProduct().getEvent().getStart().format(DateTimeFormatter.ofPattern("HH:mm"))); - params.put("location", ticket.getProduct().getEvent().getLocation()); + params.put("title", event.getTitle()); + params.put("ticket", product.getTitle()); + params.put("description", event.getDescription()); + params.put("date", event.getStart().format(DateTimeFormatter.ISO_LOCAL_DATE)); + params.put("time", event.getStart().format(DateTimeFormatter.ofPattern("HH:mm"))); + params.put("location", event.getLocation()); params.put("name", ticket.getOwner().getName()); params.put("code", ticket.getUniqueCode());