openactive / open-booking-api

Repository for the Open Booking API specification
Other
2 stars 3 forks source link

validFromBeforeStartDate and validThroughBeforeStartDate #179

Open nickevansuk opened 3 years ago

nickevansuk commented 3 years ago

The following bullet should be under the heading "Bookable Offers", as it is incorrectly under "Bookable Opportunities" (validFromBeforeStartDate is a property of the Offer).

The validFromBeforeStartDate duration (if provided) subtracted from the startDate in the past. This allows for a "bookahead" window to be specified.

Additionally there is currently no provision for a matching validThroughBeforeStartDate, in order for the time at which an Offer will no longer be available to be specified - a restriction that is already present in e.g. Bookwhen, and is therefore necessary to avoid failed booking.

lukehesluke commented 3 years ago

Just a minor thing but is validUntilBeforeStartDate easier to comprehend rather than validThroughBeforeStartDate?

Additionally, if we're updating this part of the spec, would we consider including an example in the documentation? I think the description, while exactly technically accurate, seems to be tripping people up (including me at times 😄 )

e.g. "if a session starts at 10:00 and has a validFromBeforeStartDate of PT2H, it cannot be booked at 07:00 on that day. It must be booked between the times of 08:00 - 10:00 on that day"

nickevansuk commented 3 years ago

Also this is required for cases where the booking system does not allow bookings to be made after the startDate, in which case validUntilBeforeStartDate / validThroughBeforeStartDate would need to be set to PT0S

matdavies commented 3 years ago

I'd echo Luke's comment that examples would be useful in the spec, as in fact, just now, reading his example above has clarified my understanding of a field that I currently misunderstood... Specifically ValidFromBeforeStartDate.

nickevansuk commented 2 years ago

Just reviewing this again, and part of the issue here is the difference between these two:

https://schema.org/validThrough (from http://purl.org/goodrelations/, used for schema:Offer) is a schema:Date OR schema:DateTime https://schema.org/validUntil (only used for schema:Permit) is a schema:Date

So it does seem like we need to stick with validThroughBeforeStartDate to be consistent with schema.org.

nathansalter commented 2 years ago

My assumption would be that offers were not shown in the feed if they were not applicable, but having a validThroughBeforeStartDate does make sense to me to indicate a booking window, as offers can drop off being available before they are picked up in the feed. This can allow checks before checkout to make sure that the offer should still be valid.