wellcomecollection / catalogue-api

:crystal_ball: The API for searching the Wellcome Collection catalogue.
https://developers.wellcomecollection.org
MIT License
3 stars 0 forks source link

return items with available dates if applicable #756

Closed agnesgaroux closed 4 months ago

agnesgaroux commented 4 months ago

This returns a hardcoded list of AvailabilitySlots with items that satisfying the conditions

NOTE: the last case in the list of itemStates should have no available dates:

missingItemResponse(workWithAvailableItemNumber),
workWithAvailableItem,
availableOnlineAccessCondition,
availableDates // this should be None, possible bug in the Sierra updater

It looks like there's a bug with how the missing items are handled: we keep them in the item list without updating their accessConditions.

I was trying to reinvent the wheel until I realised there's already a DisplayAccessConditionOps class that give you a boolean "isRequestable" from the item's DisplayAccessCondition. Might be worth double checking the logic is sound in there

Pull request checklist