Bookable products may have a list of bookings associated with them. A booking is typically inserted in the OrderIntegrationMgr once the order has been paid for. If for example a bookable product represents a course, then you may define a maximum number of bookings (people attending the course) which is taken into consideration when inserting new ones. When reserving stock for such a bookable product, what you really want to reserve are places on the course to give you the time to check out without the places being lost.
Stock reservation functionality uses the product quantity attribute, so In order to successfully use stock reservation with bookable products you need to do the following:
Set the quantity of the product to match the maximum number of bookings available.
When calling updateInventoryWithOptions() you need to instruct KonaKart not to modify the inventory for bookable products since this will be done every time a booking is inserted. To do this you have to set the following attribute on CreateOrderOptions:
setInventoryUpdateExcludeProdTypes( new int[]{com.konakart.bl.ProductMgr.BOOKABLE_PRODUCT_TYPE})
This instructs KonaKart to not modify the inventory level for all products of type Bookable Product within the order.
Finally, every time a booking is inserted you need to set updateInventoryWithBookings to true on the BookableProductOptions object. When inserting a new booking, we automatically update the bookingsMade attribute of the BookableProduct object. When this attribute is set to true, we also update the quantity attribute of the Product object so that it is decreased every time a booking is added by the quantity of the booking.
For the Admin App there is an updateInventoryWithBookings attribute on the AdminBookableProductOptions object. In this case the quantity attribute of the Product object is modified both when a booking is inserted and when one is deleted.