diff --git a/Package.resolved b/Package.resolved index a07b788e..62ad7b5e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "886db623d4cb2afb0f2deb192dcbab9bf39688b6acdb0d43e1e5d7d5c1abbc76", + "originHash" : "8b4e65f6b024df461416d808e2d0a6b815c12cb521697f0bd70d60002fa01a1d", "pins" : [ { "identity" : "apns", @@ -366,8 +366,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/vapor.git", "state" : { - "revision" : "1466c50e4ad39072143e2fcdf13b4ba11be375a0", - "version" : "4.106.0" + "revision" : "fb619ab6485a88787ef9c78ba70e7415f8ebf981", + "version" : "4.106.4" } }, { diff --git a/Resources/Views/Hub/_carousel.leaf b/Resources/Views/Hub/_carousel.leaf index f147c3fb..cc3e42cb 100644 --- a/Resources/Views/Hub/_carousel.leaf +++ b/Resources/Views/Hub/_carousel.leaf @@ -1,6 +1,39 @@ +#if(canViewDropInSessionParticipants): +
#(session.ownerName)
diff --git a/Sources/App/Features/Ticket Hub/Controllers/TicketHubRouteController.swift b/Sources/App/Features/Ticket Hub/Controllers/TicketHubRouteController.swift index aaa1d96a..dfda2749 100644 --- a/Sources/App/Features/Ticket Hub/Controllers/TicketHubRouteController.swift +++ b/Sources/App/Features/Ticket Hub/Controllers/TicketHubRouteController.swift @@ -79,6 +79,7 @@ struct TicketHubRouteController: RouteCollection { emailUrl: "mailto:info@swiftleeds.co.uk?subject=Refund Request&body=Ticket \(ticket.reference)" ), hasValidTicket: ticket.release?.metadata?.canBookDropInSession == true, + canViewDropInSessionParticipants: ticket.release?.metadata?.canViewDropInSessionParticipants == true, prompt: req.query["prompt"], event: EventContext(event: currentEvent) )) @@ -210,7 +211,8 @@ struct TicketHubRouteController: RouteCollection { isParticipant: slot.ticket.contains(slug), isFullyBooked: slot.ticket.count == model.maxTicketsPerSlot, isInPast: slot.date < Date(), - participantCount: slot.ticket.count + participantCount: slot.ticket.count, + participants: slot.ticketOwner ) } } @@ -243,7 +245,8 @@ struct TicketHubRouteController: RouteCollection { companyLink: model.companyLink, maximumAttendance: model.maxTicketsPerSlot, remainingSlots: slotsWithDay.map({ model.maxTicketsPerSlot - $0.participantCount }).reduce(0, +), - slots: slotsWithDay + slots: slotsWithDay, + slotsOrdered: slotsWithDay.sorted(by: { $0.date < $1.date }) ) } } @@ -274,6 +277,7 @@ struct TicketHubContext: Content { let isFullyBooked: Bool let isInPast: Bool let participantCount: Int + let participants: [String] } struct Session: Codable { @@ -293,6 +297,7 @@ struct TicketHubContext: Content { let remainingSlots: Int let slots: [SessionSlot] + let slotsOrdered: [SessionSlot] } struct VideoPresentation: Codable { @@ -309,6 +314,7 @@ struct TicketHubContext: Content { let groupSessions: [Session] let refund: Refund let hasValidTicket: Bool + let canViewDropInSessionParticipants: Bool let prompt: String? let event: EventContext } diff --git a/Sources/App/Features/Tickets/Middleware/ValidTicketMiddleware.swift b/Sources/App/Features/Tickets/Middleware/ValidTicketMiddleware.swift index 30a12b23..a883b7ae 100644 --- a/Sources/App/Features/Tickets/Middleware/ValidTicketMiddleware.swift +++ b/Sources/App/Features/Tickets/Middleware/ValidTicketMiddleware.swift @@ -15,30 +15,6 @@ struct ValidTicketMiddleware: AsyncMiddleware { await request.storage.setWithAsyncShutdown(CurrentEventKey.self, to: currentEvent) - #if DEBUG - // append ?skipTicket=true to route in debug builds in order to bypass tito - if request.application.environment.isRelease == false { - let value: String? = try? request.query.get(at: "skipTicket") - - if value == "true" { - await request.storage.setWithAsyncShutdown(TicketStorage.self, to: .init( - first_name: "James", - last_name: "Sherlock", - slug: "ti_test_p05Ch95xJS5AStInfa8whFA", - company_name: nil, - avatar_url: nil, - responses: [:], - release: .init(metadata: .init(canBookDropInSession: true)), - email: "james@gmail.com", - reference: "ABCD-1", - qr_url: "https://qr.tito.io/tickets/ti_p1NWgFenXguSSrqE2XRDHnw" - )) - - return try await next.respond(to: request) - } - } - #endif - let returnUrl = request.url.path.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) .map { "?returnUrl=" + $0 } ?? "" diff --git a/Sources/App/Features/Tickets/Models/TitoTicket.swift b/Sources/App/Features/Tickets/Models/TitoTicket.swift index 2bbb502b..3212edb9 100644 --- a/Sources/App/Features/Tickets/Models/TitoTicket.swift +++ b/Sources/App/Features/Tickets/Models/TitoTicket.swift @@ -3,6 +3,7 @@ import Foundation struct TitoTicket: Codable { struct Metadata: Codable { let canBookDropInSession: Bool? + let canViewDropInSessionParticipants: Bool? } struct Release: Codable {