Since you can't find a non-existent booking, you must solve by the inverse. For each laptop, find an existing conflicting booking that would exclude it from being able to be booked for the requested timeframe.
(RequestedStart >= BookingBegin AND
RequestedStart <= BookingEnd)
OR
(RequestedEnd >= BookingBegin AND
RequestedEnd <= BookingEnd)
PSEUDOCODE
-----------------
Parameters:
pdtmBegin
pdtmEnd
pstrEmail
Variables:
booIsAvailable - Boolean: True
booHasBeenBooked - Boolean: False
Get Items Laptops (All)
For Each Laptop
Condition: booHasBeenBooked = False //Prevent booking more than one
Yes:
Set Variable booIsAvailable = True //Assume it can be used until proven false
Get Items Bookings (For current laptop, use criteria above for the filter.)
For Each Booking
//By virtue of the fact that an existing booking was returned, set to False
Set Variable: booIsAvailable = False
//End For Each Booking
Condition: booIsAvailable = True
Yes: Create new Item
Send booking email
Set Variable: booHasBeenBooked = True
//End Condition: booIsAvailable
//End For Each Laptop
This code has no provision for optimization/exceptions. For example, if one user returns a laptop earlier or later than booked. Or, perhaps after each booking, the IT department needs to perform maintenance.
You could easily ignore any booking returned early, but one that is returned late can cause severe havoc. So, be sure to implement a routine to reallocate resources when this occurs.
Writing the ODATA in the GetItems isn't easy nor intuitive. Feel free to ask specific questions about it.