Define Prismic hours model
Create logic to generate list of ~AvailabilitySlots~ nextOpeningDates with these constraints
~Any booking made before 10am, time series start at day+1. For bookings made after 10am, time series start at day+2~
~Time series covers the next 12 days when the library is open~
the list should cover the next 14 days when the library is open, starting the day after the current date
After discussion with @jamieparkinson and @kenoir and seeing as:
the content-api is our Prismic proxy
library opening hours is Prismic data
we need to process the Prismic data in order to generate a list of available dates
the items API has to do an API call to get the opening hours (and we'd rather have it call one of our APIs)
library opening hours are not part of the catalogue-api domain as it is
Then
the content-api become the source of truth for library opening hours
this involves adding a venues pipeline/index and API
the index should hold the regular opening hours and exceptional opening hours in the display object
the pipeline should also transform the regular and exceptional opening hours into a list of nextOpeningDates
nextOpeningDates: {
open: Date,
close: Date
}[]
the list should be about 14 long, to account for the different lead times depending on when the request is made (before or after 10am)
the catalogue-api will select the 1st suitable date, and trim the end down to make it of length 12. This will be the availableDates in the items response
Define Prismic hours model Create logic to generate list of ~
AvailabilitySlots
~nextOpeningDates
with these constraintsAfter discussion with @jamieparkinson and @kenoir and seeing as:
venues
pipeline/index and APIdisplay
objectnextOpeningDates
availableDates
in the items response