-
-
Notifications
You must be signed in to change notification settings - Fork 5
Enable drop-in hosts to view attendees #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ struct TicketHubRouteController: RouteCollection { | |
| emailUrl: "mailto:[email protected]?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 | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,30 +15,6 @@ struct ValidTicketMiddleware: AsyncMiddleware { | |
|
|
||
| await request.storage.setWithAsyncShutdown(CurrentEventKey.self, to: currentEvent) | ||
|
|
||
| #if DEBUG | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Helpful when first building, nowadays it's just better to login properly. Not worth maintaining |
||
| // 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: "[email protected]", | ||
| 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 } ?? "" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ import Foundation | |
| struct TitoTicket: Codable { | ||
| struct Metadata: Codable { | ||
| let canBookDropInSession: Bool? | ||
| let canViewDropInSessionParticipants: Bool? | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the JSON you can add to ticket types. Currently added to Internal but add it to as many types as you want (so talk show hosts). Scalable and configurable for future. |
||
| } | ||
|
|
||
| struct Release: Codable { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security is my passion