Event types
Services or event-type are the fundamental concepts of TimeTime. An event-type is used to represent a service that can be booked. For example, a hair salon may have two types of events: "Haircut" and "Wash and Blow-dry".
Schema
Field | Type | Description |
---|---|---|
id | String | A unique uid for the event type. |
name | String | The name of the event type. This will be public facing |
description | String | An extra string containing information about the event type |
duration | Duration | An ISO string indicating the duration of the events for this event type |
step | Duration | An ISO string indicating when the service allows to start |
owner | String | The id of owner of the event type. |
imageUrl | String | A URL to an image in png or jpg format that is used in the UI to illustrate the service. |
unitsLabel | String | Only activated when the service has units. Indicates to the UI what to display in the selector. |
theme | String | The color scheme that will be used in the public facing pages. |
questions | Array<Question> | An array of questions that will be displayed to the booker |
resourceRules | Object | An object explaining the resources that are required for this event type. |
resourceRules.linkedResources | Array<{id: String}> | When linked resources are configured, the availability of those will be taken into account for the event type availability check. |
enabled | Boolean | When false the event type will never be available for bookings. |
workflows | Array<{id: String}> | An array of workflows that related to this event type. |
Questions
It is common for services to have associated questions. For example, a restaurant may want to know about customer allergies. Questions are defined in the questions attribute of the service.
Questions are an array of question objects, which in turn have different subtypes: EmailQuestion, LocationQuestion, PasswordQuestion, PhoneQuestion, TextQuestion.
Schema
All questions have id, label, and required as common attributes. The LocationQuestion field has an additional attribute AllowedOptions that defines which options are available to the user.
Field | Type | Description |
---|---|---|
id | String | A unique uid for the question. |
label | String | The label that will be displayed to the booked. |
required | Boolean | When true answering the question is required to make a booking. |
type | Enum | The type of the question. EmailQuestion , LocationQuestion , PasswordQuestion , TextQuestion |
Question types
Email
Questions of type email allow the client to ask for their email.
Example: Email question type
questions: [
{
id: "b10bb986-2732-41d0-bf19-e0700eed2158"
label: "write your email here",
required: true,
type: "EmailQuestion",
},
];
Location
Location questions allow the client to enter a location.
Example: Location question type
questions: [
{
id: "b10bb986-2732-41d0-bf19-e0700eed2158"
label: "Write your desired location",
required: true,
type: "LocationQuestion",
allowedOptions: [""],
},
];
Password
Questions of type password allow the client to ask for their password.
Example: Password question type
questions: [
{
id: "b10bb986-2732-41d0-bf19-e0700eed2158"
label: "Write a passwrord",
required: true,
type: "PasswordQuestion",
},
];
Phone
Questions of type phone allow the client to ask for their phone number.
Example: Phone question type
questions: [
{
id: "b10bb986-2732-41d0-bf19-e0700eed2158"
label: "Write your phone number",
required: true,
type: "PhoneQuestion",
},
];
Text
Questions of type text allow the client to enter a generic text before making the reservation.
Example: Text question type
questions: [
{
id: "b10bb986-2732-41d0-bf19-e0700eed2158"
label: "Write your food preferences",
required: true,
type: "TextQuestion",
},
];
Availability Rules
An event type can have its own availability rules or combine resources to create a meta-availability.
Normally, for simple event types, it will be sufficient to define the availability within the event type itself. For example, to book a meeting room, it will be enough to indicate a minimum notice period and specific time slots.
For more complex cases, availability can be generated from linkedResources where the availability of different entities is combined to create more complex availability rules.
For instance, a tennis class, where a court and a coach are required. These will be modeled as linkedResources and will have their own availability rules.
Check the availability rules section. to see all the rules available.