Skip to content

Commit ca1b894

Browse files
authored
Merge pull request #1723 from pulibrary/issue_1722_av
Handles availability for new work order type
2 parents 1733b46 + 948399b commit ca1b894

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

app/adapters/alma_adapter/alma_item.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def status_from_work_order_type
273273

274274
# Source for values: https://developers.exlibrisgroup.com/alma/apis/docs/xsd/rest_item.xsd/
275275
# and https://api-na.hosted.exlibrisgroup.com/almaws/v1/conf/departments?apikey=YOUR-KEY&format=json
276-
code = if value == "Bind" || value == "Pres" || value == "CDL" || value == "AcqWorkOrder"
276+
code = if value.in?(["Bind", "Pres", "CDL", "AcqWorkOrder", "CollDev"])
277277
"Not Available"
278278
else
279279
# "COURSE" or "PHYSICAL_TO_DIGITIZATION"

spec/adapters/alma_adapter/alma_item_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ def build_item(code:)
138138
)
139139
end
140140

141+
let(:item_work_order_coll_dev) do
142+
Alma::BibItem.new(
143+
"bib_data" => { "mms_id" => "99122455086806421" },
144+
"holding_data" => { "holding_id" => "22477860740006421" },
145+
"item_data" => {
146+
"pid" => "23477860730006421",
147+
"base_status" => { "value" => "0", "desc" => "Item not in place" },
148+
"process_type" => { "value" => "WORK_ORDER_DEPARTMENT", "desc" => "In Process" },
149+
"work_order_type" => { "value" => "CollDev", "desc" => "Collection Development Office" },
150+
"work_order_at" => { "value" => "CollDev", "desc" => "Collection Development Office" }
151+
}
152+
)
153+
end
154+
141155
let(:item_process_type_acq) do
142156
Alma::BibItem.new(
143157
"bib_data" => { "mms_id" => "9939075533506421" },
@@ -172,6 +186,12 @@ def build_item(code:)
172186
expect(status[:code]).to eq "Not Available"
173187
end
174188

189+
it "handles items with work order in collection development" do
190+
item = described_class.new(item_work_order_coll_dev)
191+
status = item.calculate_status
192+
expect(status[:code]).to eq "Not Available"
193+
end
194+
175195
it "handles items with process type in acquisitions" do
176196
item = described_class.new(item_process_type_acq)
177197
status = item.calculate_status

0 commit comments

Comments
 (0)