Skip to content

Commit

Permalink
Adds location code to location for ILLiad request
Browse files Browse the repository at this point in the history
Replaces aleph_location and aleph_status with alma_location and
alma_status.
  • Loading branch information
niquerio committed Jun 26, 2024
1 parent d08fbb1 commit 57b4afa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ def initialize(item, hathi_holdings = [], work_order_option = Spectrum::Entities
@work_order_option = work_order_option
end

# mrio: 2024-06 Document Delivery wants alma_location to return the
# location code and the library display name.
# Example: GRAD Hatcher Graduate
def location_for_illiad
[@item.permanent_location, @item.library_display_name].compact.join(" ")
end

# mrio: 2022-09 per request from Dave in CVGA that items in SHAP Game
# are only "Find it in the Library"; Media Fullfillment Unit is
# pretty inconsistent so we can't use that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ def base_form
"name" => "rft.issue",
"value" => ""},
{"type" => "hidden",
"name" => "aleph_location",
"value" => @item.library_display_name},
"name" => "alma_location",
"value" => @item.location_for_illiad},
{"type" => "hidden",
"name" => "aleph_item_status",
"name" => "alma_item_status",
"value" => ""},
# this only exists for Spectrum::EmptyItemHolding
{
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/get_this/illiad_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
"value": ""
},
{
"name": "aleph_location",
"name": "alma_location",
"type": "hidden",
"value": "LOCATION"
},
{
"name": "aleph_item_status",
"name": "alma_item_status",
"type": "hidden",
"value": ""
},
Expand Down
7 changes: 7 additions & 0 deletions spec/spectrum/decorators/physical_item_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
item = Spectrum::Entities::AlmaItem.new(**@input)
described_class.new(item, [], @get_this_work_order_double)
end
context "location_for_illiad" do
it "returns expected form of illiad location" do
allow(@input[:solr_item]).to receive(:permanent_location).and_return("GRAD")
allow(@input[:holding]).to receive(:display_name).and_return("Hatcher Graduate")
expect(subject.location_for_illiad).to eq("GRAD Hatcher Graduate")
end
end
context "work order methods" do
# mrio: both of these would be booleans, but having them return strings shows
# that the correct path through the code is being used.
Expand Down
2 changes: 1 addition & 1 deletion spec/spectrum/entities/get_this_option_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def option_for(field:, value:)
allow(@item).to receive(:place).and_return("PLACE")
allow(@item).to receive(:callnumber).and_return("CALLNUMBER")
allow(@item).to receive(:edition).and_return("EDITION")
allow(@item).to receive(:library_display_name).and_return("LOCATION")
allow(@item).to receive(:location_for_illiad).and_return("LOCATION")
allow(@item).to receive(:barcode).and_return("BARCODE")
allow(@item).to receive(:oclc).and_return("OCLC")
allow(@item).to receive(:cited_title).and_return("CITED_TITLE")
Expand Down

0 comments on commit 57b4afa

Please sign in to comment.