BAT Events are the events that our types of units can go through. Typically there will be two types of events, availability events and pricing events. BAT, however, makes no assumptions about this. Instead, it provides tools that enable you - the booking tool builder - to define the types of events that happen to your units.
Create an Event Type¶
As an example, we will create an Availability Event Type to manage the availability of meeting rooms.
admin/bat/events/event-types/add and define an event called “Meeting Room Availability.”
There are two possible types of event states: fixed or open.
Fixed Event States¶
Fixed event states can only have a pre-defined set of values associated with them. This allows us to define states such as “Available” and “Booked” by associating numerical (integer) values to those labels.
Furthermore, fixed event states can be blocking or not. Blocking states means that they cannot simply be overriden on the calendar by dragging over them and assigning a new state. They need to be dealt with explicitly. A great example is a booking event. You need to explicitly delete a booking, you cannot simply drag over it and delete it. Instead, if you are simply making something available or unavaialble, you can just drag and select the dates and change the state of the event for those dates.
Open Event States¶
Open event states can have any integer value associated with them. This is great for managing pricing over time. A pricing event can have a value assigned to it that represents the price of booking a unit over that time period.
Events can either be of hourly or daily granularity. This setting simply influences how BAT presents the interface to a user, since all events are saved down to the minute granularity in the database.
Define Event States¶
Once the event type is created, we can add fields to it that will contain the event value over a time period.
Fixed Event States¶
Arbitrary Event States¶
For arbitrary event states, you simply add a field that will hold the event value and then indicate what field that is so BAT can use it. For example, for a pricing type event we would:
- Add an integer (or commerce price) field to hold the cost
- Then in
admin/bat/events/event-types/manage/<my event type>we select that field as holding the event value.