@@ -12,7 +12,7 @@ class DeliveryLocationsResolver {
1212 }
1313
1414 static requestableBasedOnHoldingLocation ( item ) {
15- const locationCode = DeliveryLocationsResolver . extractLocationCode ( item )
15+ const locationCode = this . extractLocationCode ( item )
1616
1717 if ( ! DeliveryLocationsResolver . nyplCoreLocation ( locationCode ) ) {
1818 logger . warn ( `DeliveryLocationsResolver: Unrecognized holdingLocation for ${ item . uri } : ${ locationCode } ` )
@@ -166,7 +166,7 @@ class DeliveryLocationsResolver {
166166 return {
167167 id : `loc:${ location . code } ` ,
168168 label : location . label ,
169- sortPosition : DeliveryLocationsResolver . sortPosition ( location )
169+ sortPosition : this . sortPosition ( location )
170170 }
171171 } )
172172 // Either way, sort deliveryLocation entries by name:
@@ -191,14 +191,14 @@ class DeliveryLocationsResolver {
191191 }
192192
193193 static attachRecapDeliveryInfo ( item ) {
194- const info = DeliveryLocationsResolver . getRecapDeliveryInfo ( item )
194+ const info = this . getRecapDeliveryInfo ( item )
195195 item . eddRequestable = info . eddRequestable
196196 item . deliveryLocation = info . deliveryLocation
197197 return item
198198 }
199199
200200 static attachOnsiteDeliveryInfo ( item ) {
201- const info = DeliveryLocationsResolver . getOnsiteDeliveryInfo ( item )
201+ const info = this . getOnsiteDeliveryInfo ( item )
202202 item . eddRequestable = info . eddRequestable
203203 item . deliveryLocation = info . deliveryLocation
204204 return item
@@ -212,15 +212,15 @@ class DeliveryLocationsResolver {
212212 const hasRecapCustomerCode = item . recapCustomerCode && item . recapCustomerCode [ 0 ]
213213 const nyplItem = isItemNyplOwned ( item )
214214 if ( ! hasRecapCustomerCode ) {
215- const requestableBasedOnHoldingLocation = nyplItem ? DeliveryLocationsResolver . requestableBasedOnHoldingLocation ( item ) : true
215+ const requestableBasedOnHoldingLocation = nyplItem ? this . requestableBasedOnHoldingLocation ( item ) : true
216216 // the length of the list of delivery locations is checked later to determine physical requestability
217217 // In case of an offsite item with no recap customer code, we want this to be based on holding location
218218 // so we put a placeholder '' in case it is requestable based on holding location
219219 deliveryLocation = requestableBasedOnHoldingLocation ? [ '' ] : [ ]
220220 eddRequestable = requestableBasedOnHoldingLocation
221- } else if ( ! nyplItem || DeliveryLocationsResolver . requestableBasedOnHoldingLocation ( item ) ) {
222- deliveryLocation = DeliveryLocationsResolver . deliveryLocationsByRecapCustomerCode ( item . recapCustomerCode [ 0 ] )
223- eddRequestable = DeliveryLocationsResolver . __eddRequestableByCustomerCode ( item . recapCustomerCode [ 0 ] )
221+ } else if ( ! nyplItem || this . requestableBasedOnHoldingLocation ( item ) ) {
222+ deliveryLocation = this . deliveryLocationsByRecapCustomerCode ( item . recapCustomerCode [ 0 ] )
223+ eddRequestable = this . __eddRequestableByCustomerCode ( item . recapCustomerCode [ 0 ] )
224224 } else {
225225 deliveryLocation = [ ]
226226 eddRequestable = false
@@ -233,7 +233,7 @@ class DeliveryLocationsResolver {
233233 eddRequestable : false ,
234234 deliveryLocation : [ ]
235235 }
236- const holdingLocationCode = DeliveryLocationsResolver . extractLocationCode ( item )
236+ const holdingLocationCode = this . extractLocationCode ( item )
237237 const sierraData = DeliveryLocationsResolver . nyplCoreLocation ( holdingLocationCode )
238238 if ( ! sierraData ) {
239239 // This case is mainly to satisfy a test which wants eddRequestable = false
@@ -243,15 +243,15 @@ class DeliveryLocationsResolver {
243243 }
244244 // if nypl core says it's unrequestable, it can still be eddRequestable,
245245 // but its definitely not phys requestable.
246- deliveryInfo . eddRequestable = DeliveryLocationsResolver . eddRequestableByOnSiteCriteria ( item )
247- if ( ! DeliveryLocationsResolver . requestableBasedOnHoldingLocation ( item ) ) {
246+ deliveryInfo . eddRequestable = this . eddRequestableByOnSiteCriteria ( item )
247+ if ( ! this . requestableBasedOnHoldingLocation ( item ) ) {
248248 return deliveryInfo
249249 }
250250 // if nypl-core reports that a holding location's delivery locations
251251 // should be found by M2 code, but only if the item has an M2 customer code
252252 const deliverableToResolution = sierraData . deliverableToResolution
253253 if ( deliverableToResolution === 'm2-customer-code' && item . m2CustomerCode && item . m2CustomerCode [ 0 ] ) {
254- deliveryInfo . deliveryLocation = DeliveryLocationsResolver . deliveryLocationsByM2CustomerCode ( item . m2CustomerCode [ 0 ] )
254+ deliveryInfo . deliveryLocation = this . deliveryLocationsByM2CustomerCode ( item . m2CustomerCode [ 0 ] )
255255 }
256256 // if no value, default to sierra location lookup
257257 if ( ! deliverableToResolution ) {
@@ -275,15 +275,15 @@ class DeliveryLocationsResolver {
275275 }
276276
277277 /**
278- * Given an array of items (ES hits), returns the same items with `eddRequestable` & `deliveryLocations`. We verify all recap customer codes because our indexed data may be stale.
278+ * Given an array of items (ES hits), returns the same items with `eddRequestable` & `deliveryLocations`
279279 *
280280 * @return Promise<Array<items>> A Promise that resolves and array of items, modified to include `eddRequestable` & `deliveryLocations`
281281 */
282282 static attachDeliveryLocationsAndEddRequestability ( items , scholarRoom ) {
283283 // Extract ReCAP barcodes from items:
284- const recapBarcodes = DeliveryLocationsResolver . extractRecapBarcodes ( items )
284+ const recapBarcodes = this . extractRecapBarcodes ( items )
285285 // Get a map from barcodes to ReCAP customercodes:
286- return DeliveryLocationsResolver . __recapCustomerCodesByBarcodes ( recapBarcodes )
286+ return this . __recapCustomerCodesByBarcodes ( recapBarcodes )
287287 . then ( ( barcodeToRecapCustomerCode ) => {
288288 // Now map over items to affix deliveryLocations:
289289 return items . map ( ( item ) => {
@@ -292,15 +292,15 @@ class DeliveryLocationsResolver {
292292 item . recapCustomerCode = [ barcodeToRecapCustomerCode [ barcode ] ]
293293 // If recap has a customer code for this barcode, map it by recap cust code:
294294 if ( item . recapCustomerCode [ 0 ] ) {
295- item = DeliveryLocationsResolver . attachRecapDeliveryInfo ( item )
295+ item = this . attachRecapDeliveryInfo ( item )
296296 // Otherwise, it's an onsite item
297297 } else {
298- item = DeliveryLocationsResolver . attachOnsiteDeliveryInfo ( item )
298+ item = this . attachOnsiteDeliveryInfo ( item )
299299 }
300300 // Establish default for Electronic Document Delivery flag:
301301 item . eddRequestable = ! ! item . eddRequestable
302- const filteredDeliveryLocationsWithScholarRoom = DeliveryLocationsResolver . filterLocations ( item . deliveryLocation , scholarRoom )
303- item . deliveryLocation = DeliveryLocationsResolver . formatLocations ( filteredDeliveryLocationsWithScholarRoom )
302+ const filteredDeliveryLocationsWithScholarRoom = this . filterLocations ( item . deliveryLocation , scholarRoom )
303+ item . deliveryLocation = this . formatLocations ( filteredDeliveryLocationsWithScholarRoom )
304304 return item
305305 } )
306306 } )
0 commit comments