sul-dlss / searchworks_traject_indexer

indexing MARC, MODS, and more for SearchWorks
Other
6 stars 1 forks source link

Index FOLIO course reserves data #667

Closed cbeer closed 1 year ago

cbeer commented 2 years ago

We punted on all the CREZ data indexing for FOLIO. Unclear where we're getting that reserves data in FOLIO, but there's probably work for us to do there.

thatbudakguy commented 2 years ago

@saseestone is going to create some fixture data for us in FOLIO and make sure it's associated with items for testing.

saseestone commented 2 years ago

1 course created

Course code: AFRICAAM-105-01 Course name: Black Matters: Introduction to Black Studies

Cross-listed with course code: AFRICAAM-269-01

It's got two items associated with it: item barcode: 36105021019562 item barcode: 36105021837179

I'll be spending a bit more time today to create a couple more courses that are more simple. (Once course, one item). I'll add them below as they get created.

saseestone commented 2 years ago

Another fixture course:

Course code: AFRICAAM-158-01 Course name: Rebellion: Black Resistance in the Caribbean Item ID associated with course: 36105212524685

cbeer commented 2 years ago

Thanks. We're able to pull back data from the course reserves API.

We're unsure how FOLIO handles the current location + loan period when an item is actively on reserve (or if we continue to need our Symphony data rewriting hacks)

saseestone commented 2 years ago

About (current) locations - called "Temporary Location" in the FOLIO UI....

If an item is associated with a course, it's "on reserve", and it will be using a location that is labeled "Temporary Location" in the FOLIO UI. Locations used for reserves will include "Reserve" in the Location Code - e.g. GRE-RESERVE or EDU-RESERVE.

When Darsi created the locations in FOLIO, there wasn't a way to indicate which locations are "Temporary" and which are "Permanent". There is just a locations list. So I think that means we're looking for locations with "-RESERVE" - either dynamically or with a specific list.

Also something to note: FOLIO doesn't have any way (currently) to prepare Item records ahead of the quarter or stage them in some way. Unlike Symphony, FOLIO doesn't have a reserve status like "prepare" or "dormant". So a course record has either:

A. Items associated with the course, and therefore all the items are actively "on reserve" and in a (temporary) location with "RESERVE" in the location code OR B. No items associated with the course, and therefore no items are on reserve (and we shouldn't display anything about the Course in SearchWorks.

saseestone commented 2 years ago

About loan periods...

@cbeer I think a step was missed in the "How to create Course records" demo. (Or I just missed seeing it.)

It turns out that staff have to assign a temporary loan period AFTER they have associated the item with the Course.

When I associated the first few items with courses, I did NOT update the item to use a temporary loan period. So when I tried to checkout an item (36105021837179 - Title: Lions, black skins...) it applied the one year loan. That made me seriously scratch my head about what was going on.

But after going back to the Courses app, and selecting to edit the item in the FOLIO ui, I can see a field to input a "Temporary loan type". I edited 36105022956788 (Title: Wounds of the spirit...) to use a "2-hour loan type". After that update, I checked out the item and got a due date of 8/16/22 at 2:00pm. (Not 2 hours, but I suspect that it's because I'm close to closing time and the due date is rolling forward. We do this in Symphony, so I'm assuming they are doing this in FOLIO too.)

Does that help?

saseestone commented 2 years ago

Successfully added a "Fast Add" item to course id = AFRICAAM-105-01. Item barcode: GRPC0005C01

thatbudakguy commented 1 year ago

We're retrieving some of this info from the database now, but not using it yet: https://github.com/sul-dlss/searchworks_traject_indexer/blob/4d6a9d33e674344f9e0e6b20263e5c8b2709ae22/lib/traject/readers/folio_postgres_reader.rb#L68-L79

We want to get it into these fields when indexing (some may no longer be relevant): https://github.com/sul-dlss/searchworks_traject_indexer/blob/4d6a9d33e674344f9e0e6b20263e5c8b2709ae22/lib/traject/config/sirsi_config.rb#L2766-L2827

thatbudakguy commented 1 year ago

Old PR https://github.com/sul-dlss/searchworks_traject_indexer/pull/686 might've been created prior to switching to database-based indexing strategy, so no longer relevant — but it might include some useful snippets

thatbudakguy commented 1 year ago

You can find items on reserve by clicking on the "course reserves" box on the SearchWorks homepage, e.g.: https://searchworks.stanford.edu/view/10765880

Check how the "reserves" dropdown appears on the result list, and how the "reserves" box appears on the show page:

Image

saseestone commented 1 year ago

Lots of courses in folio-test now to work with. Notable examples:

Cross-listed courses (e.g. classes with the same item list, but taught under multiple course numbers)

Courses with multiple instructors:

Inactive courses (and therefore shouldn't be visible in the Course Reserve catalog or in SW item details)

thatbudakguy commented 1 year ago

copying here some questions from the earlier PR:

I don't think we do. for courses that have a location set (not all do), e.g. The Romans, it appears that that location is used to determine the effective location for items on reserve for that course (e.g. A Brief History of the Romans, which normally resides in green stacks but has an effective location of green reserves).

it does:

"effectiveLocation": {
          "id": "4a911835-3488-4d26-9293-bdc625c9afce",
          "code": "GRE-CRES",
          "name": "Green Library Reserves",
          "campus": {
            "id": "c365047a-51f2-45ce-8601-e421ca3615c5",
            "code": "SUL",
            "name": "Stanford Libraries"
          },
          "details": {
          },
          "library": {
            "id": "f6b5519e-88d9-413e-924d-9ed96255f72e",
            "code": "GREEN",
            "name": "Cecil H. Green"
          },
          "institution": {
            "id": "8d433cdd-4e8f-4dc1-aa24-8a4ddb7dc929",
            "code": "SU",
            "name": "Stanford University"
          }
        }