-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set current location from request service point for 'awaiting pickup' items #1020
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# frozen_string_literal: true | ||
|
||
module Folio | ||
# Folio::StatusCurrentLocation takes an item | ||
# and any requests associated with the item's instance record | ||
# and creates an equivalent Symphony current location | ||
class StatusCurrentLocation | ||
attr_reader :item | ||
|
||
def initialize(item) | ||
@item = item | ||
end | ||
|
||
def current_location | ||
case status | ||
when 'Checked out', 'Claimed returned', 'Aged to lost' | ||
'CHECKEDOUT' | ||
when 'Awaiting pickup' | ||
symphony_pickup_location_code | ||
when 'In process', 'In process (non-requestable)' | ||
'INPROCESS' | ||
when 'In transit', 'Awaiting delivery' | ||
'INTRANSIT' | ||
when 'Missing', 'Long missing' | ||
'MISSING' | ||
when 'On order' | ||
'ON-ORDER' | ||
end | ||
end | ||
|
||
private | ||
|
||
def status | ||
item['status'] | ||
end | ||
|
||
# ARS-LOAN, RUM-LOAN, and SPE-LOAN each receives a | ||
# special label in SearchWorks. Other codes are generically | ||
# mapped to GRE-LOAN since they all receive the same label. | ||
def symphony_pickup_location_code | ||
case service_point_code | ||
when 'ARS' | ||
'ARS-LOAN' | ||
when 'RUMSEY-MAP' | ||
'RUM-LOAN' | ||
when 'SPEC' | ||
'SPE-LOAN' | ||
else | ||
'GRE-LOAN' | ||
end | ||
end | ||
|
||
def service_point_code | ||
item&.dig('request', 'pickupServicePoint', 'code') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where will these labels come from in Searchworks? Aren't we moving toward using Folio location labels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The equivalent in FOLIO for these locations would be service points, which I don't think we're doing anything with in SearchWorks yet. We might want to. But this gets us to parity with Symphony by relying on the existing
Constants:LOCS
mappings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the intention is to remove
Constants::LOCS
after migrating to Folio, so we need to handle these in some other way. (see sul-dlss/SearchWorks#3310)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbeer I'm confused about what the plan is for
Constants::LOCS
vs FOLIO display names. My guess is we're still going to have location codes that don't map to anything in FOLIO and we'll need to maintain a fallback list in SearchWorks (maybe I'm wrong about this). This PR is a refinement to previous work to map folio statuses to symphony locations so they'll display right in searchworks. Is this no longer what we want to do?See:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to capture post-folio work related to this in #1026