Skip to content

Commit

Permalink
make spec mutually exclusive with edd and physRequestable
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Dec 19, 2024
1 parent 76a75bc commit aebc0b8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/requestability_resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ class RequestabilityResolver {
physRequestableCriteria = `${(deliveryInfo.deliveryLocation &&
deliveryInfo.deliveryLocation.length) || 0} delivery locations.`
}
item.eddRequestable = !!deliveryInfo.eddRequestable
item.physRequestable = !!(deliveryInfo.deliveryLocation &&
deliveryInfo.deliveryLocation.length)

item.specRequestable = this.buildSpecRequestable(item, parentBibHasFindingAid)
item.physRequestable = !!(deliveryInfo.deliveryLocation &&
deliveryInfo.deliveryLocation.length) && !item.specRequestable
item.eddRequestable = !!deliveryInfo.eddRequestable && !item.specRequestable
// items without barcodes should not be requestable
const hasBarcode = (item.identifier || []).some((identifier) => /^(urn|bf):[bB]arcode:\w+/.test(identifier))
if (isItemNyplOwned(item) && !hasBarcode) {
Expand All @@ -50,7 +49,6 @@ class RequestabilityResolver {
const holdingLocation = DeliveryLocationsResolver.extractLocationCode(item)
const nyplCoreLocation = DeliveryLocationsResolver.nyplCoreLocation(holdingLocation)
const isSpecialCollectionsOnlyAccessType = !!(nyplCoreLocation?.collectionAccessType === 'special')
console.log(parentBibHasFindingAid)
return !!item.aeonUrl || parentBibHasFindingAid || isSpecialCollectionsOnlyAccessType
}
}
Expand Down

0 comments on commit aebc0b8

Please sign in to comment.