Introduction
Time slots is a feature that adds time based admission to your ticket sale process. Time slots are an alternative to seating and are thus not combinable with each other.
The time slot feature allocates the event to a set of dates. Each date has an assigned day scheme e.g. "weekend scheme". Each day scheme has a set of time slots, each with their own capacity. In this way the event has a dedicated capacity per time slot which is not coupled to the ticket type or event capacity.
This feature changes the process for ticket buyers as it will add a day/time slot selection step before price selection.
Detecting if time slots are enabled
Upon event selection it is important to know what features you will have to visualize for this event. The following query will tell you whether or not time slots are active:
query publicEvents { distribution(id: 143893) { events(where: {id:[123]}) { id title dateType startAt endAt usesTimeBlocks venue { title } } } } query operatorEvents { operator { events(where: {id:[123]}) { id title dateType startAt endAt
usesTimeBlocks venue { title } } } }
If the usesTimeBlocks property is true it means that at least one price in the event requires a time slot.
Day schemes
On you day/time slot selection page you will want to visualize a calendar with opening days and availabilities. This can be done by fetching the day schemes for the event:
query getDaySchemes {
distribution(id: 123) {
events(where: {id: [124]}) {
daySchemes(where: {dateAfter:"2020-05-27T22:00:00.000Z", dateBefore:"2020-06-08T21:59:59.999Z"}) {
id
date
indication
}
lastDaySchemes: daySchemes(order: [{sort:"date",order:DESC}], limit: 1) {
id
date
indication
}
}
}
}
In this query we fetch all dates on which the event is open starting on the date of today until a date of your choosing.
We also fetch the last date the event is open. This is not required, but it helps to limit your calendar date range.
Using this list you can:
- Map all event opening on your calendar
- Visualize the dates that are not returned as closed
- Based on the indication property you can color code the day as:
- AVAILABLE
- SOLD_OUT
- ALMOST_SOLD_OUT
Time slots
When the customer selects an available day, you will need to visualize the assigned time slots of that day using the day scheme id of that selection. This can be done with:
query getTimeBlocks {
distribution(id: 123) {
events(where: {id: [124]}) {
daySchemes(where: {id: 125}) {
timeBlocks {
id
startTime
endTime
capacity {
indication
}
}
}
}
}
}
Using this you can create a list of time slots which show:
- The start and end time
- Color coded availability indication similar to the day scheme
Price selection
Your price selection won't look different, but you will have to update the tickets of the ticket types that have a true 'usesTimeBlocks' property with the chosen timeBlockId:
mutation createPublicTickets {
public {
purchase {
updateTicketsWithTimeBlock(timeBlockId: 125, ticketIds: [1, 2, 3, 4]) {
id
expireAt
status
tickets {
id
priceDetail {
base
exclFee
}
}
}
}
}
}