# Booking

#### Installation

Install the app in the Eliona Store.

#### Configuration \[optional]

After installation, you can change the configuration in the generic frontend: There is a default configuration, which can be retrieved via `GET` `/config` . You can change this configuration and send it to the `POST` endpoint using `/config` . Here is an example of a configuration:

```json
{
    "dayStartHours": 8,
    "dayStartMinutes": 0,
    "middayStartHours": 12,
    "middayStartMinutes": 0,
    "middayEndHours": 13,
    "middayEndMinutes": 0,
    "dayEndHours": 17,
    "dayEndMinutes": 0,
    "noShowMins": 15,
    "adHocBookAfterMins": 15,
    "adHocBookForMins": 30,
    "presenceAttributeName": "presence"
}
```

This configuration is used to define the quick booking boundaries - for example, booking a resource for the morning will result in a booking from 8:00 to 12:00.

`noShowMins` sets the time after which the booking is automatically canceled. A negative number disables this feature. (more details in the "No Show" section)

Note that when retrieving the configuration, fields with zero values are omitted.

#### Setting up bookable resources

> If you use a synchronization app for external services with CAC (e.g. EWS app), skip this step. The resource types and resources will be created automatically.

For a resource to be bookable, it must be defined both in the resource type and in the specific resource.

The resource type must have the "bookable" attribute of subtype "property", and the resource must set this property to "1".

In addition, the resource type should have the input attribute "occupancy", into which information about the current booking status is written.

These resources must then be placed on a floor either as a polygon (e.g. rooms) or as a point of interest. Set "Occupied" as the attribute, set value-based color (0 for free, 1 for occupied), and set the property "Resource can be booked".

In the dashboard -> Widgets, create a new widget type and add a "Booking" block.

After you have created the widget type, create a new dashboard and use this widget type. Configure the desired floor and the resources to include.

In this dashboard, users can book the resources.

### Booking

Click on the resource you want to book and follow the form to book the resource for the desired time.

The form allows booking in two ways: quick booking and advanced booking. Quick booking allows the user to quickly book the resource for a predefined part of the day (specified in the configuration), while advanced booking allows the user to specify the exact time for the booking.

Resources are booked for a specific user, and users can manage their bookings in the same place where they can book the resources.

If an external service is connected and the resource is linked to it, this booking will be forwarded to the external service. Conversely, bookings created in this external service will also be synchronized with Eliona.

### No Show

The app can automatically cancel bookings if no person appears in the room. This feature is set by the parameter `noShowMins` in the configuration.

The room or its child locations must have exactly one attribute named as configured in `presenceAttributeName` . This means the room could have a virtual attribute referencing information from other sensors, or there could be a person or presence sensor installed that provides the presence information.

As soon as the app has information about presence and `noShowMins >= 0` is set, it monitors recently started bookings for presence. If no presence is detected within the first noShowMins of the booking, the booking is canceled.

If the room does not have a presence sensor, no action is taken.

### Ad-hoc booking

The app can automatically book rooms that are occupied for a certain time. The requirements are the same as for No Show.

Ad-hoc bookings are automatically enabled for rooms that have ever been booked. It can be disabled entirely by setting `adHocBookAfterMins < 0` .

If someone is continuously present in the room for `adHocBookAfterMins` and the room has no booking during this time (not yet in `adHocBookForMins` since the start), the room will be booked for `adHocBookForMins` since the start.

### External services

The Booking app can be connected to external booking services. Currently we offer a connection to Microsoft Exchange / Outlook calendar via the [Exchange App](https://doc.eliona.io/collection/apps/apps/exchange-app) . Please contact us to learn about additional integrations.
