ReservationCollectionTimeSlotFinder
Finds timeslots for a list of reservation collections.
Methods
Inner Classes
Example
This example shows how you can use the class in your own code.
// Create the context that determines the range and size of the slots.
B25.TimeSlotGenerator.Context timeSlotContext = new B25.TimeSlotGenerator.Context();
timeSlotContext.startOfRange = Datetime.newInstance(2024, 01, 01, 0, 0, 0);
timeSlotContext.endOfRange = Datetime.newInstance(2024, 01, 07, 0, 0, 0);
timeSlotContext.duration = 15;
// Create the input for the method
B25.ReservationCollectionTimeSlotFinder.Context findContext = new B25.ReservationCollectionTimeSlotFinder.Context();
findContext.collectionsToCheck = <List of collections most likely from ReservationBlueprints>
findContext.timeSlotContext = timeSlotContext;
// Call the method.
B25.ReservationCollectionTimeSlotFinder.Result result = B25.ReservationCollectionTimeSlotFinder.findTimeSlots(findContext);
// Do something witht he results for now just print them to the debug log.
for (B25.TimeSlotWithReservationCollections slot : result.timeSlots) {
System.debug('available time slot from ' + timeSlot.startDatetime
+ ' until ' + timeSlot.endDatetime);
System.debug('Possible Reservations');
for (B25.ReservationCollection reservationCollection : timeSlot.reservationCollections) {
System.debug(reservationCollection);
}
}