Skip to content

Commit

Permalink
Merge pull request #376 from NYPL/SCC-4071/disable-schomburg
Browse files Browse the repository at this point in the history
remove schomburg phys requestability logic
  • Loading branch information
charmingduchess authored Apr 11, 2024
2 parents 7965615 + 43936a6 commit 6ad77e0
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 1,181 deletions.
6 changes: 1 addition & 5 deletions lib/requestability_resolver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const DeliveryLocationsResolver = require('./delivery-locations-resolver')
const { isItemNyplOwned } = require('./ownership_determination')
const { isInRecap, isInSchomburg, getSchomburgDeliveryInfo } = require('./util')
const { isInRecap } = require('./util')
const logger = require('./logger')
class RequestabilityResolver {
static fixItemRequestability (elasticSearchResponse) {
Expand All @@ -26,10 +26,6 @@ class RequestabilityResolver {
physRequestableCriteria = `${deliveryInfo.deliveryLocation &&
deliveryInfo.deliveryLocation.length || 0} delivery locations.`
}
if (isInSchomburg(item)) {
deliveryInfo = getSchomburgDeliveryInfo(item, deliveryInfo)
physRequestableCriteria = deliveryInfo.criteria
}
item.eddRequestable = !!deliveryInfo.eddRequestable
item.physRequestable = !!(deliveryInfo.deliveryLocation &&
deliveryInfo.deliveryLocation.length)
Expand Down
25 changes: 0 additions & 25 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,28 +486,3 @@ exports.isInRecap = (item) => {
exports.itemHasRecapHoldingLocation(item) ||
!isItemNyplOwned(item)
}

exports.isInSchomburg = (item) => {
const holdingLocation = exports.deepValue(item, 'holdingLocation[0].id')
if (holdingLocation) {
return holdingLocation.startsWith('loc:sc')
}
}

exports.getSchomburgDeliveryInfo = (item, deliveryInfo) => {
const itemType = exports.deepValue(item, 'catalogItemType[0].id')
if (itemType) {
const itemNumber = itemType.split(':')[1]
const holdingLocation = exports.deepValue(item, 'holdingLocation[0].id')
const case1 = holdingLocation === 'loc:scff3' && itemNumber === '26'
const case2 = holdingLocation === 'loc:scff2' && itemNumber === '6'
let criteria
if (case1) criteria = 'scff3 microfiche'
else if (case2) criteria = 'scff2 microfilm'
else {
deliveryInfo.deliveryLocation = []
criteria = 'Non requestable schomburg catalog item type ' + itemNumber
}
return Object.assign({}, deliveryInfo, { criteria })
}
}
Loading

0 comments on commit 6ad77e0

Please sign in to comment.